x11-display: Set the correct default Xcursor theme size

Under Xorg the cursor size preference was pre-scaled originating from
gtk, while with Wayland it came directly from GSettings remaining
unscaled. Under Xwayland this caused the X11 display code to set the
wrong size with HiDPI configurations, which was often later overridden
by the equivalent code in gtk, but not always.

Fix this by always having the cursor size preference unscaled, scaling
the size correctly where it's used, depending on how it's used.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
Jonas Ådahl
2018-07-06 19:22:26 +02:00
parent 81c1c70c0a
commit e2464660bc
3 changed files with 30 additions and 75 deletions

View File

@@ -676,6 +676,13 @@ on_startup_notification_changed (MetaStartupNotification *sn,
g_signal_emit_by_name (display, "startup-sequence-changed", sequence);
}
static void
on_ui_scaling_factor_changed (MetaSettings *settings,
MetaDisplay *display)
{
meta_display_reload_cursor (display);
}
/**
* meta_display_open:
*
@@ -697,6 +704,7 @@ meta_display_open (void)
Window old_active_xwindow = None;
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager;
MetaSettings *settings;
g_assert (the_display == NULL);
display = the_display = g_object_new (META_TYPE_DISPLAY, NULL);
@@ -755,6 +763,10 @@ meta_display_open (void)
g_signal_connect (monitor_manager, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed_internal), display);
settings = meta_backend_get_settings (backend);
g_signal_connect (settings, "ui-scaling-factor-changed",
G_CALLBACK (on_ui_scaling_factor_changed), display);
meta_display_set_cursor (display, META_CURSOR_DEFAULT);
display->stack = meta_stack_new (display);