summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-04-25 02:10:01 +0200
committerCarlos Garnacho <carlosg@gnome.org>2018-04-25 02:17:39 +0200
commitaeda2ad049efb17171eb6cfd9ca46e542f8b50ed (patch)
tree146ee39ab415213b82edc300eda5efee464500bd /gtk/gtknotebook.c
parent23f4724a23356fdbee49199e1f13cff1f5c2a668 (diff)
downloadgtk+-aeda2ad049efb17171eb6cfd9ca46e542f8b50ed.tar.gz
notebook: Fetch directly current event state/device
gtk_get_current_event() returns a new reference to the event, it should be freed across various return branches to avoid the event leak, or we just fetch the little stuff we're interested in.
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a168b115d6..57b554adb3 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2671,15 +2671,12 @@ gtk_notebook_motion (GtkEventController *controller,
GtkNotebookPrivate *priv = notebook->priv;
GtkNotebookPage *page;
guint state;
- GdkEventMotion *event;
-
- event = (GdkEventMotion *)gtk_get_current_event (); /* FIXME: controller event */
page = priv->cur_page;
if (!page)
return;
- if (!gdk_event_get_state ((GdkEvent *) event, &state))
+ if (!gtk_get_current_event_state (&state))
return;
if (!(state & GDK_BUTTON1_MASK) &&
@@ -2701,7 +2698,7 @@ gtk_notebook_motion (GtkEventController *controller,
priv->detached_tab = priv->cur_page;
gtk_drag_begin_with_coordinates (widget,
- gdk_event_get_device ((GdkEvent*) event),
+ gtk_get_current_event_device (),
priv->source_targets, GDK_ACTION_MOVE,
priv->drag_begin_x, priv->drag_begin_y);
return;