summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2020-04-22 18:23:41 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2020-04-22 13:32:31 +0000
commit342897344c252f17057b8ad8cfdd7c8cb2f3f56e (patch)
tree720b5daa4f9403d4a5cf6a7170d7c76d3f44f5d3 /src
parentf53d720c7d9199075369f085cf5a39a6b53268bc (diff)
downloadgnome-screenshot-342897344c252f17057b8ad8cfdd7c8cb2f3f56e.tar.gz
backend-x11: Ignore remaining deprecations
There are 2 instances of gdk_screen_width/height() and one usage of gdk_screen_get_active_window(). Since the X11 backend itself is deprecated, and fixing these would require significant effort, don't bother and just ignore the deprecations, at least this will allow to remove the flag from meson.
Diffstat (limited to 'src')
-rw-r--r--src/screenshot-backend-x11.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/screenshot-backend-x11.c b/src/screenshot-backend-x11.c
index 3d858cb..990e715 100644
--- a/src/screenshot-backend-x11.c
+++ b/src/screenshot-backend-x11.c
@@ -51,8 +51,10 @@ screenshot_find_active_window (void)
GdkWindow *window;
GdkScreen *default_screen;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
default_screen = gdk_screen_get_default ();
window = gdk_screen_get_active_window (default_screen);
+G_GNUC_END_IGNORE_DEPRECATIONS
return window;
}
@@ -257,11 +259,13 @@ screenshot_fallback_get_window_rect_coords (GdkWindow *window,
y_orig = 0;
}
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (x_orig + width > gdk_screen_width ())
width = gdk_screen_width () - x_orig;
if (y_orig + height > gdk_screen_height ())
height = gdk_screen_height () - y_orig;
+G_GNUC_END_IGNORE_DEPRECATIONS
if (screenshot_coordinates_out != NULL)
{
@@ -449,11 +453,13 @@ screenshot_backend_x11_get_pixbuf (ScreenshotBackend *backend,
rec_height += real_coords.y;
}
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (screenshot_coords.x + rec_x + rec_width > gdk_screen_width ())
rec_width = gdk_screen_width () - screenshot_coords.x - rec_x;
if (screenshot_coords.y + rec_y + rec_height > gdk_screen_height ())
rec_height = gdk_screen_height () - screenshot_coords.y - rec_y;
+G_GNUC_END_IGNORE_DEPRECATIONS
/* Undo the scale factor in order to copy the pixbuf data pixel-wise */
for (y = rec_y * scale_factor; y < (rec_y + rec_height) * scale_factor; y++)