diff --git a/ChangeLog b/ChangeLog index c7d1f61..546dfb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3543,3 +3543,13 @@ Tue May 2 16:56:47 PDT 2000 Michael Jennings Yeah, right. =P ------------------------------------------------------------------------------- +Wed May 3 21:04:37 PDT 2000 Michael Jennings + + Fixed a bug in the handling of resize events thanks to a tip from + Teodor Zlatanov . While I was at it, I also fixed a + couple remaining issues with the popup menu system. You shouldn't + get any more cases where items remain selected after you've moved your + mouse off of the menu, or where a submenu would stay up even though + another menuitem is selected. + +------------------------------------------------------------------------------- diff --git a/src/events.c b/src/events.c index bb6625d..4b75fd7 100644 --- a/src/events.c +++ b/src/events.c @@ -484,16 +484,19 @@ handle_focus_out(event_t * ev) unsigned char handle_configure_notify(event_t * ev) { - XEvent unused_xevent; + XEvent xevent; D_EVENTS(("handle_configure_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window)); REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0); - while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, ConfigureNotify, &unused_xevent)); + while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, ConfigureNotify, ev)) { + D_EVENTS(("New event: Window 0x%08x, %dx%d at %d, %d\n", ev->xany.window, ev->xconfigure.width, + ev->xconfigure.height, ev->xconfigure.x, ev->xconfigure.y)); + } if (ev->xany.window == TermWin.parent) { - int x = ev->xconfigurerequest.x, y = ev->xconfigurerequest.y; - unsigned int width = ev->xconfigurerequest.width, height = ev->xconfigurerequest.height; + int x = ev->xconfigure.x, y = ev->xconfigure.y; + unsigned int width = ev->xconfigure.width, height = ev->xconfigure.height; D_EVENTS((" -> TermWin.parent is %ldx%ld at (%d, %d). Internal cache data shows %dx%d at (%hd, %hd). send_event is %d\n", width, height, x, y, szHint.width, szHint.height, TermWin.x, TermWin.y, ev->xconfigure.send_event)); diff --git a/src/menus.c b/src/menus.c index 42a667a..a529f2a 100644 --- a/src/menus.c +++ b/src/menus.c @@ -357,6 +357,9 @@ menu_handle_motion_notify(event_t * ev) current_menu->state |= MENU_STATE_IS_DRAGGING; } item = find_item_by_coords(current_menu, ev->xbutton.x, ev->xbutton.y); + if (!item || item != menuitem_get_current(current_menu)) { + menu_reset_submenus(current_menu); + } menuitem_change_current(item); } else { /* Motion outside the current menu */ @@ -383,6 +386,8 @@ menu_handle_motion_notify(event_t * ev) menu_reset_submenus(current_menu); } menuitem_change_current(item); + } else if (!menu) { + menuitem_change_current(NULL); } }