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.

This commit is contained in:
Pietro Gagliardi 2019-09-15 22:53:23 -04:00
parent 17486fd175
commit 1b05846892
1 changed files with 3 additions and 3 deletions

View File

@ -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);