diff --git a/lib/screenshooter-utils.c b/lib/screenshooter-utils.c index 53fb83de4188da0378bc27583b36ad4af43d44db..1892d1f4ddb3f86900968a769b2ecc7a10b81ffc 100644 --- a/lib/screenshooter-utils.c +++ b/lib/screenshooter-utils.c @@ -22,6 +22,9 @@ #include <glib/gstdio.h> #include <libxfce4ui/libxfce4ui.h> +#ifdef ENABLE_WAYLAND +#include <gdk/gdkwayland.h> +#endif /* Internals */ @@ -198,6 +201,14 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd) sd->show_in_folder = show_in_folder; sd->custom_action_command = last_custom_action_command; + /* Under Wayland force FULLSCREEN region */ +#ifdef ENABLE_WAYLAND + if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + { + sd->region = FULLSCREEN; + } +#endif + /* Check if the screenshot directory read from the preferences is valid */ if (G_UNLIKELY (!screenshooter_is_directory_writable (sd->screenshot_dir))) { diff --git a/panel-plugin/screenshooter-plugin.c b/panel-plugin/screenshooter-plugin.c index acb5c037e51f46fde60991f95ae8e93a926f16ec..e1169d0fec3d2df3e427cec7ccbb3ed7c65a9e7f 100644 --- a/panel-plugin/screenshooter-plugin.c +++ b/panel-plugin/screenshooter-plugin.c @@ -35,6 +35,10 @@ t */ #include "libscreenshooter.h" +#ifdef ENABLE_WAYLAND +#include <gdk/gdkwayland.h> +#endif + #define SCREENSHOT_ICON_NAME "org.xfce.screenshooter" /* Struct containing all panel plugin data */ @@ -174,17 +178,39 @@ static gboolean cb_button_scrolled (GtkWidget *widget, { case GDK_SCROLL_UP: case GDK_SCROLL_RIGHT: + +#ifdef ENABLE_WAYLAND + if (!GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + { + pd->sd->region += 1; + if (pd->sd->region > SELECT) + pd->sd->region = FULLSCREEN; + } +#else pd->sd->region += 1; if (pd->sd->region > SELECT) pd->sd->region = FULLSCREEN; +#endif + set_panel_button_tooltip (pd); gtk_widget_trigger_tooltip_query (pd->button); return TRUE; case GDK_SCROLL_DOWN: case GDK_SCROLL_LEFT: + +#ifdef ENABLE_WAYLAND + if (!GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + { + pd->sd->region -= 1; + if (pd->sd->region == REGION_0) + pd->sd->region = SELECT; + } +#else pd->sd->region -= 1; if (pd->sd->region == REGION_0) pd->sd->region = SELECT; +#endif + set_panel_button_tooltip (pd); gtk_widget_trigger_tooltip_query (pd->button); return TRUE;