Now it is possible for change a bit pattern for changing state between
half-maximized windows. Half maximized windows will become maximized if
there is issued half-maximizing shortcut in opposite direction. Issue
half-maximizing command on same direction on already maximized window,
will have no effect.
---
 NEWS          | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/actions.c |  64 ++++++++++++++++++++++++++++++++---
 2 files changed, 165 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index cdb41d5..f2b1b30 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,111 @@ NEWS for veteran Window Maker users
 -- 0.95.8
 
 
+Alternative way for traverse half-maximized windows
+---------------------------------------------------
+
+For now, there could be three possible state of the window while using
+half-maximized feature. Unmaximized window have its state saved during that
+process, which was use to unmaximize it. For example, if there is a window,
+which is maximized on the half left side of the screen, and while requesting
+left-half-maximized, it become unmaximized with size and dimension restored to
+original state.
+
+By setting "AlternativeHalfMaximized" option to "Yes"
+~/GNUstep/Defaults/WindowMaker config file (or by using WPrefs.app and option
+"Alternative transitions between states for half maximized windows."), there
+would be slightly different change in window "traverse". Given layout depicted
+below:
+
+ ┌┬────────────────────┬┐
+ ├┘ ┌───────┐          ├┤
+ │  ├───────┤          ├┤
+ │  │       │          ├┤
+ │  │       │          ├┤
+ │  └───────┘          └┤
+ ├┬┐                    │
+ └┴┴────────────────────┘
+
+Window can be moved using keyboard shortcut right-half-maximize:
+
+ ┌┬─────────┬──────────┬┐
+ ├┘         ├──────────┼┤
+ │          │          ├┤
+ │          │          ├┤
+ │          │          ├┤
+ │          │          ├┤
+ ├┬┐        └──────────┘│
+ └┴┴────────────────────┘
+
+Further invoking right-half-maximize will do nothing. Note, that window always
+can be unmaximzied using appropriate keyboard shortcut or by selecting
+"Unmaximize" from window menu.
+
+Going to opposite direction by invoking left-half-maximize, will make the 
window
+maximized in both, vertical and horizontal directions:
+
+ ┌─────────────────────┬┐
+ ├─────────────────────┼┤
+ │                     ├┤
+ │                     ├┤
+ │                     ├┤
+ │                     ├┤
+ ├┬┬───────────────────┘│
+ └┴┴────────────────────┘
+
+Further invoking left-half-maximize, will make the window maximized in half 
left
+side od the screen:
+
+ ┌──────────┬──────────┬┐
+ ├──────────┤          ├┤
+ │          │          ├┤
+ │          │          ├┤
+ │          │          ├┤
+ │          │          └┤
+ ├┬┬────────┘           │
+ └┴┴────────────────────┘
+
+And again, further invoking left-half-maximize, will do nothing in this mode.
+
+This change affects all possible half-maximized window state also quarters.
+Issuing bottom-left-corner will take lower left quarter of the screen (nothing
+is new so far):
+
+ ┌┬────────────────────┬┐
+ ├┘                    ├┤
+ │                     ├┤
+ ├──────────┐          ├┤
+ ├──────────┤          ├┤
+ │          │          └┤
+ ├┬┬────────┘           │
+ └┴┴────────────────────┘
+
+Issuing bottom-right-corner again will change window state to bottom half
+maximized:
+
+ ┌┬────────────────────┬┐
+ ├┘                    ├┤
+ │                     ├┤
+ ├─────────────────────┼┤
+ ├─────────────────────┼┤
+ │                     ├┤
+ ├┬┬───────────────────┘│
+ └┴┴────────────────────┘
+
+Invoking bottom-right-corner again:
+
+ ┌┬────────────────────┬┐
+ ├┘                    ├┤
+ │                     ├┤
+ │          ┌──────────┼┤
+ │          ├──────────┼┤
+ │          │          ├┤
+ ├┬┐        └──────────┘│
+ └┴┴────────────────────┘
+
+Issuing bottom-right-corner again will have no effect.
+
+
 Move half-maximized windows between the screens
 -----------------------------------------------
 
diff --git a/src/actions.c b/src/actions.c
index 119f5ec..cf0699e 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -505,7 +505,10 @@ void handleMaximize(WWindow *wwin, int directions)
                if ((wwin->flags.old_maximized & MAX_MAXIMUS) &&
                                !(requested & MAX_MAXIMUS))
                        wMaximizeWindow(wwin, MAX_MAXIMUS | flags, head);
-
+               else if (wPreferences.alt_half_maximize &&
+                               current & MAX_HORIZONTAL && current & 
MAX_VERTICAL &&
+                               requested & MAX_HORIZONTAL && requested & 
MAX_VERTICAL)
+                       wUnmaximizeWindow(wwin);
                else if (wPreferences.move_half_max_between_heads) {
                        /* Select windows, which are only horizontally or 
vertically
                         * maximized. Quarters cannot be handled here, since 
there is not
@@ -552,11 +555,11 @@ void handleMaximize(WWindow *wwin, int directions)
                                         * not from mouse pointer */
                                        wMaximizeWindow(wwin, (effective | 
flags | MAX_KEYBOARD),
                                                        dest_head);
-                               else
+                               else if (!wPreferences.alt_half_maximize)
                                        wUnmaximizeWindow(wwin);
-                       } else
+                       } else if (!wPreferences.alt_half_maximize)
                                wUnmaximizeWindow(wwin);
