mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 21:38:00 +01:00
wmaker: Add "unmaximize on move" feature.
This patch adds the ability to completely unmaximize, i.e., clear the maximized flag and return to the original geometry, a maximized window that is moved. This behavior mirrors that of other common desktop enviroments, e.g., GNOME, Unity, and Windows. To enable this feature, set "UnmaximizeOnMove = YES" in ~/GNUstep/Defaults/WindowMaker. Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
committed by
Carlos R. Mafra
parent
38b58112ac
commit
12fa7b2203
@@ -1724,8 +1724,22 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
||||
|| abs(ev->xmotion.y_root - event.xmotion.y_root) >= MOVE_THRESHOLD) {
|
||||
|
||||
if (wwin->flags.maximized) {
|
||||
wwin->flags.maximized = 0;
|
||||
wwin->flags.old_maximized = 0;
|
||||
if (wPreferences.unmaximize_on_move) {
|
||||
float titlebar_ratio;
|
||||
int new_x, new_y;
|
||||
|
||||
titlebar_ratio = (moveData.mouseX - wwin->frame_x) /
|
||||
(float)wwin->frame->core->width;
|
||||
new_y = wwin->frame_y;
|
||||
wUnmaximizeWindow(wwin);
|
||||
new_x = moveData.mouseX - titlebar_ratio * wwin->frame->core->width;
|
||||
wWindowMove(wwin, new_x, new_y);
|
||||
moveData.realX = moveData.calcX = wwin->frame_x;
|
||||
moveData.realY = moveData.calcY = wwin->frame_y;
|
||||
} else {
|
||||
wwin->flags.maximized = 0;
|
||||
wwin->flags.old_maximized = 0;
|
||||
}
|
||||
}
|
||||
|
||||
XChangeActivePointerGrab(dpy, ButtonMotionMask
|
||||
|
||||
Reference in New Issue
Block a user