diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-10-24 08:22:35 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2009-02-04 08:48:05 +0100 |
commit | 2a37340f9610e7f80a66ed6ab48190c181784f6b (patch) | |
tree | 9ea22b5005018d5354a4fb614834097e9c0e8004 /src | |
parent | 3b4e93009b574120d49fe950bf68a7932a81fc70 (diff) |
Move window position validation to validateWindowResizeRequest function.
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/src/window.c b/src/window.c index a64a1d12..6cab7ee3 100644 --- a/src/window.c +++ b/src/window.c @@ -2957,6 +2957,44 @@ validateWindowResizeRequest (CompWindow *w, XWindowChanges *xwc, unsigned int source) { + CompScreen *s = w->screen; + + if (w->type & (CompWindowTypeDockMask | + CompWindowTypeFullscreenMask | + CompWindowTypeUnknownMask)) + return; + + if (*mask & CWY) + { + int min, max; + + min = s->workArea.y + w->input.top; + max = s->workArea.y + s->workArea.height; + + min -= s->y * s->height; + max += (s->vsize - s->y - 1) * s->height; + + if (xwc->y < min) + xwc->y = min; + else if (xwc->y > max) + xwc->y = max; + } + + if (*mask & CWX) + { + int min, max; + + min = s->workArea.x + w->input.left; + max = s->workArea.x + s->workArea.width; + + min -= s->x * s->width; + max += (s->hsize - s->x - 1) * s->width; + + if (xwc->x < min) + xwc->x = min; + else if (xwc->x > max) + xwc->x = max; + } } void @@ -3963,43 +4001,6 @@ moveResizeWindow (CompWindow *w, xwcm |= adjustConfigureRequestForGravity (w, xwc, xwcm, gravity); - if (!(w->type & (CompWindowTypeDockMask | - CompWindowTypeFullscreenMask | - CompWindowTypeUnknownMask))) - { - if (xwcm & CWY) - { - int min, max; - - min = w->screen->workArea.y + w->input.top; - max = w->screen->workArea.y + w->screen->workArea.height; - - min -= w->screen->y * w->screen->height; - max += (w->screen->vsize - w->screen->y - 1) * w->screen->height; - - if (xwc->y < min) - xwc->y = min; - else if (xwc->y > max) - xwc->y = max; - } - - if (xwcm & CWX) - { - int min, max; - - min = w->screen->workArea.x + w->input.left; - max = w->screen->workArea.x + w->screen->workArea.width; - - min -= w->screen->x * w->screen->width; - max += (w->screen->hsize - w->screen->x - 1) * w->screen->width; - - if (xwc->x < min) - xwc->x = min; - else if (xwc->x > max) - xwc->x = max; - } - } - (*w->screen->validateWindowResizeRequest) (w, &xwcm, xwc, source); xwcm |= addWindowSizeChanges (w, xwc, |