summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-06 11:25:22 -0500
committertrav90 <travawine@protonmail.ch>2018-04-06 11:25:22 -0500
commit2dba03fd2f864bd8020bd1502041fa67de8bf409 (patch)
tree6f7a4c9378bb5d99e395b52bcbbc35aa72830731 /widget
parente08833665d0645bbfdec53610650ec48e8b4c74f (diff)
downloaduxp-2dba03fd2f864bd8020bd1502041fa67de8bf409.tar.gz
[GTK3] Ignore double-click on WM without _NET_WM_MOVERESIZE support
This fixes a crash with GTK3 builds used with a window manager that does not support _NET_WM_MOVERESIZE.
Diffstat (limited to 'widget')
-rw-r--r--widget/gtk/nsWindow.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
index d97b35002c..e4e69c1b4d 100644
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6627,6 +6627,22 @@ nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent,
return false;
}
+ if (mIsX11Display) {
+ // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054
+ // To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE.
+ // See _should_perform_ewmh_drag() at gdkwindow-x11.c
+ GdkScreen* screen = gdk_window_get_screen(gdk_window);
+ GdkAtom atom = gdk_atom_intern("_NET_WM_MOVERESIZE", FALSE);
+ if (!gdk_x11_screen_supports_net_wm_hint(screen, atom)) {
+ static unsigned int lastTimeStamp = 0;
+ if (lastTimeStamp != aMouseEvent->mTime) {
+ lastTimeStamp = aMouseEvent->mTime;
+ } else {
+ return false;
+ }
+ }
+ }
+
// FIXME: It would be nice to have the widget position at the time
// of the event, but it's relatively unlikely that the widget has
// moved since the mousedown. (On the other hand, it's quite likely