summaryrefslogtreecommitdiff
path: root/eel/eel-background.c
diff options
context:
space:
mode:
Diffstat (limited to 'eel/eel-background.c')
-rw-r--r--eel/eel-background.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/eel/eel-background.c b/eel/eel-background.c
index ae585d6a..5b00f849 100644
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -311,9 +311,20 @@ drawable_get_adjusted_size (EelBackground *self,
if (self->details->is_desktop)
{
GdkScreen *screen = gtk_widget_get_screen (self->details->widget);
- gint scale = gtk_widget_get_scale_factor (self->details->widget);
- *width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
- *height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+ GdkDisplay *display = gdk_screen_get_display (screen);
+ if (GDK_IS_X11_DISPLAY (display))
+ {
+ gint scale = gtk_widget_get_scale_factor (self->details->widget);
+ *width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+ *height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+ }
+ else {
+ GdkRectangle workarea = {0};
+ gdk_monitor_get_workarea(gdk_display_get_monitor_at_window(gdk_display_get_default(),
+ gtk_widget_get_window (self->details->widget)), &workarea);
+ *width = workarea.width;
+ *height = workarea.height;
+ }
}
else
{