[gnome-screenshot/wip/exalm/refactor: 11/12] backend-x11: Ignore remaining deprecations
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot/wip/exalm/refactor: 11/12] backend-x11: Ignore remaining deprecations
- Date: Wed, 22 Apr 2020 13:27:02 +0000 (UTC)
commit 19cb98db4b8aa8fb636f82cf2e093c57e6d1e737
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Apr 22 18:23:41 2020 +0500
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.
src/screenshot-backend-x11.c | 6 ++++++
1 file changed, 6 insertions(+)
---
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++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]