]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: Redefine Title context to include blank areas of Titlebar
authorJohn Lindgren <john@jlindgren.net>
Thu, 8 Sep 2022 17:20:48 +0000 (13:20 -0400)
committerJohn Lindgren <john@jlindgren.net>
Fri, 9 Sep 2022 19:23:13 +0000 (15:23 -0400)
... and use Title for the Drag (Move) and DoubleClick (Maximize)
titlebar actions, which are unexpected when the cursor is over one
of the window buttons.

docs/labwc-config.5.scd
docs/rc.xml.all
src/config/rcxml.c
src/ssd/ssd.c

index 920455b913f57a48dc663349843b86c47bee88a9..ea2a6efba121e9f0d1da1821428e83f341ee50c4 100644 (file)
@@ -186,8 +186,10 @@ The rest of this man page describes configuration options.
        *<action>* can exist within one *<mousebind>*
 
        Define a mouse binding. Supported context-names include:
-       - TitleBar: The area where the title of the window is shown.
-       - Title: The title of the window itself.
+       - TitleBar: The decoration on top of the window, where the window
+         buttons and the window title are shown.
+       - Title: The area of the titlebar (including blank space) between
+         the window buttons, where the window title is displayed.
        - WindowMenu: The button on the left.
        - Iconify: The button that looks like an underline.
        - Maximize: The button that looks like a box.
index 390599f89c538f43ee0993ab80ebd067f792eac5..457038dc1e0028b9a9d1b79ae6cc04f4fc6de7e9 100644 (file)
         <action name="Focus"/>
         <action name="Raise"/>
       </mousebind>
-      <mousebind button="Left" action="Drag">
-        <action name="Move"/>
-      </mousebind>
       <mousebind button="Right" action="Click">
         <action name="Focus" />
         <action name="Raise" />
           <menu>client-menu</menu>
         </action>
       </mousebind>
+    </context>
+
+    <context name="Title">
+      <mousebind button="Left" action="Drag">
+        <action name="Move"/>
+      </mousebind>
       <mousebind button="Left" action="DoubleClick">
-        <action name="Focus"/>
-        <action name="Raise"/>
         <action name="ToggleMaximize"/>
       </mousebind>
     </context>
index c0a92991ef0ac1c8b7b1f591914393d384c2422b..141b2c3dd4e6671eb3e5888ad03f2afe18a5a80e 100644 (file)
@@ -570,8 +570,8 @@ static struct mouse_combos {
        { "Frame", "A-Right", "Drag", "Resize", NULL},
        { "Titlebar", "Left", "Press", "Focus", NULL},
        { "Titlebar", "Left", "Press", "Raise", NULL},
-       { "TitleBar", "Left", "Drag", "Move", NULL },
-       { "TitleBar", "Left", "DoubleClick", "ToggleMaximize", NULL },
+       { "Title", "Left", "Drag", "Move", NULL },
+       { "Title", "Left", "DoubleClick", "ToggleMaximize", NULL },
        { "TitleBar", "Right", "Click", "Focus", NULL},
        { "TitleBar", "Right", "Click", "Raise", NULL},
        { "TitleBar", "Right", "Click", "ShowMenu", "client-menu"},
index e6362f34d0744509737d1e830d3df66be30dfd64..744f650e23e5595d9bfc5593f13ce0524f0d0b7f 100644 (file)
@@ -243,6 +243,11 @@ ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate)
                return candidate >= LAB_SSD_BUTTON_CLOSE
                        && candidate <= LAB_SSD_PART_TITLE;
        }
+       if (whole == LAB_SSD_PART_TITLE) {
+               /* "Title" includes blank areas of "Titlebar" as well */
+               return candidate >= LAB_SSD_PART_TITLEBAR
+                       && candidate <= LAB_SSD_PART_TITLE;
+       }
        if (whole == LAB_SSD_FRAME) {
                return candidate >= LAB_SSD_BUTTON_CLOSE
                        && candidate <= LAB_SSD_CLIENT;