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 a761d7b2cd683e90565754c288968db1fffdc399 (commit) via 22bc7aeb2fb707e650925390fcc13b02c24a8e0e (commit) via e8ad97d214ee244da42b74c2bfbd913f0d6ea477 (commit) via 84dd5f1f72477f439b98b1e56f9d04503c4a27bd (commit) via f39a3200d49bd5de70286c1efd5131d5b8e96a4e (commit) from 416f5986856040881f4fef59c1170833f049e37f (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/a761d7b2cd683e90565754c288968db1fffdc399 commit a761d7b2cd683e90565754c288968db1fffdc399 Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sun Sep 21 08:36:53 2014 -0500 WPrefs.app: Add ability to enable or disable "unmaximize on move" feature. diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index aee45fb9..888ccaa1 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -78,12 +78,15 @@ static const struct { #ifdef XKB_MODELOCK { N_("Enable keyboard language switch button in window titlebars."), - /* default: */ False, OPTION_WMAKER, "KbdModeLock" } + /* default: */ False, OPTION_WMAKER, "KbdModeLock" }, #endif /* XKB_MODELOCK */ { N_("Enable window snapping."), /* default: */ False, OPTION_WMAKER, "WindowSnapping" }, + { N_("Return maximized windows to original geometry when moved."), + /* default: */ False, OPTION_WMAKER, "UnmaximizeOnMove" } + }; http://repo.or.cz/w/wmaker-crm.git/commit/22bc7aeb2fb707e650925390fcc13b02c24a8e0e commit 22bc7aeb2fb707e650925390fcc13b02c24a8e0e Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sun Sep 21 08:36:52 2014 -0500 wmaker: Add "unmaximize on move" feature. This patch adds the ability to completely unmaximize, i.e., clear the maximized flag and return to the original geometry, a maximized window that is moved. This behavior mirrors that of other common desktop enviroments, e.g., GNOME, Unity, and Windows. To enable this feature, set "UnmaximizeOnMove = YES" in ~/GNUstep/Defaults/WindowMaker. diff --git a/src/WindowMaker.h b/src/WindowMaker.h index a93a64d8..30eca95a 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -353,6 +353,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 highlight_active_app; /* show the focused app by highlighting its icon */ char auto_arrange_icons; /* automagically arrange icons */ diff --git a/src/defaults.c b/src/defaults.c index 7349443e..8dadc212 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -452,6 +452,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}, {"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 64dc50c0..34de9b35 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1724,8 +1724,22 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) || abs(ev->xmotion.y_root - event.xmotion.y_root) >= MOVE_THRESHOLD) { if (wwin->flags.maximized) { - wwin->flags.maximized = 0; - wwin->flags.old_maximized = 0; + if (wPreferences.unmaximize_on_move) { + float titlebar_ratio; + int new_x, new_y; + + titlebar_ratio = (moveData.mouseX - wwin->frame_x) / + (float)wwin->frame->core->width; + new_y = wwin->frame_y; + wUnmaximizeWindow(wwin); + new_x = moveData.mouseX - titlebar_ratio * wwin->frame->core->width; + wWindowMove(wwin, new_x, new_y); + moveData.realX = moveData.calcX = wwin->frame_x; + moveData.realY = moveData.calcY = wwin->frame_y; + } else { + wwin->flags.maximized = 0; + wwin->flags.old_maximized = 0; + } } XChangeActivePointerGrab(dpy, ButtonMotionMask http://repo.or.cz/w/wmaker-crm.git/commit/e8ad97d214ee244da42b74c2bfbd913f0d6ea477 commit e8ad97d214ee244da42b74c2bfbd913f0d6ea477 Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sun Sep 21 08:36:51 2014 -0500 wmaker: Clear maximized flag of a maximized window when moved. If a user moves a window which is currently maximized, the current behavior is to keep the window geometry and maximized status unchanged. This can lead to peculiar behavior. For example, suppose a user maximizes a window to the right half of the screen (either through the window menu, keyboard shortcut, or new snapping feature), then moves it, and then attempts maximize it to the right half of the screen again. Instead of the expected result, the window is unmaximized and returned to its original geometry. This patch changes the behavior by clearing the maximization flag when a maximized window is moved. Then, when a window is maximized and then moved, it can be maximized again without issues. diff --git a/src/moveres.c b/src/moveres.c index 6899a866..64dc50c0 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1723,6 +1723,11 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) } else if (abs(ev->xmotion.x_root - event.xmotion.x_root) >= MOVE_THRESHOLD || abs(ev->xmotion.y_root - event.xmotion.y_root) >= MOVE_THRESHOLD) { + if (wwin->flags.maximized) { + wwin->flags.maximized = 0; + wwin->flags.old_maximized = 0; + } + XChangeActivePointerGrab(dpy, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, wPreferences.cursor[WCUR_MOVE], CurrentTime); http://repo.or.cz/w/wmaker-crm.git/commit/84dd5f1f72477f439b98b1e56f9d04503c4a27bd commit 84dd5f1f72477f439b98b1e56f9d04503c4a27bd Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sat Sep 20 22:56:23 2014 -0500 WPrefs.app: Add ability to enable or disable window snapping. diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 8cf5d6d9..aee45fb9 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -81,6 +81,9 @@ static const struct { /* default: */ False, OPTION_WMAKER, "KbdModeLock" } #endif /* XKB_MODELOCK */ + { N_("Enable window snapping."), + /* default: */ False, OPTION_WMAKER, "WindowSnapping" }, + }; http://repo.or.cz/w/wmaker-crm.git/commit/f39a3200d49bd5de70286c1efd5131d5b8e96a4e commit f39a3200d49bd5de70286c1efd5131d5b8e96a4e Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sat Sep 20 22:56:22 2014 -0500 wmaker: Add window snapping feature. This patch adds the ability to "snap" a window to one side of the screen by dragging it to that side. It is enabled by setting WindowSnapping = "YES" in ~/GNUstep/Defaults/WindowMaker. Note that window snapping is automatically disabled if DontLinkWorkspaces = "NO", as this feature also involves dragging a window to one side of the screen. diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 53d2eafb..a93a64d8 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -352,6 +352,7 @@ extern struct WPreferences { char no_dithering; /* use dithering or not */ 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 highlight_active_app; /* show the focused app by highlighting its icon */ char auto_arrange_icons; /* automagically arrange icons */ diff --git a/src/defaults.c b/src/defaults.c index 72c8b6f3..7349443e 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -450,6 +450,8 @@ WDefaultEntry optionList[] = { &wPreferences.no_animations, getBool, NULL, NULL, NULL}, {"DontLinkWorkspaces", "NO", NULL, &wPreferences.no_autowrap, getBool, NULL, NULL, NULL}, + {"WindowSnapping", "NO", NULL, + &wPreferences.window_snapping, getBool, 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 c88875b7..6899a866 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -588,6 +588,8 @@ typedef struct { int calcX, calcY; /* calculated position of window */ int omouseX, omouseY; /* old mouse position */ int mouseX, mouseY; /* last known position of the pointer */ + + enum {SNAP_NONE, SNAP_LEFT, SNAP_RIGHT} snap; } MoveData; #define WTOP(w) (w)->frame_y @@ -829,6 +831,8 @@ static void initMoveData(WWindow * wwin, MoveData * data) data->winWidth = wwin->frame->core->width + (HAS_BORDER_WITH_SELECT(wwin) ? 2 * wwin->screen_ptr->frame_border_width : 0); data->winHeight = wwin->frame->core->height + (HAS_BORDER_WITH_SELECT(wwin) ? 2 * wwin->screen_ptr->frame_border_width : 0); + + data->snap = SNAP_NONE; } static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMove) @@ -1642,12 +1646,48 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) break; case MotionNotify: + if (IS_RESIZABLE(wwin) && wPreferences.window_snapping && wPreferences.no_autowrap) { + if (moveData.snap == SNAP_LEFT && moveData.mouseX > 1) { + moveData.snap = SNAP_NONE; + drawTransparentFrame(wwin, 0, 0, scr->scr_width/2, scr->scr_height); + } + if (moveData.snap == SNAP_RIGHT && moveData.mouseX < scr->scr_width - 2) { + moveData.snap = SNAP_NONE; + drawTransparentFrame(wwin, scr->scr_width/2, 0, scr->scr_width/2, + scr->scr_height); + } + if (moveData.snap == SNAP_NONE) { + if (moveData.mouseX <= 1) { + moveData.snap = SNAP_LEFT; + drawTransparentFrame(wwin, 0, 0, scr->scr_width/2, + scr->scr_height); + } + if (moveData.mouseX >= scr->scr_width - 2) { + moveData.snap = SNAP_RIGHT; + drawTransparentFrame(wwin, scr->scr_width/2, 0, scr->scr_width/2, + scr->scr_height); + } + } + } + if (started) { + if (moveData.snap == SNAP_LEFT) + drawTransparentFrame(wwin, 0, 0, scr->scr_width/2, scr->scr_height); + if (moveData.snap == SNAP_RIGHT) + drawTransparentFrame(wwin, scr->scr_width/2, 0, scr->scr_width/2, + scr->scr_height); + updateWindowPosition(wwin, &moveData, scr->selected_windows == NULL && wPreferences.edge_resistance > 0, opaqueMove, event.xmotion.x_root, event.xmotion.y_root); + if (moveData.snap == SNAP_LEFT) + drawTransparentFrame(wwin, 0, 0, scr->scr_width/2, scr->scr_height); + if (moveData.snap == SNAP_RIGHT) + drawTransparentFrame(wwin, scr->scr_width/2, 0, scr->scr_width/2, + scr->scr_height); + if (!warped && !wPreferences.no_autowrap) { int oldWorkspace = w_global.workspace.current; @@ -1703,6 +1743,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) showPosition(wwin, moveData.realX, moveData.realY); } } + break; case ButtonPress: @@ -1712,7 +1753,28 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) if (event.xbutton.button != ev->xbutton.button) break; - if (started) { + if (moveData.snap != SNAP_NONE) { + if (moveData.snap == SNAP_LEFT) { + /* erase frames */ + if (!opaqueMove) + drawFrames(wwin, scr->selected_windows, + moveData.realX - wwin->frame_x, + moveData.realY - wwin->frame_y); + drawTransparentFrame(wwin, 0, 0, scr->scr_width/2, scr->scr_height); + handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF); + } + if (moveData.snap == SNAP_RIGHT) { + /* erase frames */ + if (!opaqueMove) + drawFrames(wwin, scr->selected_windows, + moveData.realX - wwin->frame_x, + moveData.realY - wwin->frame_y); + drawTransparentFrame(wwin, scr->scr_width/2, 0, scr->scr_width/2, + scr->scr_height); + handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF); + } + moveData.snap = SNAP_NONE; + } else if (started) { XEvent e; if (!opaqueMove) { drawFrames(wwin, scr->selected_windows, ----------------------------------------------------------------------- Summary of changes: WPrefs.app/Expert.c | 8 ++++- src/WindowMaker.h | 2 + src/defaults.c | 4 ++ src/moveres.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 95 insertions(+), 2 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.