diff options
author | ZenWalker <[email protected]> | 2017-08-15 02:42:58 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2017-08-15 02:42:58 +0200 |
commit | 75e8b85cc1985066d3a0f4e2e85536df45b2e339 (patch) | |
tree | 1ee554ce0079d01824c25f0f182941a09503c732 /test | |
parent | 854356d2f21bbdd8a45093f360782339d5edb468 (diff) | |
download | libmatekbd-75e8b85cc1985066d3a0f4e2e85536df45b2e339.tar.bz2 libmatekbd-75e8b85cc1985066d3a0f4e2e85536df45b2e339.tar.xz |
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated:
gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_at_point
Diffstat (limited to 'test')
-rw-r--r-- | test/matekbd-keyboard-drawing-test.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/matekbd-keyboard-drawing-test.c b/test/matekbd-keyboard-drawing-test.c index 0f489ba..aaea743 100644 --- a/test/matekbd-keyboard-drawing-test.c +++ b/test/matekbd-keyboard-drawing-test.c @@ -161,7 +161,11 @@ main (gint argc, gchar ** argv) GtkWidget *window; GtkWidget *matekbd_keyboard_drawing; GdkScreen *screen; +#if GTK_CHECK_VERSION (3, 22, 0) + GdkMonitor *monitor; +#else gint monitor; +#endif GdkRectangle rect; GOptionContext *context; GError *error = NULL; @@ -204,8 +208,13 @@ main (gint argc, gchar ** argv) G_CALLBACK (gtk_main_quit), NULL); screen = gtk_window_get_screen (GTK_WINDOW (window)); +#if GTK_CHECK_VERSION (3, 22, 0) + monitor = gdk_display_get_monitor_at_point (gdk_screen_get_display (screen), 0, 0); + gdk_monitor_get_geometry (monitor, &rect); +#else monitor = gdk_screen_get_monitor_at_point (screen, 0, 0); gdk_screen_get_monitor_geometry (screen, monitor, &rect); +#endif gtk_window_set_default_size (GTK_WINDOW (window), rect.width * 4 / 5, rect.height * 1 / 2); |