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 936a85ce253a12425e4462ef6085b3c34ac3376d (commit) via 05f6a30716ea82e6338ad3f240f1508b2033bbc8 (commit) via c2188d07937de7ba16364541cd8399d425f58352 (commit) via 3eb01800e8ce4416daf34853d6805b39ea90aa87 (commit) via e66afb6e18270d65bbd498b423397c8c46dd4f18 (commit) via d025625df0468582a0293e1f5a95a255351a06e8 (commit) via e20f45ef3c24e2500d29cf681da1f4c719f87f59 (commit) via 33343bcd59c5f6e30e4c3ca8776bde2f78894ce0 (commit) via f10ec42ba86f3a2c9e1de9f06989509ee89a4770 (commit) from 5a65dbeb3dc1fdc25c0db4f4d49da5bbe55134ab (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/936a85ce253a12425e4462ef6085b3c34ac3376d commit 936a85ce253a12425e4462ef6085b3c34ac3376d Author: Renan Traba <rv...@inf.ufpr.br> Date: Thu Apr 25 22:37:58 2013 -0300 enforce requested window position whem maximizing diff --git a/src/actions.c b/src/actions.c index 6c69563..8a21e37 100644 --- a/src/actions.c +++ b/src/actions.c @@ -506,12 +506,14 @@ void handleMaximize(WWindow *wwin, int directions) effective |= MAX_VERTICAL; else effective |= requested & (MAX_TOPHALF | MAX_BOTTOMHALF); + effective |= MAX_LEFTHALF; effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF); } else if (requested & MAX_RIGHTHALF) { if (!(requested & (MAX_TOPHALF | MAX_BOTTOMHALF))) effective |= MAX_VERTICAL; else effective |= requested & (MAX_TOPHALF | MAX_BOTTOMHALF); + effective |= MAX_RIGHTHALF; effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); } if (requested & MAX_TOPHALF) { @@ -519,12 +521,14 @@ void handleMaximize(WWindow *wwin, int directions) effective |= MAX_HORIZONTAL; else effective |= requested & (MAX_LEFTHALF | MAX_RIGHTHALF); + effective |= MAX_TOPHALF; effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); } else if (requested & MAX_BOTTOMHALF) { if (!(requested & (MAX_LEFTHALF | MAX_RIGHTHALF))) effective |= MAX_HORIZONTAL; else effective |= requested & (MAX_LEFTHALF | MAX_RIGHTHALF); + effective |= MAX_BOTTOMHALF; effective &= ~(MAX_VERTICAL | MAX_TOPHALF); } if (requested & MAX_HORIZONTAL) http://repo.or.cz/w/wmaker-crm.git/commit/05f6a30716ea82e6338ad3f240f1508b2033bbc8 commit 05f6a30716ea82e6338ad3f240f1508b2033bbc8 Author: Renan Traba <rv...@inf.ufpr.br> Date: Tue Apr 23 22:37:16 2013 -0300 explicit restore to MAX_MAXIMUS instead of empty flag at handleMaximize diff --git a/src/actions.c b/src/actions.c index 19b4322..6c69563 100644 --- a/src/actions.c +++ b/src/actions.c @@ -487,7 +487,7 @@ void handleMaximize(WWindow *wwin, int directions) /* allow wMaximizeWindow to restore the Maximusized size */ if ((wwin->flags.old_maximized & MAX_MAXIMUS) && !(requested & MAX_MAXIMUS)) - wMaximizeWindow(wwin, flags); + wMaximizeWindow(wwin, MAX_MAXIMUS | flags); else wUnmaximizeWindow(wwin); /* these alone mean vertical|horizontal toggle */ http://repo.or.cz/w/wmaker-crm.git/commit/c2188d07937de7ba16364541cd8399d425f58352 commit c2188d07937de7ba16364541cd8399d425f58352 Author: Renan Traba <rv...@inf.ufpr.br> Date: Mon Apr 22 20:54:36 2013 -0300 WPrefs: added option to configure new viewports diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index e34b2d8..4324b03 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -84,6 +84,10 @@ static const struct { { "RHMaximizeKey", N_("Maximize active window right half") }, { "THMaximizeKey", N_("Maximize active window top half") }, { "BHMaximizeKey", N_("Maximize active window bottom half") }, + { "LTCMaximizeKey", N_("Maximize active window left top corner") }, + { "RTCMaximizeKey", N_("Maximize active window right top corner") }, + { "LBCMaximizeKey", N_("Maximize active window left bottom corner") }, + { "RBCMaximizeKey", N_("Maximize active window right bottom corner") }, { "MaximusKey", N_("Maximus: Tiled maximization ") }, { "RaiseKey", N_("Raise active window") }, { "LowerKey", N_("Lower active window") }, http://repo.or.cz/w/wmaker-crm.git/commit/3eb01800e8ce4416daf34853d6805b39ea90aa87 commit 3eb01800e8ce4416daf34853d6805b39ea90aa87 Author: Renan Traba <rv...@inf.ufpr.br> Date: Mon Apr 22 20:28:11 2013 -0300 added new windows positions new window positions top left, top right, bottom left and bottom right these new maximized positions are combinations of left, right, top and bottom maximized positions diff --git a/src/actions.c b/src/actions.c index 8a4a0c1..19b4322 100644 --- a/src/actions.c +++ b/src/actions.c @@ -502,17 +502,29 @@ void handleMaximize(WWindow *wwin, int directions) effective = requested; else { if (requested & MAX_LEFTHALF) { - effective |= MAX_VERTICAL; + if (!(requested & (MAX_TOPHALF | MAX_BOTTOMHALF))) + effective |= MAX_VERTICAL; + else + effective |= requested & (MAX_TOPHALF | MAX_BOTTOMHALF); effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF); } else if (requested & MAX_RIGHTHALF) { - effective |= MAX_VERTICAL; + if (!(requested & (MAX_TOPHALF | MAX_BOTTOMHALF))) + effective |= MAX_VERTICAL; + else + effective |= requested & (MAX_TOPHALF | MAX_BOTTOMHALF); effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); } if (requested & MAX_TOPHALF) { - effective |= MAX_HORIZONTAL; + if (!(requested & (MAX_LEFTHALF | MAX_RIGHTHALF))) + effective |= MAX_HORIZONTAL; + else + effective |= requested & (MAX_LEFTHALF | MAX_RIGHTHALF); effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); } else if (requested & MAX_BOTTOMHALF) { - effective |= MAX_HORIZONTAL; + if (!(requested & (MAX_LEFTHALF | MAX_RIGHTHALF))) + effective |= MAX_HORIZONTAL; + else + effective |= requested & (MAX_LEFTHALF | MAX_RIGHTHALF); effective &= ~(MAX_VERTICAL | MAX_TOPHALF); } if (requested & MAX_HORIZONTAL) diff --git a/src/defaults.c b/src/defaults.c index 82202df..25d7fee 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -609,8 +609,16 @@ WDefaultEntry optionList[] = { NULL, getKeybind, setKeyGrab, NULL, NULL}, {"BHMaximizeKey", "None", (void*)WKBD_BHMAXIMIZE, NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"LTCMaximizeKey", "None", (void*)WKBD_LTCMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"RTCMaximizeKey", "None", (void*)WKBD_RTCMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"LBCMaximizeKey", "None", (void*)WKBD_LBCMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"RBCMaximizeKey", "None", (void*)WKBD_RBCMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, {"MaximusKey", "None", (void*)WKBD_MAXIMUS, - NULL, getKeybind, setKeyGrab, NULL, NULL}, + NULL, getKeybind, setKeyGrab, NULL, NULL}, {"RaiseKey", ""Meta+Up"", (void *)WKBD_RAISE, NULL, getKeybind, setKeyGrab, NULL, NULL}, {"LowerKey", ""Meta+Down"", (void *)WKBD_LOWER, diff --git a/src/event.c b/src/event.c index f169e02..7664926 100644 --- a/src/event.c +++ b/src/event.c @@ -1484,6 +1484,34 @@ static void handleKeyPress(XEvent * event) handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD); } break; + case WKBD_LTCMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_LEFTHALF | MAX_TOPHALF | MAX_KEYBOARD); + } + break; + case WKBD_RTCMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_RIGHTHALF | MAX_TOPHALF | MAX_KEYBOARD); + } + break; + case WKBD_LBCMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_LEFTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); + } + break; + case WKBD_RBCMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_RIGHTHALF | MAX_BOTTOMHALF | MAX_KEYBOARD); + } + break; case WKBD_MAXIMUS: if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { CloseWindowMenu(scr); diff --git a/src/keybind.h b/src/keybind.h index 0209aed..bf02965 100644 --- a/src/keybind.h +++ b/src/keybind.h @@ -39,6 +39,10 @@ enum { WKBD_RHMAXIMIZE, WKBD_THMAXIMIZE, WKBD_BHMAXIMIZE, + WKBD_LTCMAXIMIZE, + WKBD_RTCMAXIMIZE, + WKBD_LBCMAXIMIZE, + WKBD_RBCMAXIMIZE, WKBD_MAXIMUS, WKBD_SELECT, WKBD_RAISE, http://repo.or.cz/w/wmaker-crm.git/commit/e66afb6e18270d65bbd498b423397c8c46dd4f18 commit e66afb6e18270d65bbd498b423397c8c46dd4f18 Author: Renan Traba <rv...@inf.ufpr.br> Date: Sun Apr 21 22:31:39 2013 -0300 WPrefs: added option to configure new top and bottom viewports diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index a4d4c57..e34b2d8 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -82,6 +82,8 @@ static const struct { { "HMaximizeKey", N_("Maximize active window horizontally") }, { "LHMaximizeKey", N_("Maximize active window left half") }, { "RHMaximizeKey", N_("Maximize active window right half") }, + { "THMaximizeKey", N_("Maximize active window top half") }, + { "BHMaximizeKey", N_("Maximize active window bottom half") }, { "MaximusKey", N_("Maximus: Tiled maximization ") }, { "RaiseKey", N_("Raise active window") }, { "LowerKey", N_("Lower active window") }, http://repo.or.cz/w/wmaker-crm.git/commit/d025625df0468582a0293e1f5a95a255351a06e8 commit d025625df0468582a0293e1f5a95a255351a06e8 Author: Renan Traba <hellupl...@gmail.com> Date: Sat Apr 27 20:33:16 2013 -0300 added new maximize positions, top and bottom these new positions are equal to left and right, but they are at top and bottom half of screen diff --git a/src/actions.c b/src/actions.c index a7cc3ca..8a4a0c1 100644 --- a/src/actions.c +++ b/src/actions.c @@ -343,7 +343,7 @@ void update_saved_geometry(WWindow *wwin) void wMaximizeWindow(WWindow *wwin, int directions) { - unsigned int new_width, new_height, half_scr_width; + unsigned int new_width, new_height, half_scr_width, half_scr_height; int new_x = 0; int new_y = 0; int maximus_x = 0; @@ -386,12 +386,13 @@ void wMaximizeWindow(WWindow *wwin, int directions) } /* Only save directions, not kbd or xinerama hints */ - directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); + directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); if (WFLAGP(wwin, full_maximize)) { usableArea = totalArea; } half_scr_width = (usableArea.x2 - usableArea.x1)/2; + half_scr_height = (usableArea.y2 - usableArea.y1)/2; if (wwin->flags.shaded) { wwin->flags.skip_next_animation = 1; @@ -420,7 +421,7 @@ void wMaximizeWindow(WWindow *wwin, int directions) new_width = (wwin->old_geometry.width) ? wwin->old_geometry.width : wwin->frame->core->width; new_x = (wwin->old_geometry.x) ? wwin->old_geometry.x : wwin->frame_x; } - if (!(directions & (MAX_VERTICAL | MAX_MAXIMUS))) { + if (!(directions & (MAX_VERTICAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS))) { new_height = (wwin->old_geometry.height) ? wwin->old_geometry.height : wwin->frame->core->height; new_y = (wwin->old_geometry.y) ? wwin->old_geometry.y : wwin->frame_y; } @@ -433,6 +434,14 @@ void wMaximizeWindow(WWindow *wwin, int directions) new_width = half_scr_width - adj_size; new_x = usableArea.x1 + half_scr_width; } + /* top|bottom position */ + if (directions & MAX_TOPHALF) { + new_height = half_scr_height - adj_size; + new_y = usableArea.y1; + } else if (directions & MAX_BOTTOMHALF) { + new_height = half_scr_height - adj_size; + new_y = usableArea.y1 + half_scr_height; + } /* vertical|horizontal position */ if (directions & MAX_HORIZONTAL) { @@ -470,7 +479,7 @@ void wMaximizeWindow(WWindow *wwin, int directions) void handleMaximize(WWindow *wwin, int directions) { int current = wwin->flags.maximized; - int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); + int requested = directions & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); int effective = requested ^ current; int flags = directions & ~requested; @@ -481,9 +490,11 @@ void handleMaximize(WWindow *wwin, int directions) wMaximizeWindow(wwin, flags); else wUnmaximizeWindow(wwin); - /* these alone mean vertical toggle */ + /* these alone mean vertical|horizontal toggle */ } else if ((effective == MAX_LEFTHALF) || - (effective == MAX_RIGHTHALF)) + (effective == MAX_RIGHTHALF) || + (effective == MAX_TOPHALF) || + (effective == MAX_BOTTOMHALF)) wUnmaximizeWindow(wwin); else { if ((requested == (MAX_HORIZONTAL | MAX_VERTICAL)) || @@ -497,6 +508,17 @@ void handleMaximize(WWindow *wwin, int directions) effective |= MAX_VERTICAL; effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); } + if (requested & MAX_TOPHALF) { + effective |= MAX_HORIZONTAL; + effective &= ~(MAX_VERTICAL | MAX_BOTTOMHALF); + } else if (requested & MAX_BOTTOMHALF) { + effective |= MAX_HORIZONTAL; + effective &= ~(MAX_VERTICAL | MAX_TOPHALF); + } + if (requested & MAX_HORIZONTAL) + effective &= ~(MAX_LEFTHALF | MAX_RIGHTHALF); + if (requested & MAX_VERTICAL) + effective &= ~(MAX_TOPHALF | MAX_BOTTOMHALF); effective &= ~MAX_MAXIMUS; } wMaximizeWindow(wwin, effective | flags); diff --git a/src/actions.h b/src/actions.h index 55de740..8390e49 100644 --- a/src/actions.h +++ b/src/actions.h @@ -27,9 +27,11 @@ #define MAX_VERTICAL (1 << 1) #define MAX_LEFTHALF (1 << 2) #define MAX_RIGHTHALF (1 << 3) -#define MAX_MAXIMUS (1 << 4) -#define MAX_IGNORE_XINERAMA (1 << 5) -#define MAX_KEYBOARD (1 << 6) +#define MAX_TOPHALF (1 << 4) +#define MAX_BOTTOMHALF (1 << 5) +#define MAX_MAXIMUS (1 << 6) +#define MAX_IGNORE_XINERAMA (1 << 7) +#define MAX_KEYBOARD (1 << 8) #define SAVE_GEOMETRY_X (1 << 0) #define SAVE_GEOMETRY_Y (1 << 1) diff --git a/src/client.c b/src/client.c index e877229..060ec59 100644 --- a/src/client.c +++ b/src/client.c @@ -252,11 +252,11 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre) nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width; if (nwidth != wwin->old_geometry.width) - wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); - if (nheight != wwin->old_geometry.height) + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); + if (nheight != wwin->old_geometry.height) wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); - wWindowConfigure(wwin, nx, ny, nwidth, nheight); + wWindowConfigure(wwin, nx, ny, nwidth, nheight); wwin->old_geometry.x = nx; wwin->old_geometry.y = ny; wwin->old_geometry.width = nwidth; diff --git a/src/defaults.c b/src/defaults.c index 8d2fe22..82202df 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -605,6 +605,10 @@ WDefaultEntry optionList[] = { NULL, getKeybind, setKeyGrab, NULL, NULL}, {"RHMaximizeKey", "None", (void*)WKBD_RHMAXIMIZE, NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"THMaximizeKey", "None", (void*)WKBD_THMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, + {"BHMaximizeKey", "None", (void*)WKBD_BHMAXIMIZE, + NULL, getKeybind, setKeyGrab, NULL, NULL}, {"MaximusKey", "None", (void*)WKBD_MAXIMUS, NULL, getKeybind, setKeyGrab, NULL, NULL}, {"RaiseKey", ""Meta+Up"", (void *)WKBD_RAISE, diff --git a/src/event.c b/src/event.c index 692fd8a..f169e02 100644 --- a/src/event.c +++ b/src/event.c @@ -1470,6 +1470,20 @@ static void handleKeyPress(XEvent * event) handleMaximize(wwin, MAX_VERTICAL | MAX_RIGHTHALF | MAX_KEYBOARD); } break; + case WKBD_THMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_HORIZONTAL | MAX_TOPHALF | MAX_KEYBOARD); + } + break; + case WKBD_BHMAXIMIZE: + if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { + CloseWindowMenu(scr); + + handleMaximize(wwin, MAX_HORIZONTAL | MAX_BOTTOMHALF | MAX_KEYBOARD); + } + break; case WKBD_MAXIMUS: if (ISMAPPED(wwin) && ISFOCUSED(wwin) && IS_RESIZABLE(wwin)) { CloseWindowMenu(scr); diff --git a/src/keybind.h b/src/keybind.h index 8402b70..0209aed 100644 --- a/src/keybind.h +++ b/src/keybind.h @@ -35,8 +35,10 @@ enum { WKBD_MAXIMIZE, WKBD_VMAXIMIZE, WKBD_HMAXIMIZE, - WKBD_LHMAXIMIZE, + WKBD_LHMAXIMIZE, WKBD_RHMAXIMIZE, + WKBD_THMAXIMIZE, + WKBD_BHMAXIMIZE, WKBD_MAXIMUS, WKBD_SELECT, WKBD_RAISE, diff --git a/src/moveres.c b/src/moveres.c index 23045eb..8f0ecba 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1521,7 +1521,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin) } } else { if (ww != original_w) - wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); if (wh != original_h) wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); @@ -2078,7 +2078,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev) XUngrabServer(dpy); if (fw != original_fw) - wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS); + wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS); if (fh != original_fh) wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); diff --git a/src/window.h b/src/window.h index a95b9f7..ec032c0 100644 --- a/src/window.h +++ b/src/window.h @@ -249,8 +249,8 @@ typedef struct WWindow { unsigned int miniaturized:1; unsigned int hidden:1; unsigned int shaded:1; - unsigned int maximized:5; - unsigned int old_maximized:5; + unsigned int maximized:7; + unsigned int old_maximized:7; unsigned int fullscreen:1; unsigned int omnipresent:1; unsigned int semi_focused:1; http://repo.or.cz/w/wmaker-crm.git/commit/e20f45ef3c24e2500d29cf681da1f4c719f87f59 commit e20f45ef3c24e2500d29cf681da1f4c719f87f59 Author: Renan Traba <hellupl...@gmail.com> Date: Sat Apr 27 19:59:08 2013 -0300 simplified logic of wMaximizeWindow function diff --git a/src/actions.c b/src/actions.c index fbf8b93..a7cc3ca 100644 --- a/src/actions.c +++ b/src/actions.c @@ -341,18 +341,17 @@ void update_saved_geometry(WWindow *wwin) save_old_geometry(wwin, SAVE_GEOMETRY_X); } -#define IS_MAX_HORIZONTALLY(directions) ((directions & MAX_HORIZONTAL) | (directions & MAX_LEFTHALF) | (directions & MAX_RIGHTHALF)) void wMaximizeWindow(WWindow *wwin, int directions) { - int new_x, new_y; unsigned int new_width, new_height, half_scr_width; + int new_x = 0; + int new_y = 0; int maximus_x = 0; int maximus_y = 0; unsigned int maximus_width = 0; unsigned int maximus_height = 0; WArea usableArea, totalArea; Bool has_border = 1; - int save_directions = 0; int adj_size; if (!IS_RESIZABLE(wwin)) @@ -364,27 +363,14 @@ void wMaximizeWindow(WWindow *wwin, int directions) /* the size to adjust the geometry */ adj_size = wwin->screen_ptr->frame_border_width * 2 * has_border; - /* save old coordinates before we change the current values - * always if the window is not currently maximized at all - * but never if the window has been Maximusized */ + /* save old coordinates before we change the current values */ if (!wwin->flags.maximized) - save_directions |= SAVE_GEOMETRY_ALL; - else if (!(wwin->flags.old_maximized & MAX_MAXIMUS)) { - if ((directions & MAX_VERTICAL) && - !(wwin->flags.maximized & MAX_VERTICAL)) - save_directions |= SAVE_GEOMETRY_Y | SAVE_GEOMETRY_HEIGHT; - if (IS_MAX_HORIZONTALLY(directions) && - !IS_MAX_HORIZONTALLY(wwin->flags.maximized)) - save_directions |= SAVE_GEOMETRY_X | SAVE_GEOMETRY_WIDTH; - } - if ((directions & MAX_MAXIMUS) && !wwin->flags.maximized) - save_directions |= SAVE_GEOMETRY_ALL; - save_old_geometry(wwin, save_directions); + save_old_geometry(wwin, SAVE_GEOMETRY_ALL); - totalArea.x1 = 0; - totalArea.y1 = 0; totalArea.x2 = wwin->screen_ptr->scr_width; totalArea.y2 = wwin->screen_ptr->scr_height; + totalArea.x1 = 0; + totalArea.y1 = 0; usableArea = totalArea; if (!(directions & MAX_IGNORE_XINERAMA)) { @@ -399,10 +385,6 @@ void wMaximizeWindow(WWindow *wwin, int directions) usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True); } - /* remember Maximus geometry if we'll need it later */ - if ((wwin->flags.old_maximized & MAX_MAXIMUS) || (directions & MAX_MAXIMUS)) - find_Maximus_geometry(wwin, usableArea, &maximus_x, &maximus_y, &maximus_width, &maximus_height); - /* Only save directions, not kbd or xinerama hints */ directions &= (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS); @@ -416,72 +398,63 @@ void wMaximizeWindow(WWindow *wwin, int directions) wUnshadeWindow(wwin); } - if (directions & MAX_HORIZONTAL) { - new_width = usableArea.x2 - usableArea.x1 - adj_size; - new_x = usableArea.x1; - } else if (directions & MAX_LEFTHALF) { - new_width = half_scr_width - adj_size; - new_x = usableArea.x1; - wwin->flags.old_maximized |= MAX_LEFTHALF; - wwin->flags.old_maximized &= ~MAX_RIGHTHALF; - } else if (directions & MAX_RIGHTHALF) { - new_width = half_scr_width - adj_size; - new_x = usableArea.x1 + half_scr_width; - wwin->flags.old_maximized |= MAX_RIGHTHALF; - wwin->flags.old_maximized &= ~MAX_LEFTHALF; - } else if (wwin->flags.old_maximized & MAX_MAXIMUS) { - new_x = maximus_x; + if (directions & MAX_MAXIMUS) { + find_Maximus_geometry(wwin, usableArea, &maximus_x, &maximus_y, &maximus_width, &maximus_height); new_width = maximus_width - adj_size; - } else if (IS_MAX_HORIZONTALLY(wwin->flags.maximized)) { - new_x = (wwin->old_geometry.x) ? wwin->old_geometry.x : wwin->frame_x; - new_width = (wwin->old_geometry.width) ? wwin->old_geometry.width : wwin->frame->core->width; - } else { - wwin->flags.old_maximized &= ~(MAX_LEFTHALF | MAX_RIGHTHALF); - new_x = wwin->frame_x; - new_width = wwin->frame->core->width; - } - - if (directions & MAX_VERTICAL) { - new_height = usableArea.y2 - usableArea.y1 - adj_size; - new_y = usableArea.y1; - if (WFLAGP(wwin, full_maximize)) { - new_y -= wwin->frame->top_width; - new_height += wwin->frame->bottom_width - 1; - } - } else if (wwin->flags.old_maximized & MAX_MAXIMUS) { - new_y = maximus_y; new_height = maximus_height - adj_size; - /* HACK: this will be subtracted again below */ - new_height += wwin->frame->top_width + wwin->frame->bottom_width; - } else if (wwin->flags.maximized & MAX_VERTICAL) { - new_y = (wwin->old_geometry.y) ? wwin->old_geometry.y : wwin->frame_y; - new_height = (wwin->old_geometry.height) ? wwin->old_geometry.height : wwin->frame->core->height; - /* HACK: this will be subtracted again below */ - new_height += wwin->frame->top_width + wwin->frame->bottom_width; - wwin->flags.old_maximized &= ~(MAX_LEFTHALF | MAX_RIGHTHALF); - } else { - new_y = wwin->frame_y; - new_height = wwin->frame->core->height; - } - - if (!WFLAGP(wwin, full_maximize)) { - new_height -= wwin->frame->top_width + wwin->frame->bottom_width; - } - - if (directions & MAX_MAXIMUS) { new_x = maximus_x; new_y = maximus_y; - new_width = maximus_width - adj_size; - new_height = maximus_height - adj_size; - if (WFLAGP(wwin, full_maximize) && new_y == 0) { + if (WFLAGP(wwin, full_maximize) && (new_y == 0)) { + new_height += wwin->frame->bottom_width - 1; new_y -= wwin->frame->top_width; - new_height += wwin->frame->top_width - 1; } + /* HACK: this will be subtracted again below */ + new_height += wwin->frame->top_width + wwin->frame->bottom_width; + wwin->maximus_x = new_x; wwin->maximus_y = new_y; wwin->flags.old_maximized |= MAX_MAXIMUS; + } else { + /* set default values if no option set then */ + if (!(directions & (MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS))) { + new_width = (wwin->old_geometry.width) ? wwin->old_geometry.width : wwin->frame->core->width; + new_x = (wwin->old_geometry.x) ? wwin->old_geometry.x : wwin->frame_x; + } + if (!(directions & (MAX_VERTICAL | MAX_MAXIMUS))) { + new_height = (wwin->old_geometry.height) ? wwin->old_geometry.height : wwin->frame->core->height; + new_y = (wwin->old_geometry.y) ? wwin->old_geometry.y : wwin->frame_y; + } + + /* left|right position */ + if (directions & MAX_LEFTHALF) { + new_width = half_scr_width - adj_size; + new_x = usableArea.x1; + } else if (directions & MAX_RIGHTHALF) { + new_width = half_scr_width - adj_size; + new_x = usableArea.x1 + half_scr_width; + } + + /* vertical|horizontal position */ + if (directions & MAX_HORIZONTAL) { + new_width = usableArea.x2 - usableArea.x1 - adj_size; + new_x = usableArea.x1; + } + if (directions & MAX_VERTICAL) { + new_height = usableArea.y2 - usableArea.y1 - adj_size; + new_y = usableArea.y1; + if (WFLAGP(wwin, full_maximize) && (new_y == 0)) + new_y -= wwin->frame->top_width; + } } + if (!WFLAGP(wwin, full_maximize)) + new_height -= wwin->frame->top_width + wwin->frame->bottom_width; + + /* set maximization state */ + wwin->flags.maximized = directions; + if ((wwin->flags.old_maximized & MAX_MAXIMUS) && !wwin->flags.maximized) + wwin->flags.maximized = MAX_MAXIMUS; + wWindowConstrainSize(wwin, &new_width, &new_height); wWindowCropSize(wwin, usableArea.x2 - usableArea.x1, @@ -491,11 +464,6 @@ void wMaximizeWindow(WWindow *wwin, int directions) wWindowSynthConfigureNotify(wwin); WMPostNotificationName(WMNChangedState, wwin, "maximize"); - - /* set maximization state */ - wwin->flags.maximized = directions; - if ((wwin->flags.old_maximized & MAX_MAXIMUS) && !wwin->flags.maximized) - wwin->flags.maximized = MAX_MAXIMUS; } /* generic (un)maximizer */ http://repo.or.cz/w/wmaker-crm.git/commit/33343bcd59c5f6e30e4c3ca8776bde2f78894ce0 commit 33343bcd59c5f6e30e4c3ca8776bde2f78894ce0 Author: Renan Traba <rv...@inf.ufpr.br> Date: Sun Apr 21 15:01:29 2013 -0300 simplified logic of handleMaximize function diff --git a/src/actions.c b/src/actions.c index 0808e33..fbf8b93 100644 --- a/src/actions.c +++ b/src/actions.c @@ -509,64 +509,30 @@ void handleMaximize(WWindow *wwin, int directions) if (!effective) { /* allow wMaximizeWindow to restore the Maximusized size */ if ((wwin->flags.old_maximized & MAX_MAXIMUS) && - !(requested & MAX_MAXIMUS)) + !(requested & MAX_MAXIMUS)) wMaximizeWindow(wwin, flags); else wUnmaximizeWindow(wwin); - } + /* these alone mean vertical toggle */ + } else if ((effective == MAX_LEFTHALF) || + (effective == MAX_RIGHTHALF)) + wUnmaximizeWindow(wwin); else { - /* MAX_MAXIMUS takes precedence */ - effective &= ~MAX_MAXIMUS; - if (requested & MAX_MAXIMUS) { - /* window was previously Maximusized then maximized */ - if ((wwin->flags.old_maximized & MAX_MAXIMUS) && !current) { - wUnmaximizeWindow(wwin); - return; - } - else - effective = MAX_MAXIMUS; - } - else if (requested == (MAX_HORIZONTAL | MAX_VERTICAL)) + if ((requested == (MAX_HORIZONTAL | MAX_VERTICAL)) || + (requested == MAX_MAXIMUS)) effective = requested; else { - /* handle MAX_HORIZONTAL -> MAX_(LEFT|RIGHT)HALF */ - if (IS_MAX_HORIZONTALLY(current)) { - if (IS_MAX_HORIZONTALLY(requested)) { - effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF); - effective |= (requested & (MAX_HORIZONTAL | MAX_LEFTHALF | MAX_RIGHTHALF)); - if (requested & MAX_HORIZONTAL) { - /* restore to half maximization */ - if (wwin->flags.old_maximized & MAX_LEFTHALF) - effective |= MAX_LEFTHALF; - else if (wwin->flags.old_maximized & MAX_RIGHTHALF) - effective |= MAX_RIGHTHALF; - } - /* MAX_VERTICAL is implicit with MAX_(LEFT|RIGHT)HALF */ - else - effective |= MAX_VERTICAL; - } else { - /* toggling MAX_VERTICAL */ - if ((requested & MAX_VERTICAL) && - (current & MAX_VERTICAL)) { - effective &= ~(MAX_LEFTHALF | MAX_RIGHTHALF | MAX_VERTICAL); - } - } - } - /* handle MAX_VERTICAL -> MAX_(LEFT|RIGHT)HALF */ - if (current & MAX_VERTICAL) { - if ((requested & MAX_LEFTHALF) || - (requested & MAX_RIGHTHALF)) { - effective |= MAX_VERTICAL; - } + if (requested & MAX_LEFTHALF) { + effective |= MAX_VERTICAL; + effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF); + } else if (requested & MAX_RIGHTHALF) { + effective |= MAX_VERTICAL; + effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF); } - /* toggling MAX_HORIZONTAL */ - if ((requested & MAX_HORIZONTAL) && - (current & MAX_HORIZONTAL)) - effective &= ~MAX_HORIZONTAL; + effective &= ~MAX_MAXIMUS; } wMaximizeWindow(wwin, effective | flags); } - return; } /* the window boundary coordinates */ http://repo.or.cz/w/wmaker-crm.git/commit/f10ec42ba86f3a2c9e1de9f06989509ee89a4770 commit f10ec42ba86f3a2c9e1de9f06989509ee89a4770 Author: Renan Traba <rv...@inf.ufpr.br> Date: Fri Apr 19 17:01:15 2013 -0300 fix condition to restore window position when unmaximized if a window was at x=0 or y=0, the original condition return false and the window is not moved to original position, but if width or height from old_geometry is set then wmaker already saved old_geometry, and we can trust x=0 or y=0 is original position. diff --git a/src/actions.c b/src/actions.c index 17046cf..0808e33 100644 --- a/src/actions.c +++ b/src/actions.c @@ -314,8 +314,8 @@ static void remember_geometry(WWindow *wwin, int *x, int *y, int *w, int *h) old_geom_rect = wmkrect(wwin->old_geometry.x, wwin->old_geometry.y, wwin->old_geometry.width, wwin->old_geometry.height); old_head = wGetHeadForRect(wwin->screen_ptr, old_geom_rect); same_head = (wGetHeadForWindow(wwin) == old_head); - *x = (wwin->old_geometry.x && same_head) ? wwin->old_geometry.x : wwin->frame_x; - *y = (wwin->old_geometry.y && same_head) ? wwin->old_geometry.y : wwin->frame_y; + *x = ((wwin->old_geometry.x || wwin->old_geometry.width) && same_head) ? wwin->old_geometry.x : wwin->frame_x; + *y = ((wwin->old_geometry.y || wwin->old_geometry.height) && same_head) ? 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; } ----------------------------------------------------------------------- Summary of changes: WPrefs.app/KeyboardShortcuts.c | 6 + src/actions.c | 246 ++++++++++++++++++---------------------- src/actions.h | 8 +- src/client.c | 6 +- src/defaults.c | 14 ++- src/event.c | 42 +++++++ src/keybind.h | 8 +- src/moveres.c | 4 +- src/window.h | 4 +- 9 files changed, 189 insertions(+), 149 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.