From 177f3ef655d7f5bfc30d853c390329c2b7c9815d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Aug 2017 16:56:53 +0200 Subject: [PATCH] gtkwindow: Update to using GdkEvent API --- gtk/gtkwindow.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 589dd31dfa..4d95aa257e 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1816,7 +1816,7 @@ captured_event_cb (GtkWidget *widget, "sw-resize", "s-resize", "se-resize" }; - if (event->type != GDK_MOTION_NOTIFY) + if (gdk_event_get_event_type (event) != GDK_MOTION_NOTIFY) return GDK_EVENT_PROPAGATE; if (!gdk_event_get_coords (event, &x, &y)) return GDK_EVENT_PROPAGATE; @@ -7454,12 +7454,13 @@ gtk_window_handle_wm_event (GtkWindow *window, GdkEvent *event, gboolean run_drag) { + GdkEventType event_type = gdk_event_get_event_type (event); gboolean retval = GDK_EVENT_PROPAGATE; GtkWindowPrivate *priv; - if (event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE || - event->type == GDK_TOUCH_BEGIN || event->type == GDK_TOUCH_UPDATE || - event->type == GDK_MOTION_NOTIFY || event->type == GDK_TOUCH_END) + if (event_type == GDK_BUTTON_PRESS || event_type == GDK_BUTTON_RELEASE || + event_type == GDK_TOUCH_BEGIN || event_type == GDK_TOUCH_UPDATE || + event_type == GDK_MOTION_NOTIFY || event_type == GDK_TOUCH_END) { priv = window->priv; @@ -7480,6 +7481,7 @@ _gtk_window_check_handle_wm_event (GdkEvent *event) { GtkWindowPrivate *priv; GtkWidget *widget; + GdkEventType event_type; widget = gtk_get_event_widget (event); @@ -7494,9 +7496,11 @@ _gtk_window_check_handle_wm_event (GdkEvent *event) if (!priv->multipress_gesture) return GDK_EVENT_PROPAGATE; - if (event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE && - event->type != GDK_MOTION_NOTIFY && event->type != GDK_TOUCH_BEGIN && - event->type != GDK_TOUCH_END && event->type != GDK_TOUCH_UPDATE) + event_type = gdk_event_get_event_type (event); + + if (event_type != GDK_BUTTON_PRESS && event_type != GDK_BUTTON_RELEASE && + event_type != GDK_MOTION_NOTIFY && event_type != GDK_TOUCH_BEGIN && + event_type != GDK_TOUCH_END && event_type != GDK_TOUCH_UPDATE) return GDK_EVENT_PROPAGATE; if (gtk_widget_event (widget, event))