This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  451cc64132837a324accf1f1304a6aac70615ada (commit)
      from  59537ec4cd4d7ba5060b5b2f6dad8e8f92f4c002 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/451cc64132837a324accf1f1304a6aac70615ada

commit 451cc64132837a324accf1f1304a6aac70615ada
Author: Doug Torrance <dtorra...@monmouthcollege.edu>
Date:   Tue Sep 23 18:44:07 2014 -0500

    wmaker: Add new options for dragging maximized windows.
    
    You can now configure the behavior when dragging a maximized window by 
setting
    DragMaximizedWindow in ~/GNUstep/Defaults/WindowMaker.  The options are:
    - Move: Move the window and retain its maximized status and geometry (the
      current behavior and the default).
    - RestoreGeometry: Move the window and unmaximize it, restoring its original
      geometry.
    - Unmaximize: Move the window and unmaximize it, retaining its maximized
      geometry.
    - NoMove: Don't move the window.

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 30eca95a..b3ec6564 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -233,6 +233,13 @@ typedef enum {
 #define        WB_TOPBOTTOM    2
 #define        WB_ALLDIRS      (WB_LEFTRIGHT|WB_TOPBOTTOM)
 
+/* drag maximized window behaviors */
+enum {
+       DRAGMAX_MOVE,
+       DRAGMAX_RESTORE,
+       DRAGMAX_UNMAXIMIZE,
+       DRAGMAX_NOMOVE
+};
 
 /* program states */
 typedef enum {
@@ -353,7 +360,7 @@ extern struct WPreferences {
     char no_animations;                       /* enable/disable animations */
     char no_autowrap;                 /* wrap workspace when window is moved 
to the edge */
     char window_snapping;              /* enable window snapping */
-    char unmaximize_on_move;           /* unmaximize a maximized window when 
it is moved */
+    char drag_maximized_window;        /* behavior when a maximized window is 
dragged */
 
     char highlight_active_app;         /* show the focused app by highlighting 
its icon */
     char auto_arrange_icons;          /* automagically arrange icons */
diff --git a/src/actions.c b/src/actions.c
index b8e4fc4e..21082cfe 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -364,6 +364,9 @@ void wMaximizeWindow(WWindow *wwin, int directions)
        if (!HAS_BORDER(wwin))
                has_border = 0;
 
+       if (wPreferences.drag_maximized_window == DRAGMAX_NOMOVE)
+               wwin->client_flags.no_movable = 1;
+
        /* the size to adjust the geometry */
        adj_size = scr->frame_border_width * 2 * has_border;
 
@@ -681,6 +684,9 @@ void wUnmaximizeWindow(WWindow *wwin)
                wUnshadeWindow(wwin);
        }
 
+       if (wPreferences.drag_maximized_window == DRAGMAX_NOMOVE)
+               wwin->client_flags.no_movable = 0;
+
        /* Use old coordinates if they are set, current values otherwise */
        remember_geometry(wwin, &x, &y, &w, &h);
 
diff --git a/src/defaults.c b/src/defaults.c
index 8dadc212..6ca7f3f7 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -309,6 +309,14 @@ static WOptionEnumeration seWorkspaceBorder[] = {
        {NULL, 0, 0}
 };
 
+static WOptionEnumeration seDragMaximizedWindow[] = {
+       {"Move", DRAGMAX_MOVE, 0},
+       {"RestoreGeometry", DRAGMAX_RESTORE, 0},
+       {"Unmaximize", DRAGMAX_UNMAXIMIZE, 0},
+       {"NoMove", DRAGMAX_NOMOVE, 0},
+       {NULL, 0, 0}
+};
+
 /*
  * ALL entries in the tables bellow, NEED to have a default value
  * defined, and this value needs to be correct.
@@ -452,8 +460,8 @@ WDefaultEntry optionList[] = {
            &wPreferences.no_autowrap, getBool, NULL, NULL, NULL},
        {"WindowSnapping", "NO", NULL,
            &wPreferences.window_snapping, getBool, NULL, NULL, NULL},
-       {"UnmaximizeOnMove", "NO", NULL,
-           &wPreferences.unmaximize_on_move, getBool, NULL, NULL, NULL},
+       {"DragMaximizedWindow", "Move", seDragMaximizedWindow,
+           &wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL},
        {"HighlightActiveApp", "YES", NULL,
            &wPreferences.highlight_active_app, getBool, NULL, NULL, NULL},
        {"AutoArrangeIcons", "NO", NULL,
diff --git a/src/moveres.c b/src/moveres.c
index 34de9b35..c77a1058 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -1724,7 +1724,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
                                   || abs(ev->xmotion.y_root - 
event.xmotion.y_root) >= MOVE_THRESHOLD) {
 
                                if (wwin->flags.maximized) {
-                                       if (wPreferences.unmaximize_on_move) {
+                                       if (wPreferences.drag_maximized_window 
== DRAGMAX_RESTORE) {
                                                float titlebar_ratio;
                                                int new_x, new_y;
 
@@ -1736,7 +1736,8 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
                                                wWindowMove(wwin, new_x, new_y);
                                                moveData.realX = moveData.calcX 
= wwin->frame_x;
                                                moveData.realY = moveData.calcY 
= wwin->frame_y;
-                                       } else {
+                                       }
+                                       if (wPreferences.drag_maximized_window 
== DRAGMAX_UNMAXIMIZE) {
                                                wwin->flags.maximized = 0;
                                                wwin->flags.old_maximized = 0;
                                        }

-----------------------------------------------------------------------

Summary of changes:
 src/WindowMaker.h |    9 ++++++++-
 src/actions.c     |    6 ++++++
 src/defaults.c    |   12 ++++++++++--
 src/moveres.c     |    5 +++--
 4 files changed, 27 insertions(+), 5 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


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

Reply via email to