summaryrefslogtreecommitdiff
path: root/gtk/gtksocket-x11.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-07-04 20:13:43 +0200
committerAlexander Larsson <alexl@redhat.com>2009-07-04 20:21:26 +0200
commit0e07d8b189e731b9d1c9e3b3eb7781b04a00a0f9 (patch)
tree5189e1f5e036c8cde081347f9a53e502c788c9a5 /gtk/gtksocket-x11.c
parent84c51a60895aae9761fb925af714d97e6b709246 (diff)
downloadgtk+-0e07d8b189e731b9d1c9e3b3eb7781b04a00a0f9.tar.gz
Hack that works around firefox plugin crash
It turns out that mozilla, as per the gtk2xt code selects for input on the socket with a mask of 0x0fffff (for god knows why) which includes ButtonPressMask, causing a BadAccess if someone else also selects for this. As per the client-side windows merge we always normally selects for button press so we can emulate it on client side children that selects for button press. However, we don't need this for GtkSocket, so we unselect it here, fixing the crashes in firefox.
Diffstat (limited to 'gtk/gtksocket-x11.c')
-rw-r--r--gtk/gtksocket-x11.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index bbeb8af792..f6f3a3d489 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -70,9 +70,17 @@ _gtk_socket_windowing_realize_window (GtkSocket *socket)
GDK_WINDOW_XWINDOW (window),
&xattrs);
+ /* Sooooo, it turns out that mozilla, as per the gtk2xt code selects
+ for input on the socket with a mask of 0x0fffff (for god knows why)
+ which includes ButtonPressMask causing a BadAccess if someone else
+ also selects for this. As per the client-side windows merge we always
+ normally selects for button press so we can emulate it on client
+ side children that selects for button press. However, we don't need
+ this for GtkSocket, so we unselect it here, fixing the crashes in
+ firefox. */
XSelectInput (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XWINDOW (window),
- xattrs.your_event_mask |
+ (xattrs.your_event_mask & ~ButtonPressMask) |
SubstructureNotifyMask | SubstructureRedirectMask);
}