mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
window: Don't use GTK+ to fetch the drag threshold
Just look it up in GSettings ourselves.
This commit is contained in:
parent
c3e87ee896
commit
67be4e2bf3
@ -67,6 +67,7 @@
|
||||
#define SCHEMA_INTERFACE "org.gnome.desktop.interface"
|
||||
#define SCHEMA_INPUT_SOURCES "org.gnome.desktop.input-sources"
|
||||
#define SCHEMA_XSETTINGS "org.gnome.settings-daemon.plugins.xsettings"
|
||||
#define SCHEMA_MOUSE "org.gnome.settings-daemon.peripherals.mouse"
|
||||
|
||||
#define SETTINGS(s) g_hash_table_lookup (settings_schemas, (s))
|
||||
|
||||
@ -101,6 +102,7 @@ static gboolean gnome_animations = TRUE;
|
||||
static char *cursor_theme = NULL;
|
||||
static int cursor_size = 24;
|
||||
static int draggable_border_width = 10;
|
||||
static int drag_threshold;
|
||||
static gboolean resize_with_right_button = FALSE;
|
||||
static gboolean edge_tiling = FALSE;
|
||||
static gboolean force_fullscreen = TRUE;
|
||||
@ -492,6 +494,13 @@ static MetaIntPreference preferences_int[] =
|
||||
},
|
||||
&draggable_border_width
|
||||
},
|
||||
{
|
||||
{ "drag-threshold",
|
||||
SCHEMA_MOUSE,
|
||||
META_PREF_DRAG_THRESHOLD,
|
||||
},
|
||||
&drag_threshold
|
||||
},
|
||||
{ { NULL, 0, 0 }, NULL },
|
||||
};
|
||||
|
||||
@ -1924,6 +1933,9 @@ meta_preference_to_string (MetaPreference pref)
|
||||
case META_PREF_DRAGGABLE_BORDER_WIDTH:
|
||||
return "DRAGGABLE_BORDER_WIDTH";
|
||||
|
||||
case META_PREF_DRAG_THRESHOLD:
|
||||
return "DRAG_TRHESHOLD";
|
||||
|
||||
case META_PREF_DYNAMIC_WORKSPACES:
|
||||
return "DYNAMIC_WORKSPACES";
|
||||
|
||||
@ -2389,6 +2401,12 @@ meta_prefs_get_draggable_border_width (void)
|
||||
return draggable_border_width;
|
||||
}
|
||||
|
||||
int
|
||||
meta_prefs_get_drag_threshold (void)
|
||||
{
|
||||
return drag_threshold;
|
||||
}
|
||||
|
||||
void
|
||||
meta_prefs_set_force_fullscreen (gboolean whether)
|
||||
{
|
||||
|
@ -5534,7 +5534,7 @@ update_move (MetaWindow *window,
|
||||
* because it's about the right size
|
||||
*/
|
||||
#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
|
||||
shake_threshold = meta_ui_get_drag_threshold (window->screen->ui) *
|
||||
shake_threshold = meta_prefs_get_drag_threshold () *
|
||||
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
|
||||
|
||||
if (snap)
|
||||
@ -5726,7 +5726,7 @@ check_resize_unmaximize(MetaWindow *window,
|
||||
|
||||
#define DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR 3
|
||||
|
||||
threshold = meta_ui_get_drag_threshold (window->screen->ui) *
|
||||
threshold = meta_prefs_get_drag_threshold () *
|
||||
DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR;
|
||||
new_unmaximize = 0;
|
||||
|
||||
|
@ -102,7 +102,8 @@ typedef enum
|
||||
META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
|
||||
META_PREF_DRAGGABLE_BORDER_WIDTH,
|
||||
META_PREF_AUTO_MAXIMIZE,
|
||||
META_PREF_CENTER_NEW_WINDOWS
|
||||
META_PREF_CENTER_NEW_WINDOWS,
|
||||
META_PREF_DRAG_THRESHOLD,
|
||||
} MetaPreference;
|
||||
|
||||
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
|
||||
@ -166,6 +167,7 @@ void meta_prefs_set_force_fullscreen (gboolean whether);
|
||||
gboolean meta_prefs_get_workspaces_only_on_primary (void);
|
||||
|
||||
int meta_prefs_get_draggable_border_width (void);
|
||||
int meta_prefs_get_drag_threshold (void);
|
||||
|
||||
gboolean meta_prefs_get_ignore_request_hide_titlebar (void);
|
||||
void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether);
|
||||
|
14
src/ui/ui.c
14
src/ui/ui.c
@ -654,20 +654,6 @@ meta_ui_window_is_widget (MetaUI *ui,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
meta_ui_get_drag_threshold (MetaUI *ui)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
int threshold;
|
||||
|
||||
settings = gtk_widget_get_settings (GTK_WIDGET (ui->frames));
|
||||
|
||||
threshold = 8;
|
||||
g_object_get (G_OBJECT (settings), "gtk-dnd-drag-threshold", &threshold, NULL);
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
MetaUIDirection
|
||||
meta_ui_get_direction (void)
|
||||
{
|
||||
|
@ -123,8 +123,6 @@ gboolean meta_ui_have_a_theme (void);
|
||||
gboolean meta_ui_window_is_widget (MetaUI *ui,
|
||||
Window xwindow);
|
||||
|
||||
int meta_ui_get_drag_threshold (MetaUI *ui);
|
||||
|
||||
MetaUIDirection meta_ui_get_direction (void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user