Possible bug in mouse-event handlers?

10 views
Skip to first unread message

Monte Bateman

unread,
Dec 10, 2014, 2:02:28 PM12/10/14
to osm-g...@googlegroups.com

I am trying to use your library and example mapviewer code to write a lightning display package that will be used to calibrate and validate a new satellite instrument that is launching in Mar 2016.

I think I have found bugs in the library, or perhaps a gap in my GTK+ understanding. I have tried both 1.0.2-2 and 1.0.2-24.
  1. After left-clicking and dragging the map, releasing the mouse button does not generate a "button-release-event", as shown by the text displayed in the entry box. The on-screen lat/lon display correctly updates, but the entry box text is not updated; on_button_release_event is not being called.  If I then quickly click and release, then the entry box text updates.  Is there a different event that is being generated, perhaps related to the drag?

  2. The reason this is important: I am trying to develop a "double map" display (2 maps side-by-side).  I am trying to synchronize the 2 maps when either is panned or zoomed, and I am very close to having it working.

    I used glade to create MAP_BOX_L and MAP_BOX_R, then instantiated them in the mapviewer.c code.  It seems to me that the correct way to do this is to connect to the "changed" signal. This works if I connect either left or right mapbox to the "changed" signal, but if I try to attach both mapbox widgets to that signal, it dies upon startup with a "seg fault".  Any ideas on this?

  3. My current workaround is:
    Left map: connect to the "changed" signal to update the right map
    Right map: use a combination of "button-release-event" and "motion_notify_event" to update the left map.

Any/all help appreciated!

Thanks,
Monte Bateman


st...@nixia.no

unread,
Dec 11, 2014, 2:40:19 AM12/11/14
to osm-g...@googlegroups.com
Den 2014-12-10 20:02, skrev Monte Bateman:
> I used glade to create MAP_BOX_L and MAP_BOX_R, then instantiated
> them in the mapviewer.c code. It seems to me that the correct way to
> do this is to connect to the "changed" signal. This works if I
> connect
> either left or right mapbox to the "changed" signal, but if I try to
> attach both mapbox widgets to that signal, it dies upon startup with
> a
> "seg fault". Any ideas on this?

Does the signal fire during initialization? If so, maybe your handler
tries to access the other instance which is not valid yet, or before
pointers are extracted. Run it with gdb and look at the backtrace. And
what line triggers the seg-fault?


Stian
Reply all
Reply to author
Forward
0 new messages