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
This commit is contained in:
Linus Torvalds 2007-03-10 01:15:14 +00:00 committed by Thomas James Alexander Thurman
parent e179b813f4
commit 6ab8fb150f
4 changed files with 33 additions and 2 deletions

View File

@ -1,3 +1,10 @@
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.
2007-02-20 Kjartan Maraas <kmaraas@gnome.org> 2007-02-20 Kjartan Maraas <kmaraas@gnome.org>
* Makefile.am: Add MAINTAINERS to EXTRA_DIST so others * Makefile.am: Add MAINTAINERS to EXTRA_DIST so others

View File

@ -1275,14 +1275,18 @@ static gboolean
meta_frame_middle_click_event (MetaUIFrame *frame, meta_frame_middle_click_event (MetaUIFrame *frame,
GdkEventButton *event) 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 static gboolean
meta_frame_right_click_event(MetaUIFrame *frame, meta_frame_right_click_event(MetaUIFrame *frame,
GdkEventButton *event) 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 static gboolean

View File

@ -47,6 +47,8 @@
#define KEY_FOCUS_NEW_WINDOWS "/apps/metacity/general/focus_new_windows" #define KEY_FOCUS_NEW_WINDOWS "/apps/metacity/general/focus_new_windows"
#define KEY_RAISE_ON_CLICK "/apps/metacity/general/raise_on_click" #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_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 "/apps/metacity/general/auto_raise"
#define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay" #define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay"
#define KEY_THEME "/apps/metacity/general/theme" #define KEY_THEME "/apps/metacity/general/theme"
@ -92,6 +94,8 @@ static gboolean raise_on_click = TRUE;
static char* current_theme = NULL; static char* current_theme = NULL;
static int num_workspaces = 4; static int num_workspaces = 4;
static MetaActionTitlebar action_double_click_titlebar = META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE; 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 application_based = FALSE;
static gboolean disable_workarounds = FALSE; static gboolean disable_workarounds = FALSE;
static gboolean auto_raise = FALSE; static gboolean auto_raise = FALSE;
@ -2882,6 +2886,18 @@ meta_prefs_get_action_double_click_titlebar (void)
return action_double_click_titlebar; 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 gboolean
meta_prefs_get_auto_raise (void) meta_prefs_get_auto_raise (void)
{ {

View File

@ -93,7 +93,11 @@ const char* meta_prefs_get_terminal_command (void);
const char* meta_prefs_get_gconf_key_for_terminal_command (void); const char* meta_prefs_get_gconf_key_for_terminal_command (void);
void meta_prefs_get_button_layout (MetaButtonLayout *button_layout); 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_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); void meta_prefs_set_num_workspaces (int n_workspaces);