summaryrefslogtreecommitdiff
path: root/mate-panel/panel-multiscreen.c
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-02-11 07:31:27 +0100
committerWolfgang Ulbrich <[email protected]>2016-02-12 07:04:30 +0100
commita14d2b7ddde3bc2713b31e692331f74f0b5ceb68 (patch)
treec24e382ba8df420c1a9c6da42b5d8e459302fe5f /mate-panel/panel-multiscreen.c
parent217ce17fff3e4eb3670a03c3d48771a03bf3f9d9 (diff)
downloadmate-panel-a14d2b7ddde3bc2713b31e692331f74f0b5ceb68.tar.bz2
mate-panel-a14d2b7ddde3bc2713b31e692331f74f0b5ceb68.tar.xz
GTK+3: do not use deprecated n_screens
since gtk+-3.10 screen is always 1 taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=be976a0 https://git.gnome.org/browse/gnome-panel/commit/?id=272f680
Diffstat (limited to 'mate-panel/panel-multiscreen.c')
-rw-r--r--mate-panel/panel-multiscreen.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mate-panel/panel-multiscreen.c b/mate-panel/panel-multiscreen.c
index 7142b02a..10935b4e 100644
--- a/mate-panel/panel-multiscreen.c
+++ b/mate-panel/panel-multiscreen.c
@@ -417,7 +417,11 @@ panel_multiscreen_init (void)
return;
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screens = 1;
+#else
screens = gdk_display_get_n_screens (display);
+#endif
panel_multiscreen_init_randr (display);
@@ -449,10 +453,15 @@ panel_multiscreen_init (void)
void
panel_multiscreen_reinit (void)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkScreen *screen;
+ GList *toplevels, *l;
+#else
GdkDisplay *display;
GList *toplevels, *l;
int new_screens;
int i;
+#endif
if (monitors)
g_free (monitors);
@@ -465,6 +474,10 @@ panel_multiscreen_reinit (void)
g_free (geometries);
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screen = gdk_screen_get_default ();
+ g_signal_handlers_disconnect_by_func (screen, panel_multiscreen_queue_reinit, NULL);
+#else
display = gdk_display_get_default ();
/* Don't use the screens variable since in the future, we might
* want to call this function when a screen appears/disappears. */
@@ -478,6 +491,7 @@ panel_multiscreen_reinit (void)
panel_multiscreen_queue_reinit,
NULL);
}
+#endif
initialized = FALSE;
panel_multiscreen_init ();