-               } else
+               } else if (!wPreferences.alt_half_maximize)
                        wUnmaximizeWindow(wwin);
        /* these alone mean vertical|horizontal toggle */
        } else if ((effective == MAX_LEFTHALF) ||
@@ -564,6 +567,59 @@ void handleMaximize(WWindow *wwin, int directions)
                        (effective == MAX_TOPHALF) ||
                        (effective == MAX_BOTTOMHALF))
                wUnmaximizeWindow(wwin);
+
+       /* Following conditions might look complicated, but they are really 
simple:
+        * allow fullscreen transition only for half maximized state (and not
+        * corners) and only when requested state is also half maximized, but on
+        * opposite side of the screen. As for corners, it is similar, but
+        * expected is that only quarter maximized windows on corner can change
+        * it's state to half maximized window, depending on direction. Note, 
that
+        * MAX_KEYBOARD is passed to the wMaximizeWindow function, to preserve 
the
+        * head, even if mouse was used for triggering the action. */
+
+       /* Quarters alternative transition. */
+       else if (wPreferences.alt_half_maximize &&
+                       ((requested & MAX_LEFTHALF && requested & MAX_TOPHALF &&
+                         current & MAX_RIGHTHALF && current & MAX_TOPHALF) ||
+                       (requested & MAX_RIGHTHALF && requested & MAX_TOPHALF &&
+                         current & MAX_LEFTHALF && current & MAX_TOPHALF)))
+               wMaximizeWindow(wwin, (MAX_TOPHALF | MAX_HORIZONTAL | 
MAX_KEYBOARD),
+                               head);
+       else if (wPreferences.alt_half_maximize &&
+                       ((requested & MAX_LEFTHALF && requested & 
MAX_BOTTOMHALF &&
+                        current & MAX_RIGHTHALF && current & MAX_BOTTOMHALF) ||
+                       (requested & MAX_RIGHTHALF && requested & 
MAX_BOTTOMHALF &&
+                        current & MAX_LEFTHALF && current & MAX_BOTTOMHALF)))
+               wMaximizeWindow(wwin, (MAX_BOTTOMHALF | MAX_HORIZONTAL | 
MAX_KEYBOARD),
+                               head);
+       else if (wPreferences.alt_half_maximize &&
+                       ((requested & MAX_LEFTHALF && requested & 
MAX_BOTTOMHALF &&
+                        current & MAX_LEFTHALF && current & MAX_TOPHALF) ||
+                       (requested & MAX_LEFTHALF && requested & MAX_TOPHALF &&
+                        current & MAX_LEFTHALF && current & MAX_BOTTOMHALF)))
+               wMaximizeWindow(wwin, (MAX_LEFTHALF | MAX_VERTICAL| 
MAX_KEYBOARD),
+                               head);
+       else if (wPreferences.alt_half_maximize &&
+                       ((requested & MAX_RIGHTHALF && requested & 
MAX_BOTTOMHALF &&
+                        current & MAX_RIGHTHALF && current & MAX_TOPHALF) ||
+                       (requested & MAX_RIGHTHALF && requested & MAX_TOPHALF &&
+                        current & MAX_RIGHTHALF && current & MAX_BOTTOMHALF)))
+               wMaximizeWindow(wwin, (MAX_RIGHTHALF | MAX_VERTICAL| 
MAX_KEYBOARD),
+                               head);
+
+       /* Half-maximized alternative transition */
+       else if (wPreferences.alt_half_maximize && (
+                               (requested & MAX_LEFTHALF && requested & 
MAX_VERTICAL &&
+                                current & MAX_RIGHTHALF && current & 
MAX_VERTICAL) ||
+                               (requested & MAX_RIGHTHALF && requested & 
MAX_VERTICAL &&
+                                current & MAX_LEFTHALF && current & 
MAX_VERTICAL) ||
+                               (requested & MAX_TOPHALF && requested & 
MAX_HORIZONTAL &&
+                                current & MAX_BOTTOMHALF && current & 
MAX_HORIZONTAL) ||
+                               (requested & MAX_BOTTOMHALF && requested & 
MAX_HORIZONTAL &&
+                                current & MAX_TOPHALF && current & 
MAX_HORIZONTAL)))
+               wMaximizeWindow(wwin, 
(MAX_HORIZONTAL|MAX_VERTICAL|MAX_KEYBOARD),
+                               head);
+
        else {
                if ((requested == (MAX_HORIZONTAL | MAX_VERTICAL)) ||
                                (requested == MAX_MAXIMUS))
-- 
2.10.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to