From 1b05846892cf3f3e8a33fa17eff07d5edfb697a8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 15 Sep 2019 22:53:23 -0400 Subject: [PATCH] Fixed a use-before-initialize bug in unix/area.c. This was present from the start, and was an error in my Go code conversion; oops. Fixes #472. --- unix/area.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/area.c b/unix/area.c index 0a2e6d69..19b34634 100644 --- a/unix/area.c +++ b/unix/area.c @@ -248,6 +248,9 @@ static gboolean areaWidget_button_press_event(GtkWidget *w, GdkEventButton *e) // clicking doesn't automatically transfer keyboard focus; we must do so manually (thanks tristan in irc.gimp.net/#gtk+) gtk_widget_grab_focus(w); + me.Down = e->button; + me.Up = 0; + // we handle multiple clicks ourselves here, in the same way as we do on Windows if (e->type != GDK_BUTTON_PRESS) // ignore GDK's generated double-clicks and beyond @@ -266,9 +269,6 @@ static gboolean areaWidget_button_press_event(GtkWidget *w, GdkEventButton *e) e->time, maxTime, maxDistance, maxDistance); - me.Down = e->button; - me.Up = 0; - // and set things up for window drags a->dragevent = e; finishMouseEvent(a, &me, e->button, e->x, e->y, e->state, e->window);