summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan@xfce.org>2009-10-10 20:05:36 +0200
committerOlivier Fourdan <fourdan@xfce.org>2009-11-17 11:38:17 +0100
commit455157569524053f1383a1b6fe1fa3f162e6d5cf (patch)
tree5ffa0df466f9e61f8274b304259730c76d7de6a0
parent941a74f58fdcfdad7eeb47260deea02b84ef149e (diff)
downloadxfwm4-455157569524053f1383a1b6fe1fa3f162e6d5cf.tar.gz
Keep windows entirely visible on screen change (bug #5795)
-rw-r--r--src/client.c17
-rw-r--r--src/client.h3
2 files changed, 12 insertions, 8 deletions
diff --git a/src/client.c b/src/client.c
index b3181e907..2e6342a95 100644
--- a/src/client.c
+++ b/src/client.c
@@ -722,8 +722,7 @@ clientConfigure (Client * c, XWindowChanges * wc, unsigned long mask, unsigned s
&& CONSTRAINED_WINDOW (c)
&& !((c->gravity == StaticGravity) && (c->x == 0) && (c->y == 0)))
{
- /* Keep fully visible only on resize */
- clientConstrainPos (c, (mask & (CWWidth | CWHeight)));
+ clientConstrainPos (c, CFG_KEEP_VISIBLE);
if (c->x != px)
{
@@ -804,7 +803,7 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
{
ScreenInfo *screen_info;
DisplayInfo *display_info;
- gboolean constrained;
+ unsigned short flags;
g_return_if_fail (c != NULL);
TRACE ("entering clientMoveResizeWindow");
@@ -843,14 +842,18 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
}
/* Still a move/resize after cleanup? */
- constrained = FALSE;
+ flags = CFG_REQUEST;
if (mask & (CWX | CWY | CWWidth | CWHeight))
{
if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED))
{
clientRemoveMaximizeFlag (c);
}
- constrained = TRUE;
+ flags |= CFG_REQUEST;
+ }
+ if (mask & (CWWidth | CWHeight))
+ {
+ flags |= CFG_KEEP_VISIBLE;
}
/*
Let's say that if the client performs a XRaiseWindow, we show the window if focus
@@ -878,7 +881,7 @@ clientMoveResizeWindow (Client * c, XWindowChanges * wc, unsigned long mask)
}
}
/* And finally, configure the window */
- clientConfigure (c, wc, mask, (constrained ? CFG_CONSTRAINED : 0) | CFG_REQUEST);
+ clientConfigure (c, wc, mask, flags);
}
void
@@ -3499,7 +3502,7 @@ clientScreenResize(ScreenInfo *screen_info)
{
wc.x = c->x;
wc.y = c->y;
- clientConfigure (c, &wc, CWX | CWY, CFG_CONSTRAINED | CFG_REQUEST);
+ clientConfigure (c, &wc, CWX | CWY, CFG_CONSTRAINED | CFG_REQUEST | CFG_KEEP_VISIBLE);
}
}
diff --git a/src/client.h b/src/client.h
index 58e0e51a9..1c6c032e2 100644
--- a/src/client.h
+++ b/src/client.h
@@ -64,7 +64,8 @@
#define CFG_CONSTRAINED (1<<0)
#define CFG_REQUEST (1<<1)
#define CFG_NOTIFY (1<<2)
-#define CFG_FORCE_REDRAW (1<<3)
+#define CFG_KEEP_VISIBLE (1<<3)
+#define CFG_FORCE_REDRAW (1<<4)
#define INCLUDE_HIDDEN (1<<0)
#define INCLUDE_SHADED (1<<1)