diff options
author | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2008-06-03 21:26:17 +0000 |
---|---|---|
committer | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2008-06-03 21:26:17 +0000 |
commit | e04574f71304690699240406e37f1a9bad5925ff (patch) | |
tree | 3c6401258524f201cd291b1ab58c1d8c4ab98562 /src | |
parent | 47abf67381b896a54bf21d4e5cd0573df7adf031 (diff) | |
download | xfwm4-e04574f71304690699240406e37f1a9bad5925ff.tar.gz |
Cleanup
(Old svn revision: 27027)
Diffstat (limited to 'src')
-rw-r--r-- | src/events.c | 47 | ||||
-rw-r--r-- | src/moveresize.c | 24 | ||||
-rw-r--r-- | src/netwm.c | 9 |
3 files changed, 38 insertions, 42 deletions
diff --git a/src/events.c b/src/events.c index 947cb4fa3..6f30f5983 100644 --- a/src/events.c +++ b/src/events.c @@ -274,33 +274,6 @@ check_button_time (XButtonEvent *ev) #endif static void -moveRequest (Client * c, XEvent * ev) -{ - if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_MOVE) - && !FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) - { - clientMove (c, ev); - } -} - -static void -resizeRequest (Client * c, int corner, XEvent * ev) -{ - if (!FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) - { - if (FLAG_TEST_ALL (c->xfwm_flags, - XFWM_FLAG_HAS_RESIZE | XFWM_FLAG_IS_RESIZABLE)) - { - clientResize (c, corner, ev); - } - else if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_MOVE)) - { - clientMove (c, ev); - } - } -} - -static void toggle_show_desktop (ScreenInfo *screen_info) { screen_info->show_desktop = !screen_info->show_desktop; @@ -366,13 +339,10 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev) switch (key) { case KEY_MOVE: - moveRequest (c, (XEvent *) ev); + clientMove (c, (XEvent *) ev); break; case KEY_RESIZE: - if (FLAG_TEST_ALL (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE | XFWM_FLAG_IS_RESIZABLE)) - { - clientResize (c, CORNER_BOTTOM_RIGHT, (XEvent *) ev); - } + clientResize (c, CORNER_BOTTOM_RIGHT, (XEvent *) ev); break; case KEY_CYCLE_WINDOWS: clientCycle (c, ev); @@ -603,7 +573,7 @@ edgeButton (Client * c, int part, XButtonEvent * ev) } else if (tclick != XFWM_BUTTON_UNDEFINED) { - moveRequest (c, (XEvent *) ev); + clientMove (c, (XEvent *) ev); } } else if ((ev->button == Button1) || (ev->button == Button3)) @@ -617,7 +587,7 @@ edgeButton (Client * c, int part, XButtonEvent * ev) } clientRaise (c, None); } - resizeRequest (c, part, (XEvent *) ev); + clientResize (c, part, (XEvent *) ev); } } @@ -720,7 +690,7 @@ button1Action (Client * c, XButtonEvent * ev) if ((tclick == XFWM_BUTTON_DRAG) || (tclick == XFWM_BUTTON_CLICK_AND_DRAG)) { - moveRequest (c, (XEvent *) ev); + clientMove (c, (XEvent *) ev); } else if (tclick == XFWM_BUTTON_DOUBLE_CLICK) { @@ -783,7 +753,7 @@ titleButton (Client * c, int state, XButtonEvent * ev) if (tclick == XFWM_BUTTON_DRAG) { - moveRequest (c, (XEvent *) ev); + clientMove (c, (XEvent *) ev); } else if (tclick != XFWM_BUTTON_UNDEFINED) { @@ -2706,9 +2676,8 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 time) insensitive |= MENU_OP_MOVE; } - if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE) || - ((FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED) - && (screen_info->params->borderless_maximize)))) + if (!FLAG_TEST_ALL (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE | XFWM_FLAG_IS_RESIZABLE) || + FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED)) { insensitive |= MENU_OP_RESIZE; } diff --git a/src/moveresize.c b/src/moveresize.c index 1e2070db6..380f6f1da 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -889,6 +889,16 @@ clientMove (Client * c, XEvent * ev) TRACE ("entering clientDoMove"); TRACE ("moving client \"%s\" (0x%lx)", c->name, c->window); + if (FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) + { + return; + } + + if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_MOVE)) + { + return; + } + screen_info = c->screen_info; display_info = screen_info->display_info; @@ -1426,12 +1436,26 @@ clientResize (Client * c, int handle, XEvent * ev) screen_info = c->screen_info; display_info = screen_info->display_info; + if (FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)) + { + return; + } + if (FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED) && (screen_info->params->borderless_maximize)) { return; } + if (!FLAG_TEST_ALL (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE | XFWM_FLAG_IS_RESIZABLE)) + { + if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_MOVE)) + { + clientMove (c, ev); + } + return; + } + passdata.c = c; passdata.cancel_x = passdata.ox = c->x; passdata.cancel_y = passdata.oy = c->y; diff --git a/src/netwm.c b/src/netwm.c index 1bb31d6e1..a51a84285 100644 --- a/src/netwm.c +++ b/src/netwm.c @@ -1136,8 +1136,12 @@ clientSetNetActions (Client * c) display_info = screen_info->display_info; i = 0; + /* Actions available for all */ atoms[i++] = display_info->atoms[NET_WM_ACTION_CLOSE]; atoms[i++] = display_info->atoms[NET_WM_ACTION_ABOVE]; + atoms[i++] = display_info->atoms[NET_WM_ACTION_BELOW]; + + /* Actions depending on the window type and current status */ if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE)) { atoms[i++] = display_info->atoms[NET_WM_ACTION_FULLSCREEN]; @@ -1145,9 +1149,8 @@ clientSetNetActions (Client * c) { atoms[i++] = display_info->atoms[NET_WM_ACTION_MOVE]; } - if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE) && - !((FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED) - && (screen_info->params->borderless_maximize)))) + if (FLAG_TEST_ALL (c->xfwm_flags, XFWM_FLAG_HAS_RESIZE | XFWM_FLAG_IS_RESIZABLE) && + !FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED)) { atoms[i++] = display_info->atoms[NET_WM_ACTION_RESIZE]; } |