diff options
author | Pablo Barciela <[email protected]> | 2017-12-18 09:39:13 +0100 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2017-12-18 10:15:10 +0100 |
commit | d6209ab657546e23b77eff5cb9860f76bc8eb5ca (patch) | |
tree | 9d7a4ffad0ecd9a65bafa0c354a9bec74ba5c68c /plugins/background/msd-background-manager.c | |
parent | 788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c (diff) | |
download | mate-settings-daemon-d6209ab657546e23b77eff5cb9860f76bc8eb5ca.tar.bz2 mate-settings-daemon-d6209ab657546e23b77eff5cb9860f76bc8eb5ca.tar.xz |
WidthOfScreen and HeightOfScreen implementation
The work began with:
https://github.com/mate-desktop/mate-settings-daemon/commit/788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c
This commit reverts:
https://github.com/mate-desktop/mate-settings-daemon/commit/7f887e614812ccb86f5d784e2db58bede8daa712
And it applies an alternative to fix the deprecated functions:
gdk_screen_get_width
gdk_screen_get_height
Diffstat (limited to 'plugins/background/msd-background-manager.c')
-rw-r--r-- | plugins/background/msd-background-manager.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c index eed9302..b4eaca6 100644 --- a/plugins/background/msd-background-manager.c +++ b/plugins/background/msd-background-manager.c @@ -183,14 +183,10 @@ 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); - - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &width, &height); + gint width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)); + gint height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)); free_bg_surface (manager); p->surface = mate_bg_create_surface (p->bg, window, width, height, TRUE); @@ -254,19 +250,15 @@ 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", sc_width, sc_height); + gchar *new_size = g_strdup_printf ("%dx%d", WidthOfScreen (gdk_x11_screen_get_xscreen (screen)), + HeightOfScreen (gdk_x11_screen_get_xscreen (screen))); if (g_strcmp0 (old_size, new_size) != 0) { g_debug ("Screen%d size changed: %s -> %s", scr_num, old_size, new_size); |