From ebd0a5d5269835d70bf669d69a51ce7d61e26f68 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Thu, 8 Sep 2022 13:20:48 -0400 Subject: [PATCH] config: Redefine Title context to include blank areas of Titlebar ... 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 | 6 ++++-- docs/rc.xml.all | 11 ++++++----- src/config/rcxml.c | 4 ++-- src/ssd/ssd.c | 5 +++++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 920455b9..ea2a6efb 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -186,8 +186,10 @@ The rest of this man page describes configuration options. ** can exist within one ** 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. diff --git a/docs/rc.xml.all b/docs/rc.xml.all index 390599f8..457038dc 100644 --- a/docs/rc.xml.all +++ b/docs/rc.xml.all @@ -215,9 +215,6 @@ - - - @@ -225,9 +222,13 @@ client-menu + + + + + + - - diff --git a/src/config/rcxml.c b/src/config/rcxml.c index c0a92991..141b2c3d 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -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"}, diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c index e6362f34..744f650e 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c @@ -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; -- 2.52.0