diff options
author | ZenWalker <[email protected]> | 2017-08-28 03:33:41 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-28 14:15:30 +0200 |
commit | 4c130e22b98bbc1a85747adac3b582e45d34514e (patch) | |
tree | 7111b08ac8ff3ca0fc90402c692067fb8a2a5ba4 /eel | |
parent | 4ca3d658e1bb1736c96b1b2b3bda85dba43a4080 (diff) | |
download | caja-4c130e22b98bbc1a85747adac3b582e45d34514e.tar.bz2 caja-4c130e22b98bbc1a85747adac3b582e45d34514e.tar.xz |
make sure scaling the desktop wallpaper works in all monitors
Fixes #836
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-background.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/eel/eel-background.c b/eel/eel-background.c index 57e9d656..a3392c2b 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -313,10 +313,26 @@ drawable_get_adjusted_size (EelBackground *self, { #if GTK_CHECK_VERSION (3, 22, 0) GdkRectangle geometry; - gdk_monitor_get_geometry (gdk_display_get_primary_monitor (gtk_widget_get_display (self->details->widget)), - &geometry); - *width = geometry.width; - *height = geometry.height; + GdkMonitor *monitor; + GdkDisplay *display; + int n = 0; + int i = 0; + int sc_width = 0; + int sc_height = 0; + + display = gtk_widget_get_display (self->details->widget); + n = gdk_display_get_n_monitors (display); + + for (i = 0; i < n; ++i) + { + monitor = gdk_display_get_monitor (display, i); + gdk_monitor_get_geometry (monitor, &geometry); + sc_width = sc_width + geometry.width; + sc_height = sc_height + geometry.height; + } + + *width = sc_width; + *height = sc_height; #else GdkScreen *screen = gtk_widget_get_screen (self->details->widget); *width = gdk_screen_get_width (screen); |