diff options
author | Luke from DC <[email protected]> | 2023-07-08 17:10:25 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-07-08 19:10:25 +0200 |
commit | c1b2e7798670cc795979090023d1b9dcb2a0b330 (patch) | |
tree | 632a206d3501fd48f0e1d1af709b0c4054c49c84 /eel/eel-gtk-extensions.c | |
parent | df25aef7d386d3bf8da08ec5d8dd9e44c9b09e50 (diff) | |
download | caja-c1b2e7798670cc795979090023d1b9dcb2a0b330.tar.bz2 caja-c1b2e7798670cc795979090023d1b9dcb2a0b330.tar.xz |
wayland: initial support for showing the desktop
* Wayland: Support rendering the desktop
*Wayland support is optional via the --enable-wayland option
* eel-editable-label-c: remove unused variable
This was leftover from earlier code compatable only with x11
* Fix gtk-layer-shell-0 version check, improve error message when Wayland requested but not found
Diffstat (limited to 'eel/eel-gtk-extensions.c')
-rw-r--r-- | eel/eel-gtk-extensions.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c index 21c3c358..a36c579e 100644 --- a/eel/eel-gtk-extensions.c +++ b/eel/eel-gtk-extensions.c @@ -93,23 +93,27 @@ sanity_check_window_position (int *left, int *top) * that it might be obscured by the panel. * */ - root_window = gdk_screen_get_root_window (gdk_screen_get_default()); display = gdk_display_get_default (); - gdk_monitor_get_workarea(gdk_display_get_monitor_at_window (display, root_window), &workarea); - *top = CLAMP (*top, 0, workarea.height - MINIMUM_ON_SCREEN_HEIGHT); - - /* FIXME bugzilla.eazel.com 669: - * If window has negative left coordinate, set_uposition sends it - * somewhere else entirely. Not sure what level contains this bug (XWindows?). - * Hacked around by pinning the left edge to zero, which just means you - * can't set a window to be partly off the left of the screen using - * this routine. - */ - /* Make sure the left edge of the window isn't off the right edge of - * the screen, or so close to the right edge that it might be - * obscured by the panel. - */ - *left = CLAMP (*left, 0, workarea.width - MINIMUM_ON_SCREEN_WIDTH); + /*This is x11 only, there is no root window in wayland*/ + if (GDK_IS_X11_DISPLAY (display)) + { + root_window = gdk_screen_get_root_window (gdk_screen_get_default()); + gdk_monitor_get_workarea(gdk_display_get_monitor_at_window (display, root_window), &workarea); + *top = CLAMP (*top, 0, workarea.height - MINIMUM_ON_SCREEN_HEIGHT); + + /* FIXME bugzilla.eazel.com 669: + * If window has negative left coordinate, set_uposition sends it + * somewhere else entirely. Not sure what level contains this bug (XWindows?). + * Hacked around by pinning the left edge to zero, which just means you + * can't set a window to be partly off the left of the screen using + * this routine. + */ + /* Make sure the left edge of the window isn't off the right edge of + * the screen, or so close to the right edge that it might be + * obscured by the panel. + */ + *left = CLAMP (*left, 0, workarea.width - MINIMUM_ON_SCREEN_WIDTH); + } } static void |