Fix cursor size update on non-wayland

This commit is contained in:
Armin Krezović 2017-08-27 21:04:14 +02:00 committed by Jonas Ådahl
parent 114bfc04ef
commit 25fd9e005b
3 changed files with 14 additions and 13 deletions

View File

@ -36,6 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "keybindings-private.h" #include "keybindings-private.h"
#include "meta-accel-parse.h" #include "meta-accel-parse.h"
#include "x11/meta-x11-display-private.h"
/* If you add a key, it needs updating in init() and in the gsettings /* If you add a key, it needs updating in init() and in the gsettings
* notify listener and of course in the .schemas file. * notify listener and of course in the .schemas file.
@ -137,9 +138,6 @@ static void bindings_changed (GSettings *settings,
gchar *key, gchar *key,
gpointer data); gpointer data);
static void update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size (void); static void update_cursor_size (void);
static void queue_changed (MetaPreference pref); static void queue_changed (MetaPreference pref);
@ -156,7 +154,6 @@ static void do_override (char *key, char *schema);
static void init_bindings (void); static void init_bindings (void);
typedef struct typedef struct
{ {
MetaPrefsChangedFunc func; MetaPrefsChangedFunc func;
@ -972,10 +969,6 @@ meta_prefs_init (void)
G_CALLBACK (wayland_settings_changed), NULL); G_CALLBACK (wayland_settings_changed), NULL);
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings); g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
if (!meta_is_wayland_compositor ())
g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
G_CALLBACK (update_cursor_size_from_gtk), NULL);
settings = g_settings_new (SCHEMA_INPUT_SOURCES); settings = g_settings_new (SCHEMA_INPUT_SOURCES);
g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS, g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
G_CALLBACK (settings_changed), NULL); G_CALLBACK (settings_changed), NULL);
@ -1225,13 +1218,9 @@ update_cursor_size (void)
cursor_size = cursor_size =
g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size"); g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size");
} }
else
{
update_cursor_size_from_gtk (gtk_settings_get_default (), NULL, NULL);
}
} }
static void void
update_cursor_size_from_gtk (GtkSettings *settings, update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec, GParamSpec *pspec,
gpointer data) gpointer data)

View File

@ -209,4 +209,8 @@ MetaLogicalMonitor *meta_x11_display_xinerama_index_to_logical_monitor (MetaX11D
void meta_x11_display_update_workspace_layout (MetaX11Display *x11_display); void meta_x11_display_update_workspace_layout (MetaX11Display *x11_display);
void meta_x11_display_update_workspace_names (MetaX11Display *x11_display); void meta_x11_display_update_workspace_names (MetaX11Display *x11_display);
void update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
#endif /* META_X11_DISPLAY_PRIVATE_H */ #endif /* META_X11_DISPLAY_PRIVATE_H */

View File

@ -1317,6 +1317,14 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
set_x11_bell_is_audible (x11_display, meta_prefs_bell_is_audible ()); set_x11_bell_is_audible (x11_display, meta_prefs_bell_is_audible ());
if (!meta_is_wayland_compositor ())
{
update_cursor_size_from_gtk (gtk_settings_get_default (), NULL, NULL);
g_signal_connect_object (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
G_CALLBACK (update_cursor_size_from_gtk), NULL, 0);
}
return x11_display; return x11_display;
} }