diff options
author | William Wold <[email protected]> | 2019-06-20 04:39:17 +0000 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-23 10:12:24 +0200 |
commit | 598b3fec58b15eb2eb5e2d7bcaf0a26b2acc6afc (patch) | |
tree | ba0e122cb04f43ea88ab247abdd88dbe214ef6db | |
parent | ee2c41faa98ac00e48e16b0128e610720330e6fe (diff) | |
download | mate-panel-598b3fec58b15eb2eb5e2d7bcaf0a26b2acc6afc.tar.bz2 mate-panel-598b3fec58b15eb2eb5e2d7bcaf0a26b2acc6afc.tar.xz |
Wayland support for panel-profile.c
-rw-r--r-- | mate-panel/panel-profile.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c index 8acd96a9..b976306e 100644 --- a/mate-panel/panel-profile.c +++ b/mate-panel/panel-profile.c @@ -31,7 +31,10 @@ #include <string.h> #include <glib/gi18n.h> #include <gio/gio.h> + +#ifdef HAVE_X11 #include <gdk/gdkx.h> +#endif #include <libpanel-util/panel-list.h> #include <libmate-desktop/mate-dconf.h> @@ -571,10 +574,14 @@ panel_profile_queue_toplevel_location_change (PanelToplevel *toplevel, g_settings_delay (toplevel->queued_settings); - if (change->screen_changed) +#ifdef HAVE_X11 + if (change->screen_changed && + GDK_IS_X11_SCREEN (change->screen)) { g_settings_set_int (toplevel->queued_settings, "screen", gdk_x11_screen_get_screen_number (change->screen)); + } +#endif if (change->monitor_changed) g_settings_set_int (toplevel->queued_settings, @@ -963,6 +970,7 @@ panel_profile_create_toplevel (GdkScreen *screen) PanelOrientation orientation; int monitor; GSettings *settings; + int screen_number; g_return_if_fail (screen != NULL); @@ -973,7 +981,14 @@ panel_profile_create_toplevel (GdkScreen *screen) settings = g_settings_new_with_path (PANEL_TOPLEVEL_SCHEMA, path); g_free (path); - g_settings_set_int (settings, PANEL_TOPLEVEL_SCREEN_KEY, gdk_x11_screen_get_screen_number (screen)); + screen_number = 0; +#ifdef HAVE_X11 + if (GDK_IS_X11_SCREEN (screen)) { + screen_number = gdk_x11_screen_get_screen_number (screen); + } +#endif // HAVE_X11 + + g_settings_set_int (settings, PANEL_TOPLEVEL_SCREEN_KEY, screen_number); if (panel_profile_find_empty_spot (screen, &orientation, &monitor)) { g_settings_set_int (settings, PANEL_TOPLEVEL_MONITOR_KEY, monitor); |