From: Dana Jansens Date: Sat, 12 May 2007 19:50:32 +0000 (+0000) Subject: ignore enter events on top menu and submenu popup X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=c2e4d42e6d086b60d4ecd9ef2e51ef9ed7575dfc;p=chaz%2Fopenbox ignore enter events on top menu and submenu popup --- diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 5782b7ac..a42c138d 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -932,6 +932,7 @@ static gboolean menu_frame_show(ObMenuFrame *self) gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, gint button) { + gint px, py; guint i; if (menu_frame_is_visible(self)) @@ -957,14 +958,20 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, XMapWindow(ob_display, self->window); + if (screen_pointer_pos(&px, &py)) { + ObMenuEntryFrame *e = menu_entry_frame_under(px, py); + if (e && e->frame == self) + e->ignore_enters++; + } + return TRUE; } gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, ObMenuEntryFrame *parent_entry) { - ObMenuEntryFrame *e; gint x, y, dx, dy; + gint px, py; if (menu_frame_is_visible(self)) return TRUE; @@ -994,9 +1001,11 @@ 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)) && - e->frame == self) - ++e->ignore_enters; + if (screen_pointer_pos(&px, &py)) { + ObMenuEntryFrame *e = menu_entry_frame_under(px, py); + if (e && e->frame == self) + e->ignore_enters++; + } return TRUE; } @@ -1086,7 +1095,7 @@ ObMenuEntryFrame* menu_entry_frame_under(gint x, gint y) ObMenuEntryFrame *e = it->data; if (RECT_CONTAINS(e->area, x, y)) { - ret = e; + ret = e; break; } }