[Pkg-xfce-commits] r9367 - in /desktop/trunk/xfwm4/debian: changelog patches/ patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch

Yves-Alexis Perez corsac at moszumanska.debian.org
Fri Mar 25 08:10:22 UTC 2016


Author: corsac
Date: Fri Mar 25 08:10:22 2016
New Revision: 9367

URL: http://svn.debian.org/wsvn/pkg-xfce/?sc=1&rev=9367
Log:
* debian/patches
  - 0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE added, fix xfwm4
  freeze when clicking on the menu bar of KDE application.    closes: #819228

Added:
    desktop/trunk/xfwm4/debian/patches/
    desktop/trunk/xfwm4/debian/patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch
Modified:
    desktop/trunk/xfwm4/debian/changelog

Modified: desktop/trunk/xfwm4/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-xfce/desktop/trunk/xfwm4/debian/changelog?rev=9367&op=diff
==============================================================================
--- desktop/trunk/xfwm4/debian/changelog	(original)
+++ desktop/trunk/xfwm4/debian/changelog	Fri Mar 25 08:10:22 2016
@@ -1,3 +1,12 @@
+xfwm4 (4.12.3-2) UNRELEASED; urgency=medium
+
+  * debian/patches
+    - 0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE added, fix xfwm4
+    freeze when clicking on the menu bar of KDE application.    closes: #819228
+  
+
+ -- Yves-Alexis Perez <corsac at debian.org>  Fri, 25 Mar 2016 09:08:20 +0100
+
 xfwm4 (4.12.3-1) unstable; urgency=medium
 
   * New upstream bugfix release.

