summaryrefslogtreecommitdiff
path: root/eel/eel-background.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2023-05-17 23:00:54 -0400
committerLuke from DC <[email protected]>2023-05-25 18:56:56 +0000
commit5688856331109e77d7362f5665fb178d1c269a39 (patch)
tree0f5b0b001fe68c5a5d5eab57e5c38cb3fa540546 /eel/eel-background.c
parent99a1e2a20567cbe988006d0fdfef6abab6324dc2 (diff)
downloadcaja-5688856331109e77d7362f5665fb178d1c269a39.tar.bz2
caja-5688856331109e77d7362f5665fb178d1c269a39.tar.xz
Initial wayland support
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
{