]> Dogcows Code - chaz/openbox/commitdiff
better event handling for menus
authorDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 00:53:21 +0000 (00:53 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 00:53:21 +0000 (00:53 +0000)
openbox/event.c
openbox/menuframe.c

index 00de8b36880e075ebef460e0b9da9bcf236a7d9a..7c85e8429d8c5f7c94f5251fa44f7c9e0df20c80 100644 (file)
@@ -1276,17 +1276,12 @@ static void event_handle_menu(XEvent *ev)
         }
         break;
     case LeaveNotify:
-        if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window))) {
-            if (e->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU)
-                menu_frame_select(e->frame, NULL);
-        }
-    case MotionNotify:
-        if ((e = menu_entry_frame_under(ev->xmotion.x_root,
-                                        ev->xmotion.y_root))) {
-            /* XXX menu_frame_entry_move_on_screen(f); */
-            menu_frame_select(e->frame, e);
+        if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window)) &&
+            (f = find_active_menu()) && f->selected == e &&
+            e->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU)
+        {
+            menu_frame_select(e->frame, NULL);
         }
-        break;
     case KeyPress:
         if (ev->xkey.keycode == ob_keycode(OB_KEY_ESCAPE))
             menu_frame_hide_all();
index c417c05a11df59512f0420b6a58abc0a29e08a4f..a5c301ed6f1617ab18a0169696c2fea1b0519fe1 100644 (file)
@@ -738,7 +738,8 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent,
 
     XMapWindow(ob_display, self->window);
 
-    if (screen_pointer_pos(&dx, &dy) && (e = menu_entry_frame_under(dx, dy)))
+    if (screen_pointer_pos(&dx, &dy) && (e = menu_entry_frame_under(dx, dy)) &&
+        e->frame == self)
         ++e->ignore_enters;
 
     return TRUE;
This page took 0.026948 seconds and 4 git commands to generate.