From dee034771c8f3b519c8011faf78d277d6af76933 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Mon, 14 Sep 2015 03:06:18 +0300 Subject: Add manual and by-pointer window placement This adds a window placement preference: the existing behavior is now called "automatic" and is the default. Two new modes are being introduced: "pointer", which means that windows are placed according to the mouse pointer position; and "manual" which means that the user must manually place the new window with the mouse or keyboard. This is a straight port from muffin, commit 3257671. --- src/core/prefs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/prefs.c') diff --git a/src/core/prefs.c b/src/core/prefs.c index 8fa28b83..2f3e9392 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -168,6 +168,8 @@ static void init_window_bindings (void); static void init_commands (void); static void init_workspace_names (void); +static MetaPlacementMode placement_mode = META_PLACEMENT_MODE_AUTOMATIC; + typedef struct { MetaPrefsChangedFunc func; @@ -317,6 +319,11 @@ static MetaEnumPreference preferences_enum[] = META_PREF_ACTION_RIGHT_CLICK_TITLEBAR, (gint *) &action_right_click_titlebar, }, + { "placement-mode", + KEY_GENERAL_SCHEMA, + META_PREF_PLACEMENT_MODE, + (gint *) &placement_mode, + }, { NULL, NULL, 0, NULL }, }; @@ -1556,6 +1563,9 @@ meta_preference_to_string (MetaPreference pref) case META_PREF_SIDE_BY_SIDE_TILING: return "SIDE_BY_SIDE_TILING"; + + case META_PREF_PLACEMENT_MODE: + return "PLACEMENT_MODE"; } return "(unknown)"; @@ -2241,6 +2251,12 @@ meta_prefs_get_force_fullscreen (void) return force_fullscreen; } +MetaPlacementMode +meta_prefs_get_placement_mode (void) +{ + return placement_mode; +} + void meta_prefs_set_force_compositing_manager (gboolean whether) { -- cgit v1.2.1