1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00

Implementation for moving mouse pointer within the maximized window.

Mouse pointer can be now moved together with window if keyboard was used
for arrange maximized windows on screen. This feature can be turned on
in WPrefs.app in Expert tab by selecting "Move mouse pointer with half
MAXIMIZED windows.", or setting "PointerWithHalfMaxWindows" to "Yes" on
~/GNUstep/Defaults/WindowMaker file.
This commit is contained in:
2017-02-21 18:56:15 +01:00
committed by Carlos R. Mafra
parent c9fbcda0b0
commit 9328ba5b3c
4 changed files with 39 additions and 0 deletions

View File

@@ -2078,6 +2078,23 @@ void wMakeWindowVisible(WWindow *wwin)
}
}
void movePionterToWindowCenter(WWindow *wwin)
{
if (!wPreferences.pointer_with_half_max_windows) {
wmessage("pointer_with_half_max_windows not set. do nothing");
return;
}
wmessage("move the pointer to: %dx%d",
wwin->frame_x + wwin->client.width / 2,
wwin->frame_y + wwin->client.height / 2);
XSelectInput(dpy, wwin->client_win, wwin->event_mask);
XWarpPointer(dpy, None, wwin->screen_ptr->root_win, 0, 0, 0, 0,
wwin->frame_x + wwin->client.width / 2,
wwin->frame_y + wwin->client.height / 2);
XFlush(dpy);
}
/*
* Do the animation while shading (called with what = SHADE)
* or unshading (what = UNSHADE).