summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 12:05:25 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 12:05:25 +0000
commitcae1379bf391295cbd714f52dccc3cde7f229006 (patch)
tree03fc462dcd75eea9677ca1bfa0d5614359e0c635
parent1352172f7fd539b3367362f260350ce5e859e223 (diff)
downloadmarex-dev-cae1379bf391295cbd714f52dccc3cde7f229006.tar.gz
marex-dev-cae1379bf391295cbd714f52dccc3cde7f229006.tar.bz2
Fix damage issues
git-svn-id: file:///beryl/trunk@4095 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/wall.c123
1 files changed, 68 insertions, 55 deletions
diff --git a/beryl-plugins/src/wall.c b/beryl-plugins/src/wall.c
index 1bfe619..f38a622 100644
--- a/beryl-plugins/src/wall.c
+++ b/beryl-plugins/src/wall.c
@@ -377,60 +377,11 @@ static void wallHandleEvent(CompDisplay * d, XEvent * event)
s = findScreenAtDisplay(d, event->xbutton.root);
ws = GET_WALL_SCREEN(s, wd);
ws->anyClick = TRUE;
+ damageScreen(s);
if (ws->expoMode)
{
if (event->xbutton.button == Button1)
- {
- int origView = s->x;
- int origViewY = s->y;
- CompWindow *w;
-
- ws->dndState = DnDNone;
-
- moveScreenViewport(s, s->x, s->y, FALSE);
-
- for (w = s->reverseWindows; w; w = w->prev)
- {
- if (w->destroyed)
- continue;
-
- if (!w->shaded && (w->attrib.map_state != IsViewable || !w->damaged))
- continue;
-
- if (w->state & CompWindowStateOffscreenMask)
- continue;
-
- if (w->type & CompWindowTypeNormalMask)
- {
- if (ws->newCursorX < WIN_X(w) || ws->newCursorX > WIN_X(w) + WIN_W(w))
- continue;
- if (ws->newCursorY < WIN_Y(w) || ws->newCursorY > WIN_Y(w) + WIN_H(w))
- continue;
-
- ws->dndState = DnDDuring;
- ws->dndWindow = w;
- (*w->screen->windowGrabNotify) (w, ws->newCursorX, ws->newCursorY, 0,
- CompWindowGrabMoveMask | CompWindowGrabButtonMask);
- break;
- }
- }
- if (ws->dndWindow)
- {
- raiseWindow(ws->dndWindow);
- moveInputFocusToWindow(ws->dndWindow);
- }
-
- moveScreenViewport(s, -origView, -origViewY, FALSE);
-
- for (w = s->windows; w; w = w->next)
- {
- WALL_WINDOW(w);
- ww->hovered = FALSE;
- }
-
- ws->prevCursorX = ws->newCursorX;
- ws->prevCursorY = ws->newCursorY;
- }
+ ws->dndState = DnDStart;
else if (event->xbutton.button != Button5)
{
CompWindow *w;
@@ -477,7 +428,7 @@ static void wallHandleEvent(CompDisplay * d, XEvent * event)
ws->dndState = DnDNone;
ws->dndWindow = NULL;
}
- break;
+ break; // FIXME: I'm not sure this break is needed, but I think so
case ClientMessage:
if (event->xclient.message_type == d->winActiveAtom)
{
@@ -1564,7 +1515,7 @@ static void wallPaintTransformedScreen(CompScreen * s,
ws->mouseOverViewY = j;
ws->newCursorX = i * s->width + cursor[0];
ws->newCursorY = j * s->height + cursor[1];
- if (ws->dndState != DnDNone || ws->anyClick)
+ if (ws->anyClick)
{
ws->origVX = i; // Used to save last viewport interaction was in
@@ -1750,7 +1701,7 @@ static void wallDonePaintScreen(CompScreen * s)
{
WALL_SCREEN(s);
- if (ws->moving || ws->boxTimeout || (ws->expoCam > 0.0f && ws->expoCam < 1.0f))
+ if (ws->moving || ws->boxTimeout || (ws->expoCam > 0.0f && ws->expoCam < 1.0f) || ws->anyClick || ws->dndState != DnDNone)
damageScreen(s);
if (ws->boxTimeout < 0)
@@ -1796,7 +1747,7 @@ static void wallDonePaintScreen(CompScreen * s)
int dy = ws->newCursorY - ws->prevCursorY;
if (ws->dndWindow && !ws->stickyWindow)
- moveWindow(ws->dndWindow, dx, dy, TRUE, FALSE); //!!!
+ moveWindow(ws->dndWindow, dx, dy, TRUE, TRUE);
ws->prevCursorX = ws->newCursorX;
ws->prevCursorY = ws->newCursorY;
@@ -1804,6 +1755,68 @@ static void wallDonePaintScreen(CompScreen * s)
damageScreen(s);
}
+
+ if (ws->dndState != DnDStart)
+ return;
+
+ int origView = s->x;
+ int origViewY = s->y;
+
+ // needs to be moved into handle event
+ moveScreenViewport(s, s->x, s->y, FALSE);
+
+ CompWindow *w;
+
+ for (w = s->reverseWindows; w; w = w->prev)
+ {
+ if (w->destroyed)
+ continue;
+
+ if (!w->shaded)
+ {
+ if (w->attrib.map_state != IsViewable || !w->damaged)
+ continue;
+ }
+
+ if (w->state & CompWindowStateOffscreenMask)
+ continue;
+
+ if (w->type & CompWindowTypeNormalMask)
+ {
+ if (ws->newCursorX < WIN_X(w) ||
+ ws->newCursorX > WIN_X(w) + WIN_W(w))
+ continue;
+ if (ws->newCursorY < WIN_Y(w) ||
+ ws->newCursorY > WIN_Y(w) + WIN_H(w))
+ continue;
+ ws->dndState = DnDDuring;
+ ws->dndWindow = w;
+ (*w->screen->windowGrabNotify) (w, ws->newCursorX, ws->newCursorY, 0,
+ CompWindowGrabMoveMask | CompWindowGrabButtonMask);
+ break;
+ }
+ }
+ if (ws->dndWindow)
+ {
+ raiseWindow(ws->dndWindow);
+ moveInputFocusToWindow(ws->dndWindow);
+ }
+
+ moveScreenViewport(s, -origView, -origViewY, FALSE);
+
+ for (w = s->windows; w; w = w->next)
+ {
+ WALL_WINDOW(w);
+ ww->hovered = FALSE;
+ }
+
+ if (ws->dndState == DnDStart) // No window is hovered
+ ws->dndState = DnDNone;
+
+ ws->prevCursorX = ws->newCursorX;
+ ws->prevCursorY = ws->newCursorY;
+
+ //damageScreen(s);
}
static void wallDisplayInitOptions(WallDisplay * wd)