summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-12 08:06:59 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-12 08:06:59 +0100
commit4b244f577765cf5047fa0092399d77b2becc235e (patch)
treee2efd887ff2dd0e046ac7ec43cadc335ec244651
parent2782fdc25283e35eb0c46a0924709f973c330fc4 (diff)
downloadshelf-4b244f577765cf5047fa0092399d77b2becc235e.tar.gz
shelf-4b244f577765cf5047fa0092399d77b2becc235e.tar.bz2
Use linked list to always keep IPW stacked right above its window.
Not currently working yet, intermediate checkin.
-rw-r--r--shelf.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/shelf.c b/shelf.c
index 862b9f8..76cdd8d 100644
--- a/shelf.c
+++ b/shelf.c
@@ -322,6 +322,20 @@ shelfAdjustIPW (CompWindow *w)
XMapWindow (w->screen->display->display, sw->info->ipw);
}
+static void
+shelfAdjustIPWStacking (CompScreen *s)
+{
+ ShelfedWindowInfo *run;
+
+ SHELF_SCREEN (s);
+
+ for (run = ss->shelfedWindows; run; run = run->next)
+ {
+ if (!run->w->next || run->w->next->id != run->ipw)
+ shelfAdjustIPW (run->w);
+ }
+}
+
/* Create an input prevention window */
static void
shelfCreateIPW (CompWindow *w)
@@ -613,7 +627,7 @@ static void
shelfHandleEvent (CompDisplay *d,
XEvent *event)
{
- CompWindow *w;
+ CompWindow *w, *oldPrev, *oldNext;
CompScreen *s;
SHELF_DISPLAY (d);
@@ -638,11 +652,33 @@ shelfHandleEvent (CompDisplay *d,
case MotionNotify:
handleMotionEvent (d, event);
break;
+ case ConfigureNotify:
+ w = findWindowAtDisplay (d, event->xconfigure.window);
+ if (w)
+ {
+ oldPrev = w->prev;
+ oldNext = w->next;
+ }
+ break;
}
UNWRAP (sd, d, handleEvent);
(*d->handleEvent) (d, event);
WRAP (sd, d, handleEvent, shelfHandleEvent);
+
+ switch (event->type)
+ {
+ case ConfigureNotify:
+ if (w) /* already assigned above */
+ {
+ if (w->prev != oldPrev || w->next != oldNext)
+ {
+ /* restacking occured, ensure ipw stacking */
+ shelfAdjustIPWStacking (w->screen);
+ }
+ }
+ break;
+ }
}
/* The window was damaged, adjust the damage to fit the actual area we