gEDA-dev: PCB-gtk rotate tool bug?

Peter Clifton pcjc2 at cam.ac.uk
Tue Sep 18 15:12:57 EDT 2007


On Tue, 2007-09-18 at 20:04 +0100, Peter Clifton wrote:
> On Tue, 2007-09-18 at 14:51 -0400, David Carr wrote:
> > Hey Guys,
> > 
> > Try this:
> > Open PCB and add a component to the layout
> > Rotate this component several times using the rotate tool (do a couple
> > revolutions)
> > 
> > If I click a fairly rapid pace (say 2-3Hz) I find that about 50% of the
> > time the component rotates 180 degrees instead of 90.  I usually run into
> > this while spining something 270 --- the first click gives me 90, the
> > second 180 and then the third skips 270 and goes right back to 0.
> > 
> > It seems to me that this is a long standing bug in the GTK HID or that I
> > don't understand some small PCB feature (perhaps related to double
> > clicks?).
> 
> > My suspicion is that this in an event bug of some kind where the click
> > event is delivered or processed twice.

[snip]

> I'll see about rejecting those extra events - should be an easy fix.

Index: src/hid/gtk/gui-output-events.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gui-output-events.c,v
retrieving revision 1.17
diff -U3 -p -r1.17 gui-output-events.c
--- src/hid/gtk/gui-output-events.c     1 May 2007 03:29:33 -0000       1.17
+++ src/hid/gtk/gui-output-events.c     18 Sep 2007 19:08:26 -0000
@@ -533,6 +533,9 @@ ghid_port_button_press_cb (GtkWidget * d
   ModifierKeysState mk;
   gboolean drag, start_pan = FALSE;
 
+  /* Reject double and triple click events */
+  if (ev->type != GDK_BUTTON_PRESS) return;
+
   x_press = ev->x;
   y_press = ev->y;
 

I'm not going to push this unless one of the regular PCB developers OKs
it, Dan?

If any PCB dev wants to apply it, be my guest.

Peter




More information about the geda-dev mailing list