Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-screenshooter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-screenshooter
Commits
770a53cd
Verified
Commit
770a53cd
authored
1 year ago
by
Andre Miranda
Browse files
Options
Downloads
Patches
Plain Diff
panel-plugin: Avoid selecting unsupported regions
parent
eb163f18
No related branches found
No related tags found
1 merge request
!52
Preliminary Wayland support
Pipeline
#26443
passed
1 year ago
Stage: build
Stage: distcheck
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/screenshooter-utils.c
+11
-0
11 additions, 0 deletions
lib/screenshooter-utils.c
panel-plugin/screenshooter-plugin.c
+26
-0
26 additions, 0 deletions
panel-plugin/screenshooter-plugin.c
with
37 additions
and
0 deletions
lib/screenshooter-utils.c
+
11
−
0
View file @
770a53cd
...
@@ -22,6 +22,9 @@
...
@@ -22,6 +22,9 @@
#include
<glib/gstdio.h>
#include
<glib/gstdio.h>
#include
<libxfce4ui/libxfce4ui.h>
#include
<libxfce4ui/libxfce4ui.h>
#ifdef ENABLE_WAYLAND
#include
<gdk/gdkwayland.h>
#endif
/* Internals */
/* Internals */
...
@@ -198,6 +201,14 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd)
...
@@ -198,6 +201,14 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd)
sd
->
show_in_folder
=
show_in_folder
;
sd
->
show_in_folder
=
show_in_folder
;
sd
->
custom_action_command
=
last_custom_action_command
;
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 */
/* Check if the screenshot directory read from the preferences is valid */
if
(
G_UNLIKELY
(
!
screenshooter_is_directory_writable
(
sd
->
screenshot_dir
)))
if
(
G_UNLIKELY
(
!
screenshooter_is_directory_writable
(
sd
->
screenshot_dir
)))
{
{
...
...
This diff is collapsed.
Click to expand it.
panel-plugin/screenshooter-plugin.c
+
26
−
0
View file @
770a53cd
...
@@ -35,6 +35,10 @@ t */
...
@@ -35,6 +35,10 @@ t */
#include
"libscreenshooter.h"
#include
"libscreenshooter.h"
#ifdef ENABLE_WAYLAND
#include
<gdk/gdkwayland.h>
#endif
#define SCREENSHOT_ICON_NAME "org.xfce.screenshooter"
#define SCREENSHOT_ICON_NAME "org.xfce.screenshooter"
/* Struct containing all panel plugin data */
/* Struct containing all panel plugin data */
...
@@ -174,17 +178,39 @@ static gboolean cb_button_scrolled (GtkWidget *widget,
...
@@ -174,17 +178,39 @@ static gboolean cb_button_scrolled (GtkWidget *widget,
{
{
case
GDK_SCROLL_UP
:
case
GDK_SCROLL_UP
:
case
GDK_SCROLL_RIGHT
:
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
;
pd
->
sd
->
region
+=
1
;
if
(
pd
->
sd
->
region
>
SELECT
)
if
(
pd
->
sd
->
region
>
SELECT
)
pd
->
sd
->
region
=
FULLSCREEN
;
pd
->
sd
->
region
=
FULLSCREEN
;
#endif
set_panel_button_tooltip
(
pd
);
set_panel_button_tooltip
(
pd
);
gtk_widget_trigger_tooltip_query
(
pd
->
button
);
gtk_widget_trigger_tooltip_query
(
pd
->
button
);
return
TRUE
;
return
TRUE
;
case
GDK_SCROLL_DOWN
:
case
GDK_SCROLL_DOWN
:
case
GDK_SCROLL_LEFT
:
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
;
pd
->
sd
->
region
-=
1
;
if
(
pd
->
sd
->
region
==
REGION_0
)
if
(
pd
->
sd
->
region
==
REGION_0
)
pd
->
sd
->
region
=
SELECT
;
pd
->
sd
->
region
=
SELECT
;
#endif
set_panel_button_tooltip
(
pd
);
set_panel_button_tooltip
(
pd
);
gtk_widget_trigger_tooltip_query
(
pd
->
button
);
gtk_widget_trigger_tooltip_query
(
pd
->
button
);
return
TRUE
;
return
TRUE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment