2003-12-17 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation
of ActionEvents for mouse double-clicks.
From-SVN: r74745
-2003-12-16 Fernando Nasser <fnasser@redhat.com>
+2003-12-17 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation
+ of ActionEvents for mouse double-clicks.
+
+2003-12-17 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/GtkContainerPeer.java (handleEvent): Check for
null Graphics pointer returned by FileDialogPeer.
if (!me.isConsumed ()
&& (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0
&& me.getClickCount() == 2)
- postActionEvent (((List)awtComponent).getSelectedItem (),
- me.getModifiers ());
+ {
+ String selectedItem = ((List)awtComponent).getSelectedItem ();
+
+ /* Double-click only generates an Action event
+ if something is selected */
+ if (selectedItem != null)
+ postActionEvent (((List)awtComponent).getSelectedItem (),
+ me.getModifiers ());
+ }
}
if (e.getID () == KeyEvent.KEY_PRESSED)