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:
11
NEWS
11
NEWS
@@ -3,6 +3,17 @@ NEWS for veteran Window Maker users
|
||||
|
||||
-- 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
|
||||
---------------------------------------------------
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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 update_saved_geometry(WWindow *wwin);
|
||||
|
||||
void movePionterToWindowCenter(WWindow *wwin);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1500,6 +1500,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_HORIZONTAL | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_LHMAXIMIZE:
|
||||
@@ -1507,6 +1508,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_RHMAXIMIZE:
|
||||
@@ -1514,6 +1516,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_THMAXIMIZE:
|
||||
@@ -1521,6 +1524,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_HORIZONTAL | MAX_TOPHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_BHMAXIMIZE:
|
||||
@@ -1528,6 +1532,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_LTCMAXIMIZE:
|
||||
@@ -1535,6 +1540,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_LEFTHALF | MAX_TOPHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_RTCMAXIMIZE:
|
||||
@@ -1542,6 +1548,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_RIGHTHALF | MAX_TOPHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_LBCMAXIMIZE:
|
||||
@@ -1549,6 +1556,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_LEFTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_RBCMAXIMIZE:
|
||||
@@ -1556,6 +1564,7 @@ static void handleKeyPress(XEvent * event)
|
||||
CloseWindowMenu(scr);
|
||||
|
||||
handleMaximize(wwin, MAX_RIGHTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD);
|
||||
movePionterToWindowCenter(wwin);
|
||||
}
|
||||
break;
|
||||
case WKBD_MAXIMUS:
|
||||
|
||||
Reference in New Issue
Block a user