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

11
NEWS
View File

@@ -3,6 +3,17 @@ NEWS for veteran Window Maker users
-- 0.95.8 -- 0.95.8
Move pointer with maximized windows
-----------------------------------
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.
Alternative way for traverse half-maximized windows Alternative way for traverse half-maximized windows
--------------------------------------------------- ---------------------------------------------------

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) * Do the animation while shading (called with what = SHADE)
* or unshading (what = UNSHADE). * or unshading (what = UNSHADE).

View File

@@ -81,5 +81,7 @@ void wUnfullscreenWindow(WWindow *wwin);
void animateResize(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int fw, int fh); void animateResize(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int fw, int fh);
void update_saved_geometry(WWindow *wwin); void update_saved_geometry(WWindow *wwin);
void movePionterToWindowCenter(WWindow *wwin);
#endif #endif

View File

@@ -1500,6 +1500,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_HORIZONTAL | MAX_KEYBOARD); handleMaximize(wwin, MAX_HORIZONTAL | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_LHMAXIMIZE: case WKBD_LHMAXIMIZE:
@@ -1507,6 +1508,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_RHMAXIMIZE: case WKBD_RHMAXIMIZE:
@@ -1514,6 +1516,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_THMAXIMIZE: case WKBD_THMAXIMIZE:
@@ -1521,6 +1524,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_HORIZONTAL | MAX_TOPHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_HORIZONTAL | MAX_TOPHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_BHMAXIMIZE: case WKBD_BHMAXIMIZE:
@@ -1528,6 +1532,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_LTCMAXIMIZE: case WKBD_LTCMAXIMIZE:
@@ -1535,6 +1540,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_LEFTHALF | MAX_TOPHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_LEFTHALF | MAX_TOPHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_RTCMAXIMIZE: case WKBD_RTCMAXIMIZE:
@@ -1542,6 +1548,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_RIGHTHALF | MAX_TOPHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_RIGHTHALF | MAX_TOPHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_LBCMAXIMIZE: case WKBD_LBCMAXIMIZE:
@@ -1549,6 +1556,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_LEFTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_LEFTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_RBCMAXIMIZE: case WKBD_RBCMAXIMIZE:
@@ -1556,6 +1564,7 @@ static void handleKeyPress(XEvent * event)
CloseWindowMenu(scr); CloseWindowMenu(scr);
handleMaximize(wwin, MAX_RIGHTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); handleMaximize(wwin, MAX_RIGHTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD);
movePionterToWindowCenter(wwin);
} }
break; break;
case WKBD_MAXIMUS: case WKBD_MAXIMUS: