Commit aeda2ad0 authored by Carlos Garnacho's avatar Carlos Garnacho

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.
parent 23f4724a
......@@ -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)
if (!gdk_event_get_state ((GdkEvent *) event, &state))
if (!gtk_get_current_event_state (&state))
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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment