summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-07-31 03:35:38 +0200
committerZenWalker <[email protected]>2017-07-31 03:35:38 +0200
commitd5fa1884a1bcd93235f36b06bcc00a4c3646554d (patch)
tree265ca3dfd64c0d2e3f87e30aadde332c138e260e /mate-panel
parent33c4bd47a7210cd9e695ea1a2cbf26abbc3b7bed (diff)
downloadmate-panel-d5fa1884a1bcd93235f36b06bcc00a4c3646554d.tar.bz2
mate-panel-d5fa1884a1bcd93235f36b06bcc00a4c3646554d.tar.xz
avoid deprecated gdk_display_get_screen
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/panel-multiscreen.c29
-rw-r--r--mate-panel/panel-profile.c5
2 files changed, 15 insertions, 19 deletions
diff --git a/mate-panel/panel-multiscreen.c b/mate-panel/panel-multiscreen.c
index 7c6df59f..afe8c24e 100644
--- a/mate-panel/panel-multiscreen.c
+++ b/mate-panel/panel-multiscreen.c
@@ -404,7 +404,6 @@ void
panel_multiscreen_init (void)
{
GdkDisplay *display;
- int i;
if (initialized)
return;
@@ -417,24 +416,22 @@ panel_multiscreen_init (void)
monitors = g_new0 (int, screens);
geometries = g_new0 (GdkRectangle *, screens);
- for (i = 0; i < screens; i++) {
- GdkScreen *screen;
+ GdkScreen *screen;
- screen = gdk_display_get_screen (display, i);
+ screen = gdk_display_get_default_screen (display);
- /* We connect to both signals to be on the safe side, but in
- * theory, it should be enough to only connect to
- * monitors-changed. Since we'll likely get two signals, we do
- * the real callback in the idle loop. */
- g_signal_connect (screen, "size-changed",
- G_CALLBACK (panel_multiscreen_queue_reinit), NULL);
- g_signal_connect (screen, "monitors-changed",
- G_CALLBACK (panel_multiscreen_queue_reinit), NULL);
+ /* We connect to both signals to be on the safe side, but in
+ * theory, it should be enough to only connect to
+ * monitors-changed. Since we'll likely get two signals, we do
+ * the real callback in the idle loop. */
+ g_signal_connect (screen, "size-changed",
+ G_CALLBACK (panel_multiscreen_queue_reinit), NULL);
+ g_signal_connect (screen, "monitors-changed",
+ G_CALLBACK (panel_multiscreen_queue_reinit), NULL);
- panel_multiscreen_get_monitors_for_screen (screen,
- &(monitors[i]),
- &(geometries[i]));
- }
+ panel_multiscreen_get_monitors_for_screen (screen,
+ &(monitors[0]),
+ &(geometries[0]));
initialized = TRUE;
}
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index 7f5aea06..41e1dba6 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -775,9 +775,8 @@ panel_profile_toplevel_change_notify (GSettings *settings,
if (!strcmp (key, "screen")) {
GdkScreen *screen;
- screen = gdk_display_get_screen (
- gdk_display_get_default (),
- g_settings_get_int (settings, key));
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
+
if (screen)
gtk_window_set_screen (GTK_WINDOW (toplevel), screen);
else