mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
- Implemented a better logic to preserve the window's old geometry when
maximizing to support succesive maximizations in different directions without the need to do an intermediary un-maximize step (eliminates flicker) - Made keyboard/mouse maximization behavior consinstent relative to each other
This commit is contained in:
@@ -88,7 +88,7 @@ Changes since version 0.80.2:
|
|||||||
- Xinerama support for Solaris
|
- Xinerama support for Solaris
|
||||||
- Added global menu support (see NEWS)
|
- Added global menu support (see NEWS)
|
||||||
- Fixed sloppy focus bug
|
- Fixed sloppy focus bug
|
||||||
- Made maximizing behaves differently with keyboard/mouse for xinerama
|
- Made maximize behave differently with keyboard/mouse for xinerama
|
||||||
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
|
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
|
||||||
- A few leftover xinerama fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>)
|
- A few leftover xinerama fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>)
|
||||||
- Extended the 'strut' to multiple heads
|
- Extended the 'strut' to multiple heads
|
||||||
@@ -102,6 +102,10 @@ Changes since version 0.80.2:
|
|||||||
- Fixed aspect of window list menu (window name was too close to workspace
|
- Fixed aspect of window list menu (window name was too close to workspace
|
||||||
indicator)
|
indicator)
|
||||||
- Fixed menu panel in WPrefs.app. Explanatory text did not fit into the label
|
- Fixed menu panel in WPrefs.app. Explanatory text did not fit into the label
|
||||||
|
- Implemented a better logic to preserve the window's old geometry when
|
||||||
|
maximizing to support succesive maximizations in different directions
|
||||||
|
without the need to do an intermediary un-maximize step (eliminates flicker)
|
||||||
|
- Made keyboard/mouse maximization behavior consinstent relative to each other
|
||||||
|
|
||||||
|
|
||||||
Changes since version 0.80.1:
|
Changes since version 0.80.1:
|
||||||
|
|||||||
@@ -409,6 +409,7 @@ void
|
|||||||
wMaximizeWindow(WWindow *wwin, int directions)
|
wMaximizeWindow(WWindow *wwin, int directions)
|
||||||
{
|
{
|
||||||
int new_width, new_height, new_x, new_y;
|
int new_width, new_height, new_x, new_y;
|
||||||
|
int changed_h, changed_v, shrink_h, shrink_v;
|
||||||
WArea usableArea, totalArea;
|
WArea usableArea, totalArea;
|
||||||
|
|
||||||
if (WFLAGP(wwin, no_resizable))
|
if (WFLAGP(wwin, no_resizable))
|
||||||
@@ -440,11 +441,33 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
|||||||
wwin->flags.skip_next_animation = 1;
|
wwin->flags.skip_next_animation = 1;
|
||||||
wUnshadeWindow(wwin);
|
wUnshadeWindow(wwin);
|
||||||
}
|
}
|
||||||
|
/* Only save directions, not kbd or xinerama hints */
|
||||||
|
directions &= (MAX_HORIZONTAL|MAX_VERTICAL);
|
||||||
|
|
||||||
|
changed_h = ((wwin->flags.maximized ^ directions) & MAX_HORIZONTAL);
|
||||||
|
changed_v = ((wwin->flags.maximized ^ directions) & MAX_VERTICAL);
|
||||||
|
shrink_h = (changed_h && (directions & MAX_HORIZONTAL)==0);
|
||||||
|
shrink_v = (changed_v && (directions & MAX_VERTICAL)==0);
|
||||||
|
|
||||||
|
if (wwin->flags.maximized) {
|
||||||
|
/* if already maximized in some direction, we only update the
|
||||||
|
* appropriate old x, old y coordinates. This is necessary to
|
||||||
|
* allow succesive maximizations in different directions without
|
||||||
|
* the need to first do an un-maximize (to avoid flicker).
|
||||||
|
*/
|
||||||
|
if (!(wwin->flags.maximized & MAX_HORIZONTAL)) {
|
||||||
|
wwin->old_geometry.x = wwin->frame_x;
|
||||||
|
}
|
||||||
|
if (!(wwin->flags.maximized & MAX_VERTICAL)) {
|
||||||
|
wwin->old_geometry.y = wwin->frame_y;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wwin->old_geometry.width = wwin->client.width;
|
||||||
|
wwin->old_geometry.height = wwin->client.height;
|
||||||
|
wwin->old_geometry.x = wwin->frame_x;
|
||||||
|
wwin->old_geometry.y = wwin->frame_y;
|
||||||
|
}
|
||||||
wwin->flags.maximized = directions;
|
wwin->flags.maximized = directions;
|
||||||
wwin->old_geometry.width = wwin->client.width;
|
|
||||||
wwin->old_geometry.height = wwin->client.height;
|
|
||||||
wwin->old_geometry.x = wwin->frame_x;
|
|
||||||
wwin->old_geometry.y = wwin->frame_y;
|
|
||||||
|
|
||||||
#ifdef KWM_HINTS
|
#ifdef KWM_HINTS
|
||||||
wKWMUpdateClientGeometryRestore(wwin);
|
wKWMUpdateClientGeometryRestore(wwin);
|
||||||
@@ -453,6 +476,9 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
|||||||
if (directions & MAX_HORIZONTAL) {
|
if (directions & MAX_HORIZONTAL) {
|
||||||
new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2;
|
new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2;
|
||||||
new_x = usableArea.x1;
|
new_x = usableArea.x1;
|
||||||
|
} else if (shrink_h) {
|
||||||
|
new_x = wwin->old_geometry.x;
|
||||||
|
new_width = wwin->old_geometry.width;
|
||||||
} else {
|
} else {
|
||||||
new_x = wwin->frame_x;
|
new_x = wwin->frame_x;
|
||||||
new_width = wwin->frame->core->width;
|
new_width = wwin->frame->core->width;
|
||||||
@@ -465,6 +491,9 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
|||||||
new_y -= wwin->frame->top_width;
|
new_y -= wwin->frame->top_width;
|
||||||
new_height += wwin->frame->bottom_width - 1;
|
new_height += wwin->frame->bottom_width - 1;
|
||||||
}
|
}
|
||||||
|
} else if (shrink_v) {
|
||||||
|
new_y = wwin->old_geometry.y;
|
||||||
|
new_height = wwin->old_geometry.height;
|
||||||
} else {
|
} else {
|
||||||
new_y = wwin->frame_y;
|
new_y = wwin->frame_y;
|
||||||
new_height = wwin->frame->core->height;
|
new_height = wwin->frame->core->height;
|
||||||
|
|||||||
30
src/event.c
30
src/event.c
@@ -1444,35 +1444,41 @@ handleKeyPress(XEvent *event)
|
|||||||
break;
|
break;
|
||||||
case WKBD_MAXIMIZE:
|
case WKBD_MAXIMIZE:
|
||||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||||
CloseWindowMenu(scr);
|
int newdir = (MAX_VERTICAL|MAX_HORIZONTAL);
|
||||||
|
|
||||||
if (wwin->flags.maximized) {
|
CloseWindowMenu(scr);
|
||||||
|
|
||||||
|
if (wwin->flags.maximized == newdir) {
|
||||||
wUnmaximizeWindow(wwin);
|
wUnmaximizeWindow(wwin);
|
||||||
} else {
|
} else {
|
||||||
wMaximizeWindow(wwin, MAX_VERTICAL|MAX_HORIZONTAL|MAX_KEYBOARD);
|
wMaximizeWindow(wwin, newdir|MAX_KEYBOARD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WKBD_VMAXIMIZE:
|
case WKBD_VMAXIMIZE:
|
||||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||||
|
int newdir = (MAX_VERTICAL ^ wwin->flags.maximized);
|
||||||
|
|
||||||
CloseWindowMenu(scr);
|
CloseWindowMenu(scr);
|
||||||
|
|
||||||
if (wwin->flags.maximized) {
|
if (newdir) {
|
||||||
wUnmaximizeWindow(wwin);
|
wMaximizeWindow(wwin, newdir|MAX_KEYBOARD);
|
||||||
} else {
|
} else {
|
||||||
wMaximizeWindow(wwin, MAX_VERTICAL|MAX_KEYBOARD);
|
wUnmaximizeWindow(wwin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WKBD_HMAXIMIZE:
|
case WKBD_HMAXIMIZE:
|
||||||
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
|
||||||
|
int newdir = (MAX_HORIZONTAL ^ wwin->flags.maximized);
|
||||||
|
|
||||||
CloseWindowMenu(scr);
|
CloseWindowMenu(scr);
|
||||||
|
|
||||||
if (wwin->flags.maximized) {
|
if (newdir) {
|
||||||
wUnmaximizeWindow(wwin);
|
wMaximizeWindow(wwin, newdir|MAX_KEYBOARD);
|
||||||
} else {
|
} else {
|
||||||
wMaximizeWindow(wwin, MAX_HORIZONTAL|MAX_KEYBOARD);
|
wUnmaximizeWindow(wwin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WKBD_RAISE:
|
case WKBD_RAISE:
|
||||||
|
|||||||
11
src/gnome.c
11
src/gnome.c
@@ -609,14 +609,11 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (maximize != wwin->flags.maximized) {
|
if (maximize != wwin->flags.maximized) {
|
||||||
#define both (MAX_HORIZONTAL|MAX_VERTICAL)
|
if (maximize) {
|
||||||
if (!(maximize & both) && (wwin->flags.maximized & both)) {
|
|
||||||
wUnmaximizeWindow(wwin);
|
|
||||||
}
|
|
||||||
if ((maximize & both) && !(wwin->flags.maximized & both)) {
|
|
||||||
wMaximizeWindow(wwin, maximize);
|
wMaximizeWindow(wwin, maximize);
|
||||||
}
|
} else {
|
||||||
#undef both
|
wUnmaximizeWindow(wwin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & WIN_STATE_SHADED) {
|
if (mask & WIN_STATE_SHADED) {
|
||||||
|
|||||||
10
src/window.c
10
src/window.c
@@ -3095,10 +3095,12 @@ titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
/* maximize window */
|
/* maximize window */
|
||||||
if (dir!=0 && !WFLAGP(wwin, no_resizable)) {
|
if (dir!=0 && !WFLAGP(wwin, no_resizable)) {
|
||||||
int ndir = dir ^ wwin->flags.maximized;
|
int ndir = dir ^ wwin->flags.maximized;
|
||||||
if (wwin->flags.maximized != 0)
|
|
||||||
wUnmaximizeWindow(wwin);
|
if (ndir != 0) {
|
||||||
if (ndir != 0)
|
wMaximizeWindow(wwin, ndir);
|
||||||
wMaximizeWindow(wwin, ndir);
|
} else {
|
||||||
|
wUnmaximizeWindow(wwin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event->xbutton.button==Button3) {
|
} else if (event->xbutton.button==Button3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user