Fix bug where, after double-clicking to switch sheet view, a spurious release event... 20121009032003/pspp 20121011032101/pspp 20121012032055/pspp 20121013032614/pspp 20121014032548/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 8 Oct 2012 20:14:36 +0000 (22:14 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 8 Oct 2012 20:19:26 +0000 (22:19 +0200)
commit2801d67dabe9b57ffe2f044fa93f6302eac63114
tree6f43c28421ea73d397257834ea408a47da3d4738
parent9b50cd30a88398903028bd233ed6cbc3e4482db4
Fix bug where, after double-clicking to switch sheet view, a spurious release event was processed.

From http://developer.gnome.org/gdk/2.24/gdk-Event-Structures.html#GdkEventButton

  Double and triple-clicks result in a sequence of events being received. For
  double-clicks the order of events will be:

   1.  GDK_BUTTON_PRESS
   2.  GDK_BUTTON_RELEASE
   3.  GDK_BUTTON_PRESS
   4.  GDK_2BUTTON_PRESS
   5.  GDK_BUTTON_RELEASE

So what was happening was this:  When the var-name was double-clicked, the view switched
from VarView to DataView as soon as  event 4 (GDK_2BUTTON_PRESS) occured.  Then event 5
(GDK_BUTTON_RELEASE) occured.

Now the PsppSheetView object is written such that, it decides to edit a cell, on button
release event. Hence, whichever cell the pointer happended to be in, when the user lifts
his finger after double clicking, starts to be edited.

This change ignores button release events on the object unless a corresponding button press
event was seen.
src/ui/gui/pspp-sheet-view.c