[Spice-commits] 3 commits - configure.ac src/spice-gtk-session.c src/spice-widget.c src/spice-widget-egl.c src/vncdisplaykeymap.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 24 15:19:09 UTC 2018


 configure.ac            |   16 +-------
 src/spice-gtk-session.c |   44 +---------------------
 src/spice-widget-egl.c  |    6 ---
 src/spice-widget.c      |   93 +++++++++---------------------------------------
 src/vncdisplaykeymap.c  |    4 +-
 5 files changed, 26 insertions(+), 137 deletions(-)

New commits:
commit 3cdcc5a888fcf59199d7551d4bb32ab11ba11a4b
Author: Victor Toso <me at victortoso.com>
Date:   Fri Jul 20 17:07:57 2018 +0200

    gtk-deprecated: Avoid gdk_screen_get_width/height()
    
    As those were deprecated in favor of fetching for information directly
    with GdkMonitor.
    
    Warnings fixed:
     | spice-widget.c: In function ‘mouse_wrap’:
     | spice-widget.c:1136:5: warning: ‘gdk_screen_get_width’ is deprecated
     |
     |     xr = gdk_screen_get_width(screen) / 2;
     |     ^~
     |
     | spice-widget.c:1137:5: warning: ‘gdk_screen_get_height’ is deprecated
     |
     |     yr = gdk_screen_get_height(screen) / 2;
     |     ^~
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/spice-widget.c b/src/spice-widget.c
index ce123bd..ec8b61b 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1120,16 +1120,22 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion)
     d->mouse_last_x = -1;
     d->mouse_last_y = -1;
 #else
-    GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(display));
-    xr = gdk_screen_get_width(screen) / 2;
-    yr = gdk_screen_get_height(screen) / 2;
+    GdkRectangle geom;
+    GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(display));
+    GdkDisplay *gdk_display = gdk_window_get_display(gdk_window);
+    GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display);
+    gdk_monitor_get_geometry(monitor, &geom);
+
+    xr = geom.width / 2;
+    yr = geom.height / 2;
 
     if (xr != (gint)motion->x_root || yr != (gint)motion->y_root) {
-        GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
         /* FIXME: we try our best to ignore that next pointer move event.. */
-        gdk_display_sync(gdk_screen_get_display(screen));
+        gdk_display_sync(gdk_display);
 
-        gdk_device_warp(spice_gdk_window_get_pointing_device(window), screen, xr, yr);
+        gdk_device_warp(spice_gdk_window_get_pointing_device(gdk_window),
+                        gdk_window_get_screen(gdk_window),
+                        xr, yr);
         d->mouse_last_x = -1;
         d->mouse_last_y = -1;
     }
commit d98a684fe6ea47511d29386e1323d82737a2faf0
Author: Victor Toso <me at victortoso.com>
Date:   Fri Jul 20 16:04:37 2018 +0200

    gtk-deprecated: Use gdk_keymap_get_for_display()
    
    As gdk_keymap_get_default() was deprecated in 3.22
    
    Warnings fixed:
     | vncdisplaykeymap.c: In function ‘vnc_display_keyval_set_entries’:
     | vncdisplaykeymap.c:263:4: warning: ‘gdk_keymap_get_default’ is
     | deprecated: Use 'gdk_keymap_get_for_display' instead
     |
     |     gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
     |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |
     | spice-gtk-session.c: In function ‘spice_gtk_session_init’:
     | spice-gtk-session.c:181:5: warning: ‘gdk_keymap_get_default’ is
     | deprecated: Use 'gdk_keymap_get_for_display' instead
     |
     |     GdkKeymap *keymap = gdk_keymap_get_default();
     |     ^~~~~~~~~
     |
     | spice-widget.c: In function ‘get_scancode_from_keyval’:
     | spice-widget.c:1731:5: warning: ‘gdk_keymap_get_default’ is
     | deprecated: Use 'gdk_keymap_get_for_display' instead
     |
     |      if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
     |      ^~
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 3d8973e..4b5f7a2 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -120,8 +120,7 @@ static guint32 get_keyboard_lock_modifiers(void)
 {
     guint32 modifiers = 0;
 /* Ignore GLib's too-new warnings */
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-    GdkKeymap *keyboard = gdk_keymap_get_default();
+    GdkKeymap *keyboard = gdk_keymap_get_for_display(gdk_display_get_default());
 
     if (gdk_keymap_get_caps_lock_state(keyboard)) {
         modifiers |= SPICE_INPUTS_CAPS_LOCK;
@@ -134,7 +133,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     if (gdk_keymap_get_scroll_lock_state(keyboard)) {
         modifiers |= SPICE_INPUTS_SCROLL_LOCK;
     }
-G_GNUC_END_IGNORE_DEPRECATIONS
     return modifiers;
 }
 
@@ -178,7 +176,7 @@ static void guest_modifiers_changed(SpiceInputsChannel *inputs, gpointer data)
 static void spice_gtk_session_init(SpiceGtkSession *self)
 {
     SpiceGtkSessionPrivate *s;
-    GdkKeymap *keymap = gdk_keymap_get_default();
+    GdkKeymap *keymap = gdk_keymap_get_for_display(gdk_display_get_default());
 
     s = self->priv = spice_gtk_session_get_instance_private(self);
 
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 8d93384..ce123bd 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1699,9 +1699,9 @@ static guint get_scancode_from_keyval(SpiceDisplay *display, guint keyval)
     guint keycode = 0;
     GdkKeymapKey *keys = NULL;
     gint n_keys = 0;
+    GdkKeymap *keymap = gdk_keymap_get_for_display(gdk_display_get_default());
 
-    if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
-                                          keyval, &keys, &n_keys)) {
+    if (gdk_keymap_get_entries_for_keyval(keymap, keyval, &keys, &n_keys)) {
         /* FIXME what about levels? */
         keycode = keys[0].keycode;
         g_free(keys);
diff --git a/src/vncdisplaykeymap.c b/src/vncdisplaykeymap.c
index 86cc6bd..e1a16aa 100644
--- a/src/vncdisplaykeymap.c
+++ b/src/vncdisplaykeymap.c
@@ -258,9 +258,11 @@ guint16 vnc_display_keymap_gdk2xtkbd(const guint16 *keycode_map,
 void vnc_display_keyval_set_entries(void)
 {
 	size_t i;
+	GdkKeymap *keymap = gdk_keymap_get_for_display(gdk_display_get_default());
+
 	if (ref_count_for_untranslated_keys == 0)
 		for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)
-			gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
+			gdk_keymap_get_entries_for_keyval(keymap,
 							  untranslated_keys[i].keyval,
 							  &untranslated_keys[i].keys,
 							  &untranslated_keys[i].n_keys);
commit a1fd9ee1c6808ed560c3899e8add84c5761e21fd
Author: Victor Toso <me at victortoso.com>
Date:   Fri Jul 20 12:48:50 2018 +0200

    build-sys: bump gtk requirement 3.12 -> 3.22
    
    Fedora 28: 3.22.30
    Fedora 27: 3.22.26
    Fedora 26: 3.22.21
    RHEL 7.6: 3.22.30
    RHEL 7.5: 3.22.26
    RHEL 7.4: 3.22.10
    Debian 10: 3.22.30
    Debian  9: 3.22.11
    Ubuntu 18.04: 3.22.30
    Ubuntu 17.10: 3.22.24
    
    Besides cleanup the code, gtk is under heavy development to better
    work under Wayland and reducing the code path based on library version
    should be helpful as well.
    
    This patch also removes the check for gdk_event_get_scancode as it is
    included in 3.22.
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/configure.ac b/configure.ac
index 1cc3000..6ddfa4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,8 +130,8 @@ AC_ARG_WITH([gtk],
   [with_gtk=3.0])
 
 case "$with_gtk" in
-  3.0) GTK_REQUIRED=3.12
-       GTK_ENCODED_VERSION="GDK_VERSION_3_12"
+  3.0) GTK_REQUIRED=3.22
+       GTK_ENCODED_VERSION="GDK_VERSION_3_22"
        ;;
   no)
        AS_IF([test x$enable_gtk_doc = xyes],
@@ -149,18 +149,6 @@ AS_IF([test "x$with_gtk" != "xno"],
                                -DGDK_VERSION_MAX_ALLOWED=$GTK_ENCODED_VERSION"])
 SPICE_GTK_REQUIRES="${SPICE_GTK_REQUIRES} gtk+-3.0 >= $GTK_REQUIRED"
 
-# Check for gdk_event_get_scancode function
-# This was added in Gdk 3.22
-# The check allows the usage of the function in case the function is
-# backported or in case of compilation from Gdk master branch
-old_LIBS="$LIBS"
-old_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $GTK_CFLAGS"
-LIBS="$LIBS $GTK_LIBS"
-AC_CHECK_FUNCS(gdk_event_get_scancode)
-LIBS="$old_LIBS"
-CFLAGS="$old_CFLAGS"
-
 PKG_CHECK_EXISTS([gtk+-x11-$with_gtk], [PKG_CHECK_MODULES(X11, x11)])
 AC_CHECK_HEADERS([X11/XKBlib.h])
 
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 705498a..3d8973e 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -119,7 +119,6 @@ enum {
 static guint32 get_keyboard_lock_modifiers(void)
 {
     guint32 modifiers = 0;
-#if GTK_CHECK_VERSION(3,18,0)
 /* Ignore GLib's too-new warnings */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     GdkKeymap *keyboard = gdk_keymap_get_default();
@@ -136,43 +135,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         modifiers |= SPICE_INPUTS_SCROLL_LOCK;
     }
 G_GNUC_END_IGNORE_DEPRECATIONS
-#else
-#ifdef HAVE_X11_XKBLIB_H
-    Display *x_display = NULL;
-    XKeyboardState keyboard_state;
-
-    GdkScreen *screen = gdk_screen_get_default();
-    if (!GDK_IS_X11_DISPLAY(gdk_screen_get_display(screen))) {
-        SPICE_DEBUG("FIXME: gtk backend is not X11");
-        return 0;
-    }
-
-    x_display = GDK_SCREEN_XDISPLAY(screen);
-    XGetKeyboardControl(x_display, &keyboard_state);
-
-    if (keyboard_state.led_mask & 0x01) {
-        modifiers |= SPICE_INPUTS_CAPS_LOCK;
-    }
-    if (keyboard_state.led_mask & 0x02) {
-        modifiers |= SPICE_INPUTS_NUM_LOCK;
-    }
-    if (keyboard_state.led_mask & 0x04) {
-        modifiers |= SPICE_INPUTS_SCROLL_LOCK;
-    }
-#elif defined(G_OS_WIN32)
-    if (GetKeyState(VK_CAPITAL) & 1) {
-        modifiers |= SPICE_INPUTS_CAPS_LOCK;
-    }
-    if (GetKeyState(VK_NUMLOCK) & 1) {
-        modifiers |= SPICE_INPUTS_NUM_LOCK;
-    }
-    if (GetKeyState(VK_SCROLL) & 1) {
-        modifiers |= SPICE_INPUTS_SCROLL_LOCK;
-    }
-#else
-    g_warning("get_keyboard_lock_modifiers not implemented");
-#endif // HAVE_X11_XKBLIB_H
-#endif // GTK_CHECK_VERSION(3,18,0)
     return modifiers;
 }
 
diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index 29d2f01..a6805dd 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -308,7 +308,6 @@ gl_make_current(SpiceDisplay *display, GError **err)
         }
     }
 #endif
-#if GTK_CHECK_VERSION(3,16,0)
 #ifdef GDK_WINDOWING_X11
     else
 #endif
@@ -320,7 +319,6 @@ gl_make_current(SpiceDisplay *display, GError **err)
         gtk_gl_area_make_current(GTK_GL_AREA(area));
         G_GNUC_END_IGNORE_DEPRECATIONS
     }
-#endif
 
     return TRUE;
 }
@@ -600,9 +598,7 @@ void spice_egl_update_display(SpiceDisplay *display)
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
-#if !GTK_CHECK_VERSION(3,16,0)
     glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)d->egl.image);
-#endif
 
     glDisable(GL_BLEND);
     glGetIntegerv(GL_CURRENT_PROGRAM, &prog);
@@ -686,13 +682,11 @@ gboolean spice_egl_update_scanout(SpiceDisplay *display,
 
     d->egl.scanout = *scanout;
 
-#if GTK_CHECK_VERSION(3,16,0)
     if (!gl_make_current(display, NULL))
         return FALSE;
 
     glBindTexture(GL_TEXTURE_2D, d->egl.tex_id);
     glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)d->egl.image);
-#endif
 
     return TRUE;
 }
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 9789359..8d93384 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -573,7 +573,6 @@ static void grab_notify(SpiceDisplay *display, gboolean was_grabbed)
         release_keys(display);
 }
 
-#if GTK_CHECK_VERSION(3,16,0)
 #if HAVE_EGL
 /* Ignore GLib's too-new warnings */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -610,7 +609,6 @@ gl_area_realize(GtkGLArea *area, gpointer user_data)
 }
 G_GNUC_END_IGNORE_DEPRECATIONS
 #endif
-#endif
 
 static void
 drawing_area_realize(GtkWidget *area, gpointer user_data)
@@ -645,7 +643,6 @@ static void spice_display_init(SpiceDisplay *display)
     gtk_widget_set_double_buffered(area, true);
     gtk_stack_set_visible_child(d->stack, area);
 
-#if GTK_CHECK_VERSION(3,16,0)
 #if HAVE_EGL
 /* Ignore GLib's too-new warnings */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -659,7 +656,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     gtk_stack_add_named(d->stack, area, "gl-area");
 G_GNUC_END_IGNORE_DEPRECATIONS
 #endif
-#endif
     area = gtk_drawing_area_new();
     gtk_stack_add_named(d->stack, area, "gst-area");
     gtk_widget_set_double_buffered(area, true);
@@ -813,7 +809,6 @@ SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display)
     return d->grabseq;
 }
 
-#if GTK_CHECK_VERSION(3, 20, 0)
 static GdkSeat *spice_display_get_default_seat(SpiceDisplay *display)
 {
     GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
@@ -822,7 +817,6 @@ static GdkSeat *spice_display_get_default_seat(SpiceDisplay *display)
     return gdk_display_get_default_seat(gdk_display);
     G_GNUC_END_IGNORE_DEPRECATIONS
 }
-#endif
 
 /* FIXME: gdk_keyboard_grab/ungrab() is deprecated */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -869,7 +863,6 @@ static void try_keyboard_grab(SpiceDisplay *display)
                                             GetModuleHandle(NULL), 0);
     g_warn_if_fail(d->keyboard_hook != NULL);
 #endif
-#if GTK_CHECK_VERSION(3, 20, 0)
     status = gdk_seat_grab(spice_display_get_default_seat(display),
                            gtk_widget_get_window(widget),
                            GDK_SEAT_CAPABILITY_KEYBOARD,
@@ -878,10 +871,6 @@ static void try_keyboard_grab(SpiceDisplay *display)
                            NULL,
                            NULL,
                            NULL);
