From 69730273b14bc783e8cd18d894037b483f356495 Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 15 May 2005 16:45:02 +0000 Subject: [PATCH] - fixed bug with windows shrinking to very small sizes when Unmaximize was used on them, after they were closed in a maximized state. - fixed bug with restoring maximized state from NetWM atoms. --- ChangeLog | 6 +++++- src/actions.c | 14 +++++++++----- src/wmspec.c | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 688763e7..750b5479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,11 @@ Changes since version 0.91.0: move was initiated by the client - improved hide/unhide animation for applications with multiple windows (only animate the active window hiding/unhiding, which makes Window Maker - faster and more responsive for such applications). + faster and more responsive for such applications). This also makes the + restart operation much faster. +- fixed bug with windows shrinking to very small sizes when Unmaximize was + used on them, after they were closed in a maximized state. +- fixed bug with restoring maximized state from NetWM atoms. Changes since version 0.90.0: diff --git a/src/actions.c b/src/actions.c index 6a42247a..3aaa012f 100644 --- a/src/actions.c +++ b/src/actions.c @@ -474,7 +474,7 @@ wMaximizeWindow(WWindow *wwin, int directions) void wUnmaximizeWindow(WWindow *wwin) { - int restore_x, restore_y; + int x, y, w, h; if (!wwin->flags.maximized) return; @@ -483,13 +483,17 @@ wUnmaximizeWindow(WWindow *wwin) wwin->flags.skip_next_animation = 1; wUnshadeWindow(wwin); } - restore_x = (wwin->flags.maximized & MAX_HORIZONTAL) ? + x = ((wwin->flags.maximized & MAX_HORIZONTAL) && wwin->old_geometry.x) ? wwin->old_geometry.x : wwin->frame_x; - restore_y = (wwin->flags.maximized & MAX_VERTICAL) ? + y = ((wwin->flags.maximized & MAX_VERTICAL) && wwin->old_geometry.y) ? wwin->old_geometry.y : wwin->frame_y; + w = wwin->old_geometry.width ? + wwin->old_geometry.width : wwin->client.width; + h = wwin->old_geometry.height ? + wwin->old_geometry.height : wwin->client.height; + wwin->flags.maximized = 0; - wWindowConfigure(wwin, restore_x, restore_y, - wwin->old_geometry.width, wwin->old_geometry.height); + wWindowConfigure(wwin, x, y, w, h); WMPostNotificationName(WMNChangedState, wwin, "maximize"); diff --git a/src/wmspec.c b/src/wmspec.c index 09a838b5..c11dca19 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -872,7 +872,7 @@ updateStateHint(WWindow *wwin, Bool changedWorkspace, Bool del) /* changeable */ XDeleteProperty(dpy, wwin->client_win, net_wm_state); } } else { - Atom state[11]; /* nr of defined state atoms */ + Atom state[15]; /* nr of defined state atoms */ int i = 0; if(changedWorkspace || (wPreferences.sticky_icons && !IS_OMNIPRESENT(wwin))) @@ -895,7 +895,7 @@ updateStateHint(WWindow *wwin, Bool changedWorkspace, Bool del) /* changeable */ state[i++] = net_wm_state_skip_pager; if (wwin->flags.miniaturized && wPreferences.sticky_icons) { - if( !IS_OMNIPRESENT(wwin)) + if (!IS_OMNIPRESENT(wwin)) updateWorkspaceHint(wwin, True, False); state[i++] = net_wm_state_sticky; } @@ -1057,7 +1057,7 @@ doStateAtom(WWindow *wwin, Atom state, int set, Bool init) set = !(wwin->flags.maximized & MAX_VERTICAL); } if (init) { - wwin->flags.maximized = set; + wwin->flags.maximized |= (set ? MAX_VERTICAL : 0); } else { if (set) { wMaximizeWindow(wwin, wwin->flags.maximized | MAX_VERTICAL); @@ -1070,7 +1070,7 @@ doStateAtom(WWindow *wwin, Atom state, int set, Bool init) set = !(wwin->flags.maximized & MAX_HORIZONTAL); } if (init) { - wwin->flags.maximized = set; + wwin->flags.maximized |= (set ? MAX_HORIZONTAL : 0); } else { if (set) { wMaximizeWindow(wwin, wwin->flags.maximized | MAX_HORIZONTAL); -- 2.11.4.GIT