1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Bugfix for moving windows between heads.

Previous bugfix introduced another regression. It fixed the issue with
size of the unmaximized window, but break new functionality. Revert back
code for maximizing using mouse, leaving out head detection for keyboard
actions, since it is already calculated.

Mouse actions for maximize also has to be fixed due to different
behaviour in original implementation - movement of the window which is
called in handleMaximize filter out MAX_KEYBOARD from argument passed to
the wMaximizeWindow, so that it will always assume that all the actions
have to be done on the head where mouse pointer resides. For moving
windows between heads feature, calculated head is always passed and
used, regardless of how maximizing was invoked (keyboard or mouse) and
mouse pointer position.
This commit is contained in:
2017-02-21 18:56:11 +01:00
committed by Carlos R. Mafra
parent 160f879cce
commit 62d62eebf1

View File

@@ -393,9 +393,14 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head)
totalArea.y2 = scr->scr_height;
totalArea.x1 = 0;
totalArea.y1 = 0;
/* ignore provided head information for toggling full maximize/unmaximize */
if (directions & MAX_KEYBOARD)
head = wGetHeadForWindow(wwin);
/* In case of mouse initiated maximize, use the head in which pointer is
located, rather than window position, which is passed to the function */
if (!(directions & MAX_IGNORE_XINERAMA) && !(directions & MAX_KEYBOARD)) {
WScreen *scr = wwin->screen_ptr;
head = wGetHeadForPointerLocation(scr);
}
usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True);
/* Only save directions, not kbd or xinerama hints */
@@ -505,7 +510,7 @@ void handleMaximize(WWindow *wwin, int directions)
/* Select windows, which are only horizontally or vertically
* maximized. Quarters cannot be handled here, since there is not
* clear on which direction user intend to move such window. */
if ((current & MAX_VERTICAL) || (current & MAX_HORIZONTAL)) {
if (current & (MAX_VERTICAL | MAX_HORIZONTAL)) {
if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) {
dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr,
head, DIRECTION_LEFT);
@@ -540,10 +545,15 @@ void handleMaximize(WWindow *wwin, int directions)
effective |= MAX_HORIZONTAL;
effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF);
}
} if (dest_head == -1)
wUnmaximizeWindow(wwin);
} if (dest_head != -1)
/* tell wMaximizeWindow that we were using keyboard, not
* mouse, so that it will use calculated head as
* destination for move_half_max_between_heads feature,
* not from mouse pointer */
wMaximizeWindow(wwin, (effective | flags | MAX_KEYBOARD),
dest_head);
else
wMaximizeWindow(wwin, effective | flags, dest_head);
wUnmaximizeWindow(wwin);
} else
wUnmaximizeWindow(wwin);
} else