From b5292ba66132104256590631b2d2b7a1c92ad934 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Fri, 15 Aug 2025 07:20:47 -0400 Subject: window: Add configurable mouse actions for titlebar Adds support for configurable mouse actions on window titlebars, including middle-click and scroll wheel events. New actions added: - close: Close the window - raise: Raise window to top - toggle_stick: Toggle sticky state (all workspaces) - toggle_above: Toggle always-on-top state Fixes #425 Fixes #787 Note: requries matching mate-control-center changes to work properly --- src/core/prefs.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/core/prefs.c') diff --git a/src/core/prefs.c b/src/core/prefs.c index 032bba8f..844b1a06 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -109,6 +109,8 @@ static MetaWrapStyle wrap_style = META_WRAP_NONE; static MetaActionTitlebar action_double_click_titlebar = META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE; static MetaActionTitlebar action_middle_click_titlebar = META_ACTION_TITLEBAR_LOWER; static MetaActionTitlebar action_right_click_titlebar = META_ACTION_TITLEBAR_MENU; +static MetaActionTitlebar action_scroll_up_titlebar = META_ACTION_TITLEBAR_NONE; +static MetaActionTitlebar action_scroll_down_titlebar = META_ACTION_TITLEBAR_NONE; static gboolean application_based = FALSE; static gboolean disable_workarounds = FALSE; static gboolean auto_raise = FALSE; @@ -336,6 +338,16 @@ static MetaEnumPreference preferences_enum[] = META_PREF_ACTION_RIGHT_CLICK_TITLEBAR, (gint *) &action_right_click_titlebar, }, + { "action-scroll-up-titlebar", + KEY_GENERAL_SCHEMA, + META_PREF_ACTION_SCROLL_UP_TITLEBAR, + (gint *) &action_scroll_up_titlebar, + }, + { "action-scroll-down-titlebar", + KEY_GENERAL_SCHEMA, + META_PREF_ACTION_SCROLL_DOWN_TITLEBAR, + (gint *) &action_scroll_down_titlebar, + }, { "placement-mode", KEY_GENERAL_SCHEMA, META_PREF_PLACEMENT_MODE, @@ -1645,6 +1657,12 @@ meta_preference_to_string (MetaPreference pref) case META_PREF_ACTION_RIGHT_CLICK_TITLEBAR: return "ACTION_RIGHT_CLICK_TITLEBAR"; + case META_PREF_ACTION_SCROLL_UP_TITLEBAR: + return "ACTION_SCROLL_UP_TITLEBAR"; + + case META_PREF_ACTION_SCROLL_DOWN_TITLEBAR: + return "ACTION_SCROLL_DOWN_TITLEBAR"; + case META_PREF_AUTO_RAISE: return "AUTO_RAISE"; @@ -2299,6 +2317,18 @@ meta_prefs_get_action_right_click_titlebar (void) return action_right_click_titlebar; } +MetaActionTitlebar +meta_prefs_get_action_scroll_up_titlebar (void) +{ + return action_scroll_up_titlebar; +} + +MetaActionTitlebar +meta_prefs_get_action_scroll_down_titlebar (void) +{ + return action_scroll_down_titlebar; +} + gboolean meta_prefs_get_auto_raise (void) { -- cgit v1.2.1