minor fix for window menu

This commit is contained in:
fluxgen 2005-06-23 22:39:03 +00:00
parent a54a2b1409
commit 4382b78b95

View file

@ -2260,13 +2260,15 @@ void FluxboxWindow::showMenu(int menu_x, int menu_y) {
if it's already visible it'll be hidden if it's already visible it'll be hidden
*/ */
void FluxboxWindow::popupMenu() { void FluxboxWindow::popupMenu() {
WindowCmd<void>::setWindow(this);
if (menu().isVisible()) { // hide menu if it was opened for this window before
if (menu().isVisible() && WindowCmd<void>::window() == this) {
menu().hide(); menu().hide();
return; return;
} }
WindowCmd<void>::setWindow(this);
menu().disableTitle(); menu().disableTitle();
int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth();
if (!decorations.titlebar) // if we don't have any titlebar if (!decorations.titlebar) // if we don't have any titlebar