-#else
-    status = gdk_keyboard_grab(gtk_widget_get_window(widget), FALSE,
-                               GDK_CURRENT_TIME);
-#endif
     if (status != GDK_GRAB_SUCCESS) {
         g_warning("keyboard grab failed %u", status);
         d->keyboard_grab_active = false;
@@ -894,14 +883,10 @@ static void try_keyboard_grab(SpiceDisplay *display)
 static void ungrab_keyboard(G_GNUC_UNUSED SpiceDisplay *display)
 {
     G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#if GTK_CHECK_VERSION(3, 20, 0)
     /* we want to ungrab just the keyboard - it is not possible using gdk_seat_ungrab().
        See also https://bugzilla.gnome.org/show_bug.cgi?id=780133 */
     GdkDevice *keyboard = gdk_seat_get_keyboard(spice_display_get_default_seat(display));
     gdk_device_ungrab(keyboard, GDK_CURRENT_TIME);
-#else
-    gdk_keyboard_ungrab(GDK_CURRENT_TIME);
-#endif
     G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
@@ -1044,7 +1029,6 @@ static gboolean do_pointer_grab(SpiceDisplay *display)
 
     try_keyboard_grab(display);
     G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#if GTK_CHECK_VERSION(3, 20, 0)
     status = gdk_seat_grab(spice_display_get_default_seat(display),
                            window,
                            GDK_SEAT_CAPABILITY_ALL_POINTING,
@@ -1053,26 +1037,6 @@ static gboolean do_pointer_grab(SpiceDisplay *display)
                            NULL,
                            NULL,
                            NULL);
-#else
-    /*
-     * from gtk-vnc:
-     * For relative mouse to work correctly when grabbed we need to
-     * allow the pointer to move anywhere on the local desktop, so
-     * use NULL for the 'confine_to' argument. Furthermore we need
-     * the coords to be reported to our VNC window, regardless of
-     * what window the pointer is actally over, so use 'FALSE' for
-     * 'owner_events' parameter
-     */
-    status = gdk_pointer_grab(window, FALSE,
-                     GDK_POINTER_MOTION_MASK |
-                     GDK_BUTTON_PRESS_MASK |
-                     GDK_BUTTON_RELEASE_MASK |
-                     GDK_BUTTON_MOTION_MASK |
-                     GDK_SCROLL_MASK,
-                     NULL,
-                     blank,
-                     GDK_CURRENT_TIME);
-#endif
     G_GNUC_END_IGNORE_DEPRECATIONS
     grab_successful = (status == GDK_GRAB_SUCCESS);
     if (!grab_successful) {
@@ -1176,14 +1140,10 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion)
 static void ungrab_pointer(G_GNUC_UNUSED SpiceDisplay *display)
 {
     G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#if GTK_CHECK_VERSION(3, 20, 0)
     /* we want to ungrab just the pointer - it is not possible using gdk_seat_ungrab().
        See also https://bugzilla.gnome.org/show_bug.cgi?id=780133 */
     GdkDevice *pointer = gdk_seat_get_pointer(spice_display_get_default_seat(display));
     gdk_device_ungrab(pointer, GDK_CURRENT_TIME);
-#else
-    gdk_pointer_ungrab(GDK_CURRENT_TIME);
-#endif
     G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
@@ -1566,11 +1526,7 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
 #endif
 
 #ifdef G_OS_WIN32
-    /* Try to get scancode with gdk_event_get_scancode.
-     * This API is available from 3.22 or if backported.
-     */
-#if HAVE_GDK_EVENT_GET_SCANCODE
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+    /* Try to get scancode with gdk_event_get_scancode. */
     native_scancode = gdk_event_get_scancode((GdkEvent *) key);
     if (native_scancode) {
         scancode = native_scancode & 0x1ff;
@@ -1578,10 +1534,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         if (scancode == (0x100|DIK_NUMLOCK) || scancode == (0x100|DIK_RSHIFT))
             scancode &= 0xff;
     }
-G_GNUC_END_IGNORE_DEPRECATIONS
-#else
-    native_scancode = 0;
-#endif
 
     /* on windows, we ought to ignore the reserved key event? */
     if (!native_scancode && key->hardware_keycode == 0xff)
@@ -1624,14 +1576,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     if (!d->inputs)
         return true;
 
-    if (key->keyval == GDK_KEY_Pause
-#if defined(G_OS_WIN32) && !GTK_CHECK_VERSION(3, 22, 0)
-        /* Bug https://bugzilla.gnome.org/show_bug.cgi?id=769214
-         * Fixed in 3.22 with 125ef35
-         */
-        || key->hardware_keycode == VK_PAUSE
-#endif
-        ) {
+    if (key->keyval == GDK_KEY_Pause) {
         return send_pause(display, key->type);
     }
     if (!scancode)
@@ -2450,11 +2395,7 @@ static GdkDevice *spice_gdk_window_get_pointing_device(GdkWindow *window)
 {
     GdkDisplay *gdk_display = gdk_window_get_display(window);
     G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#if GTK_CHECK_VERSION(3, 20, 0)
     return gdk_seat_get_pointer(gdk_display_get_default_seat(gdk_display));
-#else
-    return gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_display));
-#endif
     G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
@@ -2947,6 +2888,7 @@ static void gl_draw(SpiceDisplay *display,
                     guint32 x, guint32 y, guint32 w, guint32 h)
 {
     SpiceDisplayPrivate *d = display->priv;
+    GtkWidget *gl;
 
     DISPLAY_DEBUG(display, "%s",  __FUNCTION__);
 
@@ -2958,8 +2900,7 @@ static void gl_draw(SpiceDisplay *display,
         return;
     }
 
-#if GTK_CHECK_VERSION(3,16,0)
-    GtkWidget *gl = gtk_stack_get_child_by_name(d->stack, "gl-area");
+    gl = gtk_stack_get_child_by_name(d->stack, "gl-area");
 
     if (gtk_stack_get_visible_child(d->stack) == gl) {
         /* Ignore GLib's too-new warnings */
@@ -2967,9 +2908,7 @@ static void gl_draw(SpiceDisplay *display,
         gtk_gl_area_queue_render(GTK_GL_AREA(gl));
         G_GNUC_END_IGNORE_DEPRECATIONS
         d->egl.call_draw_done = TRUE;
-    } else
-#endif
-    {
+    } else {
         spice_egl_update_display(display);
         spice_display_channel_gl_draw_done(d->display);
     }


More information about the Spice-commits mailing list