Added: desktop/trunk/xfwm4/debian/patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch
URL: http://svn.debian.org/wsvn/pkg-xfce/desktop/trunk/xfwm4/debian/patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch?rev=9367&op=file
==============================================================================
--- desktop/trunk/xfwm4/debian/patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch	(added)
+++ desktop/trunk/xfwm4/debian/patches/0001-Only-check-for-known-buttons-in-_NET_WM_MOVERESIZE.patch	Fri Mar 25 08:10:22 2016
@@ -0,0 +1,142 @@
+From 71d37e110d78d49a1476235aaa61e8614ca761e1 Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <fourdan at xfce.org>
+Date: Mon, 18 May 2015 22:18:48 +0200
+Subject: [PATCH] Only check for known buttons in _NET_WM_MOVERESIZE
+
+For _NET_WM_MOVERESIZE requests, if the given button does not match any
+available physical button, we would wait for that (impossible) button
+combination to be released.
+
+Check that the given button is one of the well known button or just wait
+for any button release otherwise.
+
+That fixes an issue with KDE apps where clicking on the menu bar to move
+the window would hang forever after the mouse button is depressed.
+
+Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
+---
+ src/moveresize.c | 28 ++++++++++++++++++++--------
+ src/netwm.c      | 22 +++-------------------
+ 2 files changed, 23 insertions(+), 27 deletions(-)
+
+diff --git a/src/moveresize.c b/src/moveresize.c
+index c605b17..411520d 100644
+--- a/src/moveresize.c
++++ b/src/moveresize.c
+@@ -618,11 +618,19 @@ static eventFilterStatus
+ clientButtonReleaseFilter (XEvent * xevent, gpointer data)
+ {
+     MoveResizeData *passdata = (MoveResizeData *) data;
++    ScreenInfo *screen_info;
++    Client *c;
++
++    c = passdata->c;
++    screen_info = c->screen_info;
+ 
+     TRACE ("entering clientButtonReleaseFilter");
+ 
+-    if ((xevent->type == ButtonRelease) &&
+-        (xevent->xbutton.button == passdata->button))
++    if ((xevent->type == ButtonRelease &&
++         (passdata->button == AnyButton ||
++          passdata->button == xevent->xbutton.button)) ||
++        (xevent->type == KeyPress &&
++         xevent->xkey.keycode == screen_info->params->keys[KEY_CANCEL].keycode))
+     {
+         gtk_main_quit ();
+         return EVENT_FILTER_STOP;
+@@ -986,7 +994,9 @@ clientMoveEventFilter (XEvent * xevent, gpointer data)
+     else if (xevent->type == ButtonRelease)
+     {
+         moving = FALSE;
+-        passdata->released = passdata->use_keys || (xevent->xbutton.button == passdata->button);
++        passdata->released = (passdata->use_keys ||
++                              passdata->button == AnyButton ||
++                              passdata->button == xevent->xbutton.button);
+     }
+     else if (xevent->type == MotionNotify)
+     {
+@@ -1175,7 +1185,7 @@ clientMove (Client * c, XEvent * ev)
+     passdata.use_keys = FALSE;
+     passdata.grab = FALSE;
+     passdata.released = FALSE;
+-    passdata.button = 0;
++    passdata.button = AnyButton;
+     passdata.is_transient = clientIsValidTransientOrModal (c);
+     passdata.move_resized = FALSE;
+     passdata.wireframe = NULL;
+@@ -1287,7 +1297,7 @@ clientMove (Client * c, XEvent * ev)
+     }
+     clientConfigure (c, &wc, changes, passdata.configure_flags);
+ 
+-    if (!passdata.released)
++    if (passdata.button != AnyButton && !passdata.released)
+     {
+         /* If this is a drag-move, wait for the button to be released.
+          * If we don't, we might get release events in the wrong place.
+@@ -1638,7 +1648,9 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
+     else if (xevent->type == ButtonRelease)
+     {
+         resizing = FALSE;
+-        passdata->released = (passdata->use_keys || (xevent->xbutton.button == passdata->button));
++        passdata->released = (passdata->use_keys ||
++                              passdata->button == AnyButton ||
++                              passdata->button == xevent->xbutton.button);
+     }
+     else if ((xevent->type == UnmapNotify) && (xevent->xunmap.window == c->window))
+     {
+@@ -1715,7 +1727,7 @@ clientResize (Client * c, int handle, XEvent * ev)
+     passdata.use_keys = FALSE;
+     passdata.grab = FALSE;
+     passdata.released = FALSE;
+-    passdata.button = 0;
++    passdata.button = AnyButton;
+     passdata.handle = handle;
+     passdata.wireframe = NULL;
+     w_orig = c->width;
+@@ -1819,7 +1831,7 @@ clientResize (Client * c, int handle, XEvent * ev)
+     }
+     clientReconfigure (c, NO_CFG_FLAG);
+ 
+-    if (!passdata.released)
++    if (passdata.button != AnyButton && !passdata.released)
+     {
+         /* If this is a drag-resize, wait for the button to be released.
+          * If we don't, we might get release events in the wrong place.
+diff --git a/src/netwm.c b/src/netwm.c
+index 93ff43f..ef3552c 100644
+--- a/src/netwm.c
++++ b/src/netwm.c
+@@ -613,26 +613,10 @@ clientNetMoveResize (Client * c, XClientMessageEvent * ev)
+     button = (int) ev->data.l[3];
+     event  = (XEvent *) ev;
+ 
+-    if (button == 0)
++    /* We don't deal with button > 7, in such a case we pretent it's just any button */
++    if (button > Button7)
+     {
+-        button_mask = getMouseXY (screen_info, c->window, &dx, &dy);
+-        if (button_mask & Button1Mask)
+-        {
+-            button = Button1;
+-        }
+-        else if (button_mask & Button2Mask)
+-        {
+-            button = Button2;
+-        }
+-        else if (button_mask & Button3Mask)
+-        {
+-            button = Button3;
+-        }
+-        else
+-        {
+-            /* Fallback */
+-            button = Button1;
+-        }
++        button = AnyButton;
+     }
+ 
+     corner = CORNER_BOTTOM_RIGHT;
+-- 
+2.8.0.rc3
+




More information about the Pkg-xfce-commits mailing list