summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-05-25 11:01:17 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-05-25 11:01:17 +0800
commita282abac5bd41ca920263f11e510b715f84bcdc3 (patch)
tree9790b68584c171e3430ad4f42d435aa9fdc185c5 /src
parent08828ed6fc5d23b66abc16309c062e69ce130f7b (diff)
downloadmobilebling-a282abac5bd41ca920263f11e510b715f84bcdc3.tar.gz
mobilebling-a282abac5bd41ca920263f11e510b715f84bcdc3.tar.bz2
Restore selected event masks already rather than using hardcoded ones
Fixes LP #761616 where edge buttons wouldn't work because we'd select for button events and then they wouldn't get restored at all
Diffstat (limited to 'src')
-rw-r--r--src/screen.cpp6
-rw-r--r--src/window.cpp22
2 files changed, 18 insertions, 10 deletions
diff --git a/src/screen.cpp b/src/screen.cpp
index 4d26c68..ed2a9b0 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -4558,9 +4558,11 @@ CompScreen::init (const char *name)
XA_ATOM, 32, PropModeReplace,
(unsigned char *) &xdndVersion, 1);
+ /* CompWindow::CompWindow will select for
+ * crossing events when it gets called on
+ * CreateNotify of this window, so no need
+ * to select for them here */
XSelectInput (dpy, priv->screenEdge[i].id,
- EnterWindowMask |
- LeaveWindowMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask);
diff --git a/src/window.cpp b/src/window.cpp
index 727e6c6..71644e3 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -5249,6 +5249,7 @@ CompWindow::CompWindow (Window aboveId,
priv->clientLeader = None;
XSelectInput (screen->dpy (), priv->id,
+ wa.your_event_mask |
PropertyChangeMask |
EnterWindowMask |
FocusChangeMask);
@@ -5850,8 +5851,8 @@ PrivateWindow::reparent ()
/* Reparent the client into the wrapper window */
XReparentWindow (dpy, id, wrapper, 0, 0);
- attr.event_mask = PropertyChangeMask | FocusChangeMask |
- EnterWindowMask | LeaveWindowMask;
+ /* Restore events */
+ attr.event_mask = wa.your_event_mask;
/* We don't care about client events on the frame, and listening for them
* will probably end up fighting the client anyways, so disable them */
@@ -5910,10 +5911,11 @@ PrivateWindow::reparent ()
void
PrivateWindow::unreparent ()
{
- Display *dpy = screen->dpy ();
- XEvent e;
- bool alive = true;
- XWindowChanges xwc;
+ Display *dpy = screen->dpy ();
+ XEvent e;
+ bool alive = true;
+ XWindowChanges xwc;
+ XWindowAttributes wa;
if (!frame)
return;
@@ -5925,6 +5927,11 @@ PrivateWindow::unreparent ()
XPutBackEvent (dpy, &e);
alive = false;
}
+ else
+ {
+ if (!XGetWindowAttributes (dpy, id, &wa))
+ alive = false;
+ }
if ((!destroyed) && alive)
{
@@ -5949,8 +5956,7 @@ PrivateWindow::unreparent ()
XUnmapWindow (dpy, frame);
- XSelectInput (dpy, id, PropertyChangeMask | EnterWindowMask |
- FocusChangeMask);
+ XSelectInput (dpy, id, wa.your_event_mask);
XSelectInput (dpy, screen->root (),
SubstructureRedirectMask |