This is an automated email generated because a ref change occurred in the git repository for project wmaker-crm.git.
The branch, next has been updated via f3fdf0b8dddd95f31dbbe2664308ca429df127d3 (commit) via 9328ba5b3ce423207808d2ebdd7dc8f78510fded (commit) via c9fbcda0b01e90ede219146f8b47b695d530154a (commit) via eadb7f3ab29e471a361a1a3b655487d074fb810b (commit) via 9e7987713f1f3f9309cad7c50963d77055491fb4 (commit) via 62d62eebf11f1035bfab4c5b90c514f27c04c139 (commit) from 160f879cce42cfefa8afcaadbf401d1127a795ef (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 ----------------------------------------------------------------- commit f3fdf0b8dddd95f31dbbe2664308ca429df127d3 Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:16 +0100 URL: <http://repo.or.cz/wmaker-crm.git/f3fdf0b8dddd95f3> Refactoring handleMaximize() function Simplify handleMaximize function for "not effective" case, where there was couple of duplicate code, now there is one indentation level less and readability increased. --- src/actions.c | 115 +++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/src/actions.c b/src/actions.c index c9c3a7a2203f..337c2ab95203 100644 --- a/src/actions.c +++ b/src/actions.c @@ -505,64 +505,68 @@ 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 - * clear on which direction user intend to move such window. */ - if (current & (MAX_VERTICAL | MAX_HORIZONTAL)) { - if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) { - dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, - head, DIRECTION_LEFT); - if (dest_head != -1) { - effective |= MAX_RIGHTHALF; - effective |= MAX_VERTICAL; - effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); - } - } else if (requested & MAX_RIGHTHALF && - current & MAX_RIGHTHALF) { - dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, - head, DIRECTION_RIGHT); - if (dest_head != -1) { - effective |= MAX_LEFTHALF; - effective |= MAX_VERTICAL; - effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF); - } - } else if (requested & MAX_TOPHALF && current & MAX_TOPHALF) { - dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, - head, DIRECTION_UP); - if (dest_head != -1) { - effective |= MAX_BOTTOMHALF; - effective |= MAX_HORIZONTAL; - effective &= ~(MAX_VERTICAL | MAX_TOPHALF); - } - } else if (requested & MAX_BOTTOMHALF && - current & MAX_BOTTOMHALF) { - dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, - head, DIRECTION_DOWN); - if (dest_head != -1) { - effective |= MAX_TOPHALF; - effective |= MAX_HORIZONTAL; - effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); - } - } if (dest_head != -1) - /* tell wMaximizeWindow that we were using keyboard, not - * mouse, so that it will use calculated head as - * destination for move_half_max_between_heads feature, - * not from mouse pointer */ - wMaximizeWindow(wwin, (effective | flags | MAX_KEYBOARD), - dest_head); - else if (!wPreferences.alt_half_maximize) - wUnmaximizeWindow(wwin); - } else if (!wPreferences.alt_half_maximize) - wUnmaximizeWindow(wwin); - } else if (!wPreferences.alt_half_maximize) + + /* Apply for window state, which is only horizontally or vertically + * maximized. Quarters cannot be handled here, since there is not clear + * on which direction user intend to move such window. */ + else if (wPreferences.move_half_max_between_heads && + current & (MAX_VERTICAL | MAX_HORIZONTAL)) { + if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) { + dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, + head, DIRECTION_LEFT); + if (dest_head != -1) { + effective |= MAX_RIGHTHALF; + effective |= MAX_VERTICAL; + effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); + } + } else if (requested & MAX_RIGHTHALF && + current & MAX_RIGHTHALF) { + dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, + head, DIRECTION_RIGHT); + if (dest_head != -1) { + effective |= MAX_LEFTHALF; + effective |= MAX_VERTICAL; + effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF); + } + } else if (requested & MAX_TOPHALF && current & MAX_TOPHALF) { + dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, + head, DIRECTION_UP); + if (dest_head != -1) { + effective |= MAX_BOTTOMHALF; + effective |= MAX_HORIZONTAL; + effective &= ~(MAX_VERTICAL | MAX_TOPHALF); + } + } else if (requested & MAX_BOTTOMHALF && + current & MAX_BOTTOMHALF) { + dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, + head, DIRECTION_DOWN); + if (dest_head != -1) { + effective |= MAX_TOPHALF; + effective |= MAX_HORIZONTAL; + effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); + } + } + } + + if (dest_head != -1) + /* tell wMaximizeWindow that we were using keyboard, not mouse, + * so that it will use calculated head as destination for + * move_half_max_between_heads feature, not from mouse pointer */ + wMaximizeWindow(wwin, (effective | flags | MAX_KEYBOARD), + dest_head); + else if (!wPreferences.alt_half_maximize) wUnmaximizeWindow(wwin); + + return; + } + /* these alone mean vertical|horizontal toggle */ - } else if ((effective == MAX_LEFTHALF) || + if ((effective == MAX_LEFTHALF) || (effective == MAX_RIGHTHALF) || (effective == MAX_TOPHALF) || (effective == MAX_BOTTOMHALF)) @@ -2080,14 +2084,9 @@ void wMakeWindowVisible(WWindow *wwin) void movePionterToWindowCenter(WWindow *wwin) { - if (!wPreferences.pointer_with_half_max_windows) { - wmessage("pointer_with_half_max_windows not set. do nothing"); + if (!wPreferences.pointer_with_half_max_windows) return; - } - wmessage("move the pointer to: %dx%d", - wwin->frame_x + wwin->client.width / 2, - wwin->frame_y + wwin->client.height / 2); XSelectInput(dpy, wwin->client_win, wwin->event_mask); XWarpPointer(dpy, None, wwin->screen_ptr->root_win, 0, 0, 0, 0, wwin->frame_x + wwin->client.width / 2, commit 9328ba5b3ce423207808d2ebdd7dc8f78510fded Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:15 +0100 URL: <http://repo.or.cz/wmaker-crm.git/9328ba5b3ce42320> Implementation for moving mouse pointer within the maximized window. Mouse pointer can be now moved together with window if keyboard was used for arrange maximized windows on screen. This feature can be turned on in WPrefs.app in Expert tab by selecting "Move mouse pointer with half MAXIMIZED windows.", or setting "PointerWithHalfMaxWindows" to "Yes" on ~/GNUstep/Defaults/WindowMaker file. --- NEWS | 11 +++++++++++ src/actions.c | 17 +++++++++++++++++ src/actions.h | 2 ++ src/event.c | 9 +++++++++ 4 files changed, 39 insertions(+) diff --git a/NEWS b/NEWS index f2b1b30c04d0..ed1f9e5c622d 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,17 @@ NEWS for veteran Window Maker users -- 0.95.8 +Move pointer with maximized windows +----------------------------------- + +Implementation for moving mouse pointer within the maximized window. + +Mouse pointer can be now moved together with window if keyboard was used for +arrange maximized windows on screen. This feature can be turned on in WPrefs.app +in Expert tab by selecting "Move mouse pointer with half maximized windows.", or +setting "PointerWithHalfMaxWindows" to "Yes" on ~/GNUstep/Defaults/WindowMaker +file. + Alternative way for traverse half-maximized windows --------------------------------------------------- diff --git a/src/actions.c b/src/actions.c index cf0699e44287..c9c3a7a2203f 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2078,6 +2078,23 @@ void wMakeWindowVisible(WWindow *wwin) } } +void movePionterToWindowCenter(WWindow *wwin) +{ + if (!wPreferences.pointer_with_half_max_windows) { + wmessage("pointer_with_half_max_windows not set. do nothing"); + return; + } + + wmessage("move the pointer to: %dx%d", + wwin->frame_x + wwin->client.width / 2, + wwin->frame_y + wwin->client.height / 2); + XSelectInput(dpy, wwin->client_win, wwin->event_mask); + XWarpPointer(dpy, None, wwin->screen_ptr->root_win, 0, 0, 0, 0, + wwin->frame_x + wwin->client.width / 2, + wwin->frame_y + wwin->client.height / 2); + XFlush(dpy); +} + /* * Do the animation while shading (called with what = SHADE) * or unshading (what = UNSHADE). diff --git a/src/actions.h b/src/actions.h index a15cf488a9c6..210e53e7038f 100644 --- a/src/actions.h +++ b/src/actions.h @@ -81,5 +81,7 @@ void wUnfullscreenWindow(WWindow *wwin); void animateResize(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int fw, int fh); void update_saved_geometry(WWindow *wwin); +void movePionterToWindowCenter(WWindow *wwin); + #endif diff --git a/src/event.c b/src/event.c index 5145e95fae03..440cc95f2c7f 100644 --- a/src/event.c +++ b/src/event.c @@ -1500,6 +1500,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_HORIZONTAL | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_LHMAXIMIZE: @@ -1507,6 +1508,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_VERTICAL | MAX_LEFTHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_RHMAXIMIZE: @@ -1514,6 +1516,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_THMAXIMIZE: @@ -1521,6 +1524,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_HORIZONTAL | MAX_TOPHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_BHMAXIMIZE: @@ -1528,6 +1532,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_LTCMAXIMIZE: @@ -1535,6 +1540,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_LEFTHALF | MAX_TOPHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_RTCMAXIMIZE: @@ -1542,6 +1548,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_RIGHTHALF | MAX_TOPHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_LBCMAXIMIZE: @@ -1549,6 +1556,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_LEFTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_RBCMAXIMIZE: @@ -1556,6 +1564,7 @@ static void handleKeyPress(XEvent * event) CloseWindowMenu(scr); handleMaximize(wwin, MAX_RIGHTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); + movePionterToWindowCenter(wwin); } break; case WKBD_MAXIMUS: commit c9fbcda0b01e90ede219146f8b47b695d530154a Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:14 +0100 URL: <http://repo.or.cz/wmaker-crm.git/c9fbcda0b01e90ed> New option for moving mouse pointer along with half-maximized windows. This option might be usable for using keyboard for moving windows around. This option will enable moving mouse pointer for such windows. --- WPrefs.app/Expert.c | 3 +++ src/WindowMaker.h | 1 + src/defaults.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 78fd7b34af6e..561f4e3f7af8 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -106,6 +106,9 @@ static const struct { { N_("Alternative transitions between states for half maximized windows."), /* default: */ False, OPTION_WMAKER, "AlternativeHalfMaximized" }, + { N_("Move mouse pointer with half maximized windows."), + /* default: */ False, OPTION_WMAKER, "PointerWithHalfMaxWindows" }, + { N_("Open dialogs in the same workspace as their owners."), /* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" } diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 98fa7897b477..90f1d2b38353 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -367,6 +367,7 @@ extern struct WPreferences { char drag_maximized_window; /* behavior when a maximized window is dragged */ char move_half_max_between_heads; /* move half maximized window between available heads */ char alt_half_maximize; /* alternative half-maximize feature behavior */ + char pointer_with_half_max_windows; 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 f8cfda61e2eb..0ccb82aa3337 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -486,6 +486,8 @@ WDefaultEntry optionList[] = { &wPreferences.move_half_max_between_heads, getBool, NULL, NULL, NULL}, {"AlternativeHalfMaximized", "NO", NULL, &wPreferences.alt_half_maximize, getBool, NULL, NULL, NULL}, + {"PointerWithHalfMaxWindows", "NO", NULL, + &wPreferences.pointer_with_half_max_windows, getBool, NULL, NULL, NULL}, {"HighlightActiveApp", "YES", NULL, &wPreferences.highlight_active_app, getBool, NULL, NULL, NULL}, {"AutoArrangeIcons", "NO", NULL, commit eadb7f3ab29e471a361a1a3b655487d074fb810b Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:13 +0100 URL: <http://repo.or.cz/wmaker-crm.git/eadb7f3ab29e471a> Alternative way for traversing half-maximized windows. 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 cdb41d595a5a..f2b1b30c04d0 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 119f5ecfa6e7..cf0699e44287 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)) commit 9e7987713f1f3f9309cad7c50963d77055491fb4 Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:12 +0100 URL: <http://repo.or.cz/wmaker-crm.git/9e7987713f1f3f93> New option for enabling alternative half-maximized window movement. Added new option to Window Maker for enabling alternative way for half-maximized windows movement. Option can be found on Expert section in WPrefs app. --- WPrefs.app/Expert.c | 3 +++ src/WindowMaker.h | 1 + src/defaults.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index aae55ed4e8ea..78fd7b34af6e 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -103,6 +103,9 @@ static const struct { { N_("Allow move half-maximized windows between multiple screens."), /* default: */ False, OPTION_WMAKER, "MoveHalfMaximizedWindowsBetweenScreens" }, + { N_("Alternative transitions between states for half maximized windows."), + /* default: */ False, OPTION_WMAKER, "AlternativeHalfMaximized" }, + { N_("Open dialogs in the same workspace as their owners."), /* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" } diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 2e727d3ba07b..98fa7897b477 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -366,6 +366,7 @@ extern struct WPreferences { char snap_to_top_maximizes_fullscreen; char drag_maximized_window; /* behavior when a maximized window is dragged */ char move_half_max_between_heads; /* move half maximized window between available heads */ + char alt_half_maximize; /* alternative half-maximize feature behavior */ 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 48b941f2d942..f8cfda61e2eb 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -484,6 +484,8 @@ WDefaultEntry optionList[] = { &wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL}, {"MoveHalfMaximizedWindowsBetweenScreens", "NO", NULL, &wPreferences.move_half_max_between_heads, getBool, NULL, NULL, NULL}, + {"AlternativeHalfMaximized", "NO", NULL, + &wPreferences.alt_half_maximize, getBool, NULL, NULL, NULL}, {"HighlightActiveApp", "YES", NULL, &wPreferences.highlight_active_app, getBool, NULL, NULL, NULL}, {"AutoArrangeIcons", "NO", NULL, commit 62d62eebf11f1035bfab4c5b90c514f27c04c139 Author: Roman Dobosz <gry...@gmail.com> Date: Tue, 21 Feb 2017 18:56:11 +0100 URL: <http://repo.or.cz/wmaker-crm.git/62d62eebf11f1035> Bugfix for moving windows between heads. Previous bugfix introduced another regression. It fixed the issue with size of the unmaximized window, but break new functionality. Revert back code for maximizing using mouse, leaving out head detection for keyboard actions, since it is already calculated. Mouse actions for maximize also has to be fixed due to different behaviour in original implementation - movement of the window which is called in handleMaximize filter out MAX_KEYBOARD from argument passed to the wMaximizeWindow, so that it will always assume that all the actions have to be done on the head where mouse pointer resides. For moving windows between heads feature, calculated head is always passed and used, regardless of how maximizing was invoked (keyboard or mouse) and mouse pointer position. --- src/actions.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/actions.c b/src/actions.c index a1099a42dea1..119f5ecfa6e7 100644 --- a/src/actions.c +++ b/src/actions.c @@ -393,9 +393,14 @@ void wMaximizeWindow(WWindow *wwin, int directions, int head) totalArea.y2 = scr->scr_height; totalArea.x1 = 0; totalArea.y1 = 0; - /* ignore provided head information for toggling full maximize/unmaximize */ - if (directions & MAX_KEYBOARD) - head = wGetHeadForWindow(wwin); + + /* In case of mouse initiated maximize, use the head in which pointer is + located, rather than window position, which is passed to the function */ + if (!(directions & MAX_IGNORE_XINERAMA) && !(directions & MAX_KEYBOARD)) { + WScreen *scr = wwin->screen_ptr; + head = wGetHeadForPointerLocation(scr); + } + usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True); /* Only save directions, not kbd or xinerama hints */ @@ -505,7 +510,7 @@ void handleMaximize(WWindow *wwin, int directions) /* Select windows, which are only horizontally or vertically * maximized. Quarters cannot be handled here, since there is not * clear on which direction user intend to move such window. */ - if ((current & MAX_VERTICAL) || (current & MAX_HORIZONTAL)) { + if (current & (MAX_VERTICAL | MAX_HORIZONTAL)) { if (requested & MAX_LEFTHALF && current & MAX_LEFTHALF) { dest_head = wGetHeadRelativeToCurrentHead(wwin->screen_ptr, head, DIRECTION_LEFT); @@ -540,10 +545,15 @@ void handleMaximize(WWindow *wwin, int directions) effective |= MAX_HORIZONTAL; effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); } - } if (dest_head == -1) - wUnmaximizeWindow(wwin); + } if (dest_head != -1) + /* tell wMaximizeWindow that we were using keyboard, not + * mouse, so that it will use calculated head as + * destination for move_half_max_between_heads feature, + * not from mouse pointer */ + wMaximizeWindow(wwin, (effective | flags | MAX_KEYBOARD), + dest_head); else - wMaximizeWindow(wwin, effective | flags, dest_head); + wUnmaximizeWindow(wwin); } else wUnmaximizeWindow(wwin); } else ----------------------------------------------------------------------- Summary of changes: NEWS | 116 ++++++++++++++++++++++++++++ WPrefs.app/Expert.c | 6 ++ src/WindowMaker.h | 2 + src/actions.c | 182 ++++++++++++++++++++++++++++++++------------ src/actions.h | 2 + src/defaults.c | 4 + src/event.c | 9 +++ 7 files changed, 271 insertions(+), 50 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.