summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2020-04-03 03:20:54 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2020-04-03 03:36:12 +0500
commit06b307b45b8aa79add8daa4c1a5b8cdc6451a088 (patch)
tree8ef1728814f84f23cbb9e6d959078213a803ca0d /src
parent76af9c5b41ae1d4a32a774302401f48c29692587 (diff)
downloadgnome-screenshot-06b307b45b8aa79add8daa4c1a5b8cdc6451a088.tar.gz
Remove support for removing window border
All Wayland applications are using client-side decorations. Even on X11, most GNOME applications are using them, so this option doesn't have any effects in majority of cases. Since !7, it's not exposed in GUI either. To simplify the code, just remove it. Deprecate --include-border and --remove-border CLI options, print a warning when they are in use. Update the manpage. Remove the corresponding gsettings key.
Diffstat (limited to 'src')
-rw-r--r--src/screenshot-application.c4
-rw-r--r--src/screenshot-config.c19
-rw-r--r--src/screenshot-config.h1
-rw-r--r--src/screenshot-utils.c26
4 files changed, 14 insertions, 36 deletions
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index b7fa93c..11c367c 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -609,8 +609,8 @@ static const GOptionEntry entries[] = {
{ "clipboard", 'c', 0, G_OPTION_ARG_NONE, NULL, N_("Send the grab directly to the clipboard"), NULL },
{ "window", 'w', 0, G_OPTION_ARG_NONE, NULL, N_("Grab a window instead of the entire screen"), NULL },
{ "area", 'a', 0, G_OPTION_ARG_NONE, NULL, N_("Grab an area of the screen instead of the entire screen"), NULL },
- { "include-border", 'b', 0, G_OPTION_ARG_NONE, NULL, N_("Include the window border with the screenshot"), NULL },
- { "remove-border", 'B', 0, G_OPTION_ARG_NONE, NULL, N_("Remove the window border from the screenshot"), NULL },
+ { "include-border", 'b', 0, G_OPTION_ARG_NONE, NULL, N_("Include the window border with the screenshot. This option is deprecated and window border is always included"), NULL },
+ { "remove-border", 'B', 0, G_OPTION_ARG_NONE, NULL, N_("Remove the window border from the screenshot. This option is deprecated and window border is always included"), NULL },
{ "include-pointer", 'p', 0, G_OPTION_ARG_NONE, NULL, N_("Include the pointer with the screenshot"), NULL },
{ "delay", 'd', 0, G_OPTION_ARG_INT, NULL, N_("Take screenshot after specified delay [in seconds]"), N_("seconds") },
{ "border-effect", 'e', 0, G_OPTION_ARG_STRING, NULL, N_("Effect to add to the border (shadow, border, vintage or none)"), N_("effect") },
diff --git a/src/screenshot-config.c b/src/screenshot-config.c
index 62fd2cc..3852d0e 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -28,7 +28,6 @@
#define BORDER_EFFECT_KEY "border-effect"
#define DELAY_KEY "delay"
-#define INCLUDE_BORDER_KEY "include-border"
#define INCLUDE_POINTER_KEY "include-pointer"
#define INCLUDE_ICC_PROFILE "include-icc-profile"
#define AUTO_SAVE_DIRECTORY_KEY "auto-save-directory"
@@ -51,9 +50,6 @@ screenshot_load_config (void)
config->delay =
g_settings_get_int (config->settings,
DELAY_KEY);
- config->include_border =
- g_settings_get_boolean (config->settings,
- INCLUDE_BORDER_KEY);
config->include_pointer =
g_settings_get_boolean (config->settings,
INCLUDE_POINTER_KEY);
@@ -90,8 +86,6 @@ screenshot_save_config (void)
return;
g_settings_set_boolean (c->settings,
- INCLUDE_BORDER_KEY, c->include_border);
- g_settings_set_boolean (c->settings,
INCLUDE_POINTER_KEY, c->include_pointer);
g_settings_set_string (c->settings,
BORDER_EFFECT_KEY, c->border_effect);
@@ -121,6 +115,13 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
screenshot_config->interactive = interactive_arg;
+ if (include_border_arg)
+ g_warning ("Option --include-border is deprecated and will be removed in "
+ "gnome-screenshot 3.38.0. Window border is always included.");
+ if (disable_border_arg)
+ g_warning ("Option --remove-border is deprecated and will be removed in "
+ "gnome-screenshot 3.38.0. Window border is always included.");
+
if (screenshot_config->interactive)
{
if (clipboard_arg)
@@ -132,10 +133,6 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
if (delay_arg > 0)
screenshot_config->delay = delay_arg;
- if (include_border_arg)
- screenshot_config->include_border = TRUE;
- if (disable_border_arg)
- screenshot_config->include_border = FALSE;
g_free (screenshot_config->border_effect);
screenshot_config->border_effect = g_strdup ("none");
@@ -148,8 +145,6 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
AUTO_SAVE_DIRECTORY_KEY);
screenshot_config->delay = delay_arg;
- screenshot_config->include_border = include_border_arg;
- screenshot_config->include_border = !disable_border_arg;
screenshot_config->include_pointer = include_pointer_arg;
screenshot_config->copy_to_clipboard = clipboard_arg;
if (file_arg != NULL)
diff --git a/src/screenshot-config.h b/src/screenshot-config.h
index f765aaf..d7175c3 100644
--- a/src/screenshot-config.h
+++ b/src/screenshot-config.h
@@ -39,7 +39,6 @@ typedef struct {
gboolean include_pointer;
gboolean include_icc_profile;
- gboolean include_border;
gchar *border_effect;
guint delay;
diff --git a/src/screenshot-utils.c b/src/screenshot-utils.c
index 9ad46c5..f8dab9b 100644
--- a/src/screenshot-utils.c
+++ b/src/screenshot-utils.c
@@ -223,8 +223,7 @@ mask_monitors (GdkPixbuf *pixbuf, GdkWindow *root_window)
}
static void
-screenshot_fallback_get_window_rect_coords (GdkWindow *window,
- gboolean include_border,
+screenshot_fallback_get_window_rect_coords (GdkWindow *window,
GdkRectangle *real_coordinates_out,
GdkRectangle *screenshot_coordinates_out)
{
@@ -232,17 +231,7 @@ screenshot_fallback_get_window_rect_coords (GdkWindow *window,
gint width, height;
GdkRectangle real_coordinates;
- if (include_border)
- {
- gdk_window_get_frame_extents (window, &real_coordinates);
- }
- else
- {
- real_coordinates.width = gdk_window_get_width (window);
- real_coordinates.height = gdk_window_get_height (window);
-
- gdk_window_get_origin (window, &real_coordinates.x, &real_coordinates.y);
- }
+ gdk_window_get_frame_extents (window, &real_coordinates);
x_orig = real_coordinates.x;
y_orig = real_coordinates.y;
@@ -324,10 +313,7 @@ screenshot_fallback_fire_flash (GdkWindow *window,
if (rectangle != NULL)
rect = *rectangle;
else
- screenshot_fallback_get_window_rect_coords (window,
- screenshot_config->include_border,
- NULL,
- &rect);
+ screenshot_fallback_get_window_rect_coords (window, NULL, &rect);
flash = cheese_flash_new ();
cheese_flash_fire (flash, &rect);
@@ -397,7 +383,6 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
window = screenshot_fallback_find_current_window ();
screenshot_fallback_get_window_rect_coords (window,
- screenshot_config->include_border,
&real_coords,
&screenshot_coords);
@@ -410,7 +395,6 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
(gdk_window_get_display (window), wm);
screenshot_fallback_get_window_rect_coords (wm_window,
- FALSE,
&wm_real_coords,
NULL);
@@ -438,7 +422,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
mask_monitors (screenshot, root);
#ifdef HAVE_X11_EXTENSIONS_SHAPE_H
- if (screenshot_config->include_border && (wm != None))
+ if (wm != None)
{
XRectangle *rectangles;
int rectangle_count, rectangle_order, i;
@@ -615,7 +599,7 @@ screenshot_shell_get_pixbuf (GdkRectangle *rectangle)
{
method_name = "ScreenshotWindow";
method_params = g_variant_new ("(bbbs)",
- screenshot_config->include_border,
+ TRUE,
screenshot_config->include_pointer,
TRUE, /* flash */
filename);