]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (make_lispy_event): Add USE_X_TOOLKIT conditional and
authorFred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
Thu, 27 Jan 1994 11:01:59 +0000 (11:01 +0000)
committerFred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
Thu, 27 Jan 1994 11:01:59 +0000 (11:01 +0000)
        test FRAME_EXTERNAL_MENU_BAR.
        (map_event_to_object) [USE_X_TOOLKIT]: Declare and use it.

src/keyboard.c

index 7213b20b6f0e5a7948be02fb24238ddc775fe086..e53dbda540e831b9bbe489d3251ed206e92ded73 100644 (file)
@@ -2386,6 +2386,10 @@ Lisp_Object Vdouble_click_time;
 
 int double_click_count;
 
+#ifdef USE_X_TOOLKIT
+extern Lisp_Object map_event_to_object ();
+#endif /* USE_X_TOOLKIT  */
+
 /* Given a struct input_event, build the lisp event which represents
    it.  If EVENT is 0, build a mouse movement event from the mouse
    movement buffer, which should have a movement event in it.
@@ -2484,6 +2488,14 @@ make_lispy_event (event)
                                         &part);
            Lisp_Object posn;
 
+#ifdef USE_X_TOOLKIT
+           if (FRAME_EXTERNAL_MENU_BAR (f) && XINT (event->y) == -1)
+             {
+               /* The click happened in the menubar.
+                  Look for the menu item selected.  */
+               Lisp_Object items = map_event_to_object(event, f);
+               XFASTINT (event->y) = 1;
+#else /* not USE_X_TOOLKIT  */
            if (XINT (event->y) < FRAME_MENU_BAR_LINES (f))
              {
                int hpos;
@@ -2498,6 +2510,7 @@ make_lispy_event (event)
                        && XINT (event->x) < XINT (pos) + XSTRING (string)->size)
                      break;
                  }
+#endif /* not USE_X_TOOLKIT  */
                position
                  = Fcons (event->frame_or_window,
                           Fcons (Qmenu_bar,