Author: olivier
Date: 2008-06-03 21:26:17 +0000 (Tue, 03 Jun 2008)
New Revision: 27027
Modified:
xfwm4/trunk/src/events.c
xfwm4/trunk/src/moveresize.c
xfwm4/trunk/src/netwm.c
Log:
Cleanup
Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c 2008-06-03 20:52:52 UTC (rev 27026)
+++ xfwm4/trunk/src/events.c 2008-06-03 21:26:17 UTC (rev 27027)
@@ -274,33 +274,6 @@
#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 @@
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 @@
}
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 @@
}
clientRaise (c, None);
}
- resizeRequest (c, part, (XEvent *) ev);
+ clientResize (c, part, (XEvent *) ev);
}
}
@@ -720,7 +690,7 @@
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 @@
if (tclick == XFWM_BUTTON_DRAG)
{
- moveRequest (c, (XEvent *) ev);
+ clientMove (c, (XEvent *) ev);
}
else if (tclick != XFWM_BUTTON_UNDEFINED)
{
@@ -2706,9 +2676,8 @@
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;
}
Modified: xfwm4/trunk/src/moveresize.c
===================================================================
--- xfwm4/trunk/src/moveresize.c 2008-06-03 20:52:52 UTC (rev 27026)
+++ xfwm4/trunk/src/moveresize.c 2008-06-03 21:26:17 UTC (rev 27027)
@@ -889,6 +889,16 @@
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 @@
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;
Modified: xfwm4/trunk/src/netwm.c
===================================================================
--- xfwm4/trunk/src/netwm.c 2008-06-03 20:52:52 UTC (rev 27026)
+++ xfwm4/trunk/src/netwm.c 2008-06-03 21:26:17 UTC (rev 27027)
@@ -1136,8 +1136,12 @@
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 @@
{
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];
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits