# HG changeset patch # User Christian Hammond # Date 1043281197 0 # Node ID ce8d35b435defc4a435a429be344f5bb0ddc9f0d # Parent a8249a5250b69835b794ec72006bb31586ad17a4 [gaim-migrate @ 4668] Fixes the problem where doing a gesture and then clicking the right mouse button causes it to stay in gesture mode forever. It's hacky, though.. hope it doesn't cause other issues. committer: Tailor Script diff -r a8249a5250b6 -r ce8d35b435de plugins/gestures/stroke-draw.c --- a/plugins/gestures/stroke-draw.c Wed Jan 22 23:46:59 2003 +0000 +++ b/plugins/gestures/stroke-draw.c Thu Jan 23 00:19:57 2003 +0000 @@ -107,6 +107,7 @@ static GtkWidget *original_widget = NULL; switch (event->type) { case GDK_BUTTON_PRESS: + debug_printf("Button press: %d\n", event->button.button); if (event->button.button != gstroke_get_mouse_button()) break; @@ -126,9 +127,28 @@ case GDK_BUTTON_RELEASE: if ((event->button.button != gstroke_get_mouse_button()) - || (original_widget == NULL)) - /* the stroke probably did not start here... */ - break; + || (original_widget == NULL)) { + + /* Nice bug when you hold down one button and press another. */ + /* We'll just cancel the gesture instead. */ + last_mouse_position.invalid = TRUE; + original_widget = NULL; + + if (timer_id > 0) + gtk_timeout_remove (timer_id); + + gdk_pointer_ungrab (event->button.time); + timer_id = 0; + + if (gstroke_draw_strokes()) { + /* get rid of the invisible stroke window */ + XUnmapWindow (gstroke_disp, gstroke_window); + XFlush (gstroke_disp); + } + + break; + + } last_mouse_position.invalid = TRUE; original_widget = NULL; @@ -314,11 +334,11 @@ col_background = WhitePixel (gstroke_disp, screen); /* no border for the window */ -#ifdef DEBUG +#if 0 border_width = 5; -#else +#endif border_width = 0; -#endif + col_border = BlackPixel (gstroke_disp, screen); gstroke_window = XCreateSimpleWindow (gstroke_disp, wind,