[PATCH 3/7] metacity: Add the prefs.c variables for middle-and right-click actions
- From: Linus Torvalds <torvalds linux-foundation org>
- To: gnomecc-list gnome org
- Subject: [PATCH 3/7] metacity: Add the prefs.c variables for middle-and right-click actions
- Date: Thu, 15 Feb 2007 17:00:43 -0800 (PST)
This does not actually yet parse the settings so you cannot actually set
them to anything but the defaults (which have stayed the same), but all
the users are now already using the variables.
Getting there..
Signed-off-by: Linus Torvalds <torvalds linux-foundation org>
---
src/frames.c | 8 ++++++--
src/prefs.c | 16 ++++++++++++++++
src/prefs.h | 4 ++++
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/frames.c b/src/frames.c
index 35d94ca..aac8a79 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 008b111..7c0358c 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 f1f36b2..95296f9 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);
--
1.5.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]