kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=e6b62914b43373ec58c70837cfd68c8af1bd62cc

commit e6b62914b43373ec58c70837cfd68c8af1bd62cc
Author: Kim Woelders <k...@woelders.dk>
Date:   Tue Jun 23 20:54:12 2020 +0200

    Make "only primary mouse button raises" option take effect immediately
---
 src/ewins.h |  1 +
 src/focus.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/ewins.h b/src/ewins.h
index 3bc8f0f8..628da6f5 100644
--- a/src/ewins.h
+++ b/src/ewins.h
@@ -87,6 +87,7 @@ struct _ewin {
       char                visibility;
       char                shaped;
       char                shaded;
+      unsigned char       click_grab_button;
 
       unsigned            snapstarted:1;       /* Started from snap cmd */
       unsigned            identified:1;
diff --git a/src/focus.c b/src/focus.c
index d974d125..79c9c38a 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -236,6 +236,13 @@ ClickGrabsSet(EWin * ewin)
 
    if (set)
      {
+       if (ewin->state.click_grab_isset &&
+           ewin->state.click_grab_button != raise_button)
+         {
+            GrabButtonRelease(ewin->state.click_grab_button, AnyModifier,
+                              EwinGetClientConWin(ewin));
+            ewin->state.click_grab_isset = 0;
+         }
        if (!ewin->state.click_grab_isset)
          {
             GrabButtonSet(raise_button, AnyModifier, EwinGetClientConWin(ewin),
@@ -244,13 +251,14 @@ ClickGrabsSet(EWin * ewin)
                Eprintf("%s: %#x set %s\n", __func__,
                        EwinGetClientXwin(ewin), EwinGetTitle(ewin));
             ewin->state.click_grab_isset = 1;
+            ewin->state.click_grab_button = raise_button;
          }
      }
    else
      {
        if (ewin->state.click_grab_isset)
          {
-            GrabButtonRelease(raise_button, AnyModifier,
+            GrabButtonRelease(ewin->state.click_grab_button, AnyModifier,
                               EwinGetClientConWin(ewin));
             if (EDebug(EDBUG_TYPE_GRABS))
                Eprintf("%s: %#x unset %s\n", __func__,

-- 


Reply via email to