diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-10 01:15:14 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2007-03-10 01:15:14 +0000 |
commit | 6ab8fb150f8a9e614d9579fd15d0219074d24d0c (patch) | |
tree | 9fd18ca07bc715217a9ebcbfe667ccc22e114aee /src | |
parent | e179b813f48ac641ff12a3d761f2c86c56cdc3b3 (diff) | |
download | metacity-6ab8fb150f8a9e614d9579fd15d0219074d24d0c.tar.gz |
honour preferences. new functions.
2007-03-09 Linus Torvalds <torvalds@woody.linux-foundation.org>
* src/frames.c (meta_frame_middle_click_event,
meta_frame_right_click_event): honour preferences.
* src/prefs.[ch] (meta_prefs_get_action_middle_click_titlebar,
meta_prefs_get_action_right_click_titlebar): new functions.
svn path=/trunk/; revision=3102
Diffstat (limited to 'src')
-rw-r--r-- | src/frames.c | 8 | ||||
-rw-r--r-- | src/prefs.c | 16 | ||||
-rw-r--r-- | src/prefs.h | 4 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/frames.c b/src/frames.c index 35d94caf..aac8a790 100644 --- a/src/frames.c +++ b/src/frames.c @@ -1275,14 +1275,18 @@ static gboolean meta_frame_middle_click_event (MetaUIFrame *frame, GdkEventButton *event) { - return meta_frame_titlebar_event (frame, event, META_ACTION_TITLEBAR_LOWER); + int action = meta_prefs_get_action_middle_click_titlebar(); + + return meta_frame_titlebar_event (frame, event, action); } static gboolean meta_frame_right_click_event(MetaUIFrame *frame, GdkEventButton *event) { - return meta_frame_titlebar_event (frame, event, META_ACTION_TITLEBAR_MENU); + int action = meta_prefs_get_action_right_click_titlebar(); + + return meta_frame_titlebar_event (frame, event, action); } static gboolean diff --git a/src/prefs.c b/src/prefs.c index 008b111e..7c0358c8 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -47,6 +47,8 @@ #define KEY_FOCUS_NEW_WINDOWS "/apps/metacity/general/focus_new_windows" #define KEY_RAISE_ON_CLICK "/apps/metacity/general/raise_on_click" #define KEY_ACTION_DOUBLE_CLICK_TITLEBAR "/apps/metacity/general/action_double_click_titlebar" +#define KEY_ACTION_MIDDLE_CLICK_TITLEBAR "/apps/metacity/general/action_middle_click_titlebar" +#define KEY_ACTION_RIGHT_CLICK_TITLEBAR "/apps/metacity/general/action_right_click_titlebar" #define KEY_AUTO_RAISE "/apps/metacity/general/auto_raise" #define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay" #define KEY_THEME "/apps/metacity/general/theme" @@ -92,6 +94,8 @@ static gboolean raise_on_click = TRUE; static char* current_theme = NULL; static int num_workspaces = 4; 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 gboolean application_based = FALSE; static gboolean disable_workarounds = FALSE; static gboolean auto_raise = FALSE; @@ -2882,6 +2886,18 @@ meta_prefs_get_action_double_click_titlebar (void) return action_double_click_titlebar; } +MetaActionTitlebar +meta_prefs_get_action_middle_click_titlebar (void) +{ + return action_middle_click_titlebar; +} + +MetaActionTitlebar +meta_prefs_get_action_right_click_titlebar (void) +{ + return action_right_click_titlebar; +} + gboolean meta_prefs_get_auto_raise (void) { diff --git a/src/prefs.h b/src/prefs.h index f1f36b22..95296f90 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -93,7 +93,11 @@ const char* meta_prefs_get_terminal_command (void); const char* meta_prefs_get_gconf_key_for_terminal_command (void); void meta_prefs_get_button_layout (MetaButtonLayout *button_layout); + +/* Double, right, middle click can be configured to any titlebar meta-action */ MetaActionTitlebar meta_prefs_get_action_double_click_titlebar (void); +MetaActionTitlebar meta_prefs_get_action_middle_click_titlebar (void); +MetaActionTitlebar meta_prefs_get_action_right_click_titlebar (void); void meta_prefs_set_num_workspaces (int n_workspaces); |