summaryrefslogtreecommitdiff
path: root/plugins/background/msd-background-manager.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-08 02:14:01 +0200
committerraveit65 <[email protected]>2017-08-14 08:03:54 +0200
commit7f887e614812ccb86f5d784e2db58bede8daa712 (patch)
tree860298892997172e8a6711f33268b194881f1c17 /plugins/background/msd-background-manager.c
parentdaa0acc2088b8501c3c55134f8f21f3e853ca83d (diff)
downloadmate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.bz2
mate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'plugins/background/msd-background-manager.c')
-rw-r--r--plugins/background/msd-background-manager.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c
index de1ff34..eed9302 100644
--- a/plugins/background/msd-background-manager.c
+++ b/plugins/background/msd-background-manager.c
@@ -183,10 +183,14 @@ static void
real_draw_bg (MsdBackgroundManager *manager,
GdkScreen *screen)
{
+ gint width;
+ gint height;
+
MsdBackgroundManagerPrivate *p = manager->priv;
GdkWindow *window = gdk_screen_get_root_window (screen);
- gint width = gdk_screen_get_width (screen);
- gint height = gdk_screen_get_height (screen);
+
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &width, &height);
free_bg_surface (manager);
p->surface = mate_bg_create_surface (p->bg, window, width, height, TRUE);
@@ -250,15 +254,19 @@ static void
on_screen_size_changed (GdkScreen *screen,
MsdBackgroundManager *manager)
{
+ gint sc_width, sc_height;
+
MsdBackgroundManagerPrivate *p = manager->priv;
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &sc_width, &sc_height);
+
if (!p->msd_can_draw || p->draw_in_progress || caja_is_drawing_bg (manager))
return;
gint scr_num = gdk_x11_screen_get_screen_number (screen);
gchar *old_size = g_list_nth_data (manager->priv->scr_sizes, scr_num);
- gchar *new_size = g_strdup_printf ("%dx%d", gdk_screen_get_width (screen),
- gdk_screen_get_height (screen));
+ gchar *new_size = g_strdup_printf ("%dx%d", sc_width, sc_height);
if (g_strcmp0 (old_size, new_size) != 0)
{
g_debug ("Screen%d size changed: %s -> %s", scr_num, old_size, new_size);