diff options
author | Henrik Kinnunen <fluxgen@fluxbox.org> | 2008-05-13 13:50:17 (GMT) |
---|---|---|
committer | Henrik Kinnunen <fluxgen@fluxbox.org> | 2008-05-13 15:06:26 (GMT) |
commit | 5ecebae4770cbe7e4feea46d2c074a818f1c9662 (patch) | |
tree | 6ae650effda6528ebb5e40846a02dbe5a79e82d1 /src/Window.cc | |
parent | c31638038aabd93c74373c7ee00fbefbc68d28ae (diff) | |
download | fluxbox_pavel-5ecebae4770cbe7e4feea46d2c074a818f1c9662.zip fluxbox_pavel-5ecebae4770cbe7e4feea46d2c074a818f1c9662.tar.bz2 |
Fixed startup bug for window menu in iconbar.
The window menu in the iconbutton was not updated properly
the first time it was used ( before right clicking in the real
window titlebar).
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/Window.cc b/src/Window.cc index c16d366..3b5e917 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -2172,25 +2172,31 @@ void FluxboxWindow::showMenu(int menu_x, int menu_y) { | |||
2172 | menu().grabInputFocus(); | 2172 | menu().grabInputFocus(); |
2173 | } | 2173 | } |
2174 | 2174 | ||
2175 | void FluxboxWindow::popupMenu(int x, int y) { | ||
2176 | // hide menu if it was opened for this window before | ||
2177 | if (menu().isVisible() && FbMenu::window() == this) { | ||
2178 | menu().hide(); | ||
2179 | return; | ||
2180 | } | ||
2181 | |||
2182 | menu().disableTitle(); | ||
2183 | |||
2184 | showMenu(x, y); | ||
2185 | } | ||
2186 | |||
2175 | /** | 2187 | /** |
2176 | Moves the menu to last button press position and shows it, | 2188 | Moves the menu to last button press position and shows it, |
2177 | if it's already visible it'll be hidden | 2189 | if it's already visible it'll be hidden |
2178 | */ | 2190 | */ |
2179 | void FluxboxWindow::popupMenu() { | 2191 | void FluxboxWindow::popupMenu() { |
2180 | 2192 | ||
2181 | // hide menu if it was opened for this window before | ||
2182 | if (menu().isVisible() && FbMenu::window() == this) { | ||
2183 | menu().hide(); | ||
2184 | return; | ||
2185 | } | ||
2186 | |||
2187 | menu().disableTitle(); | ||
2188 | int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); | 2193 | int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); |
2189 | if (!decorations.titlebar) // if we don't have any titlebar | 2194 | if (!decorations.titlebar) // if we don't have any titlebar |
2190 | menu_y = 0; | 2195 | menu_y = 0; |
2191 | if (m_last_button_x < x() || m_last_button_x > x() + static_cast<signed>(width())) | 2196 | if (m_last_button_x < x() || m_last_button_x > x() + static_cast<signed>(width())) |
2192 | m_last_button_x = x(); | 2197 | m_last_button_x = x(); |
2193 | showMenu(m_last_button_x, menu_y + frame().y()); | 2198 | |
2199 | popupMenu(m_last_button_x, menu_y + frame().y()); | ||
2194 | } | 2200 | } |
2195 | 2201 | ||
2196 | 2202 | ||