xfwm4: add easy_click hack
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 9 Mar 2014 00:11:47 +0000 (02:11 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 9 Mar 2014 00:11:47 +0000 (02:11 +0200)
This hack passes click event to fullscreen window even when
window move modifier is held.

recipes/xfce-base/xfwm4/xfwm4_no_easy_click_for_fullscreen.patch [new file with mode: 0644]
recipes/xfce-base/xfwm4_4.6.2.bb

diff --git a/recipes/xfce-base/xfwm4/xfwm4_no_easy_click_for_fullscreen.patch b/recipes/xfce-base/xfwm4/xfwm4_no_easy_click_for_fullscreen.patch
new file mode 100644 (file)
index 0000000..2305a86
--- /dev/null
@@ -0,0 +1,40 @@
+diff -ur /tmp/xfwm4-4.6.2/src/events.c ./src/events.c
+--- xfwm4-4.6.2/src/events.c   2014-03-08 23:10:09.040351189 +0200
++++ xfwm4-4.6.2/src/events.c   2014-03-09 00:47:37.061073583 +0200
+@@ -908,6 +908,7 @@
+     Window win;
+     int state, part;
+     gboolean replay;
++    gboolean easy_click;
+     TRACE ("entering handleButtonPress");
+@@ -919,15 +920,25 @@
+         win = ev->subwindow;
+         screen_info = c->screen_info;
+-        if ((ev->button == Button1) && (screen_info->params->easy_click) && (state == screen_info->params->easy_click))
++        easy_click = (screen_info->params->easy_click) && (state == screen_info->params->easy_click);
++
++        // XXX: how to check for fullscreen?
++        if (c->x == 0 && c->y == 0 && c->width == screen_info->width
++            && c->height == screen_info->height
++          && !(c->xfwm_flags & XFWM_FLAG_HAS_BORDER))
++        {
++            easy_click = FALSE;
++        }
++
++        if ((ev->button == Button1) && easy_click)
+         {
+             button1Action (c, ev);
+         }
+-        else if ((ev->button == Button2) && (screen_info->params->easy_click) && (state == screen_info->params->easy_click))
++        else if ((ev->button == Button2) && easy_click)
+         {
+             clientLower (c, None);
+         }
+-        else if ((ev->button == Button3) && (screen_info->params->easy_click) && (state == screen_info->params->easy_click))
++        else if ((ev->button == Button3) && easy_click)
+         {
+             part = edgeGetPart (c, ev);
+             edgeButton (c, part, ev);
index 87a492b..30c41cc 100644 (file)
@@ -2,10 +2,14 @@
 
 DESCRIPTION="Xfce4 Window Manager"
 SECTION = "x11/wm"
-PR = "r1"
+PR = "r2"
 
 inherit xfce46 update-alternatives
 
+SRC_URI += " \
+    file://xfwm4_no_easy_click_for_fullscreen.patch;patch=1 \
+"
+
 FILES_${PN} += "${datadir}/xfwm4/defaults ${datadir}/xfwm4/themes/default.keys/*"
 
 DEPENDS = "startup-notification virtual/libx11 libxpm libxfce4util libxfcegui4 libwnck"