DtWidget: added appropriate KeyPress event handler to DtIcon widget
authoralx <alx@fastestcode.org>
Thu, 23 Jul 2015 18:27:20 +0000 (20:27 +0200)
committerJon Trulson <jon@radscan.com>
Fri, 24 Jul 2015 00:51:43 +0000 (18:51 -0600)
cde/lib/DtWidget/Icon.c

index d91a4b99479c5c68dbaaddd332b4203d92758383..400fe97ee390242f871a5ce617d2ae8b2070f390 100644 (file)
@@ -1088,17 +1088,22 @@ IconActivate(
                }
                else
                {
-                       delay = (unsigned long)
-                               XtGetMultiClickTime (XtDisplay (g)); 
-                       G_ClickEvent (g) = (XButtonEvent *)
-                               XtMalloc (sizeof (XButtonEvent));
-                       *(G_ClickEvent (g)) = *b_event;
-                       G_Sync (g) = True;
-                       G_ClickTimerID (g) = 
-                               XtAppAddTimeOut (
-                                       XtWidgetToApplicationContext ((Widget)g),
-                                       delay, (XtTimerCallbackProc)ClickTimeout, 
-                                       (XtPointer) g);
+                       if(event->type==KeyPress){
+                               G_Armed(g)=False;
+                               (*call_callback)(g,G_Callback(g),XmCR_SELECT,event);
+                       }else{
+                               delay = (unsigned long)
+                                       XtGetMultiClickTime (XtDisplay (g));
+                               G_ClickEvent (g) = (XButtonEvent *)
+                                       XtMalloc (sizeof (XButtonEvent));
+                               *(G_ClickEvent (g)) = *b_event;
+                               G_Sync (g) = True;
+                               G_ClickTimerID (g) =
+                                       XtAppAddTimeOut (
+                                               XtWidgetToApplicationContext ((Widget)g),
+                                               delay, (XtTimerCallbackProc)ClickTimeout,
+                                               (XtPointer) g);
+                       }
                }
 
                 if (G_ShadowThickness (g) > 0)