summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-12 17:19:58 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-12 17:19:58 +0100
commit71e10fed72e6b4104741f9d0062c571c41970f33 (patch)
tree6542030fd11e5115dcc3bdcc5d1000bd65d607d0
parent0cbc4d0a296de99e1b3fec4ba914665b55dfc167 (diff)
downloadshelf-71e10fed72e6b4104741f9d0062c571c41970f33.tar.gz
shelf-71e10fed72e6b4104741f9d0062c571c41970f33.tar.bz2
Fix IPW blocking input from other windows.
For some reason, ButtonPress events are blocked from other windows if override_redirect windows are stacked directly under those windows. Stacking the IPW under the window we want to block input from anyway works around this.
-rw-r--r--shelf.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/shelf.c b/shelf.c
index bff32c3..a8b04ce 100644
--- a/shelf.c
+++ b/shelf.c
@@ -317,7 +317,7 @@ shelfAdjustIPW (CompWindow *w)
xwc.y = w->attrib.y - w->input.top;
xwc.width = (int) width;
xwc.height = (int) height;
- xwc.stack_mode = Above;
+ xwc.stack_mode = Below;
xwc.sibling = w->id;
XConfigureWindow (w->screen->display->display, sw->info->ipw,
@@ -336,7 +336,26 @@ shelfAdjustIPWStacking (CompScreen *s)
for (run = ss->shelfedWindows; run; run = run->next)
{
- if (!run->w->next || run->w->next->id != run->ipw)
+ Bool stackingRight = FALSE;
+
+ if (run->w->prev)
+ {
+ /* the stacking is correct if either
+ a) the window under the main window is the IPW or
+ b) the second window under the main window is the IPW,
+ if the first one is the frame
+ */
+ if (run->w->prev->id == run->ipw)
+ stackingRight = TRUE;
+ else if (run->w->prev->id == run->w->frame)
+ {
+ if (run->w->prev->prev)
+ if (run->w->prev->prev->id == run->ipw)
+ stackingRight = TRUE;
+ }
+ }
+
+ if (!stackingRight)
shelfAdjustIPW (run->w);
}
}
@@ -354,6 +373,8 @@ shelfCreateIPW (CompWindow *w)
return;
attrib.override_redirect = TRUE;
+ attrib.event_mask = 0;
+
ipw = XCreateWindow (w->screen->display->display,
w->screen->root,
w->serverX - w->input.left,
@@ -361,8 +382,9 @@ shelfCreateIPW (CompWindow *w)
w->serverWidth + w->input.left + w->input.right,
w->serverHeight + w->input.top + w->input.bottom,
0, CopyFromParent, InputOnly, CopyFromParent,
- CWOverrideRedirect, &attrib);
-
+ CWEventMask | CWOverrideRedirect,
+ &attrib);
+
sw->info->ipw = ipw;
}
@@ -854,6 +876,7 @@ shelfInitScreen (CompPlugin *p,
ss->lastPointerY = 0;
ss->noLastPointer = TRUE;
+ ss->grabIndex = 0;
ss->grabbedWindow = None;
ss->shelfedWindows = NULL;