summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2010-07-21 17:04:46 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2010-07-21 17:04:46 +0200
commit30fc88fed397081d950fed971d025e7980a64a5f (patch)
treeb96afab0d05d1452d2747499bfd1f576962625fd /mcwm.c
parent26ac89087b3d0310c682b3d92800fe291b20bcc2 (diff)
downloadmcwm-30fc88fed397081d950fed971d025e7980a64a5f.zip
Special treatmeant for fully maximized windows: Don't allow move or
resize.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/mcwm.c b/mcwm.c
index 25df372..5bd53ac 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -1304,6 +1304,12 @@ void resizestep(struct client *client, char direction)
return;
}
+ if (client->maxed)
+ {
+ /* Can resize a fully maximized window. */
+ return;
+ }
+
win = client->id;
if (!getpointer(win, &start_x, &start_y))
@@ -1589,6 +1595,12 @@ void movestep(struct client *client, char direction)
return;
}
+ if (client->maxed)
+ {
+ /* We can't move a fully maximized window. */
+ return;
+ }
+
win = client->id;
/* Save pointer position so we can warp pointer here later. */
@@ -2370,20 +2382,23 @@ void events(void)
/*
* Our pointer is moving and since we even get this event
- * we're resizing or moving a window.
+ * we're either resizing or moving a window.
+ *
+ * We don't bother actually doing anything if we don't
+ * have a focused window or if the focused window is
+ * totally maximized.
*/
if (mode == MCWM_MOVE)
{
- if (NULL != focuswin)
+ if (NULL != focuswin && !focuswin->maxed)
{
mousemove(focuswin->id, e->root_x, e->root_y);
}
-
}
else if (mode == MCWM_RESIZE)
{
/* Resize. */
- if (NULL != focuswin)
+ if (NULL != focuswin && !focuswin->maxed)
{
mouseresize(focuswin->id, e->root_x, e->root_y);
}