hide window menu if click on another window, patch from Mathias Gumz
fluxgen fluxgen
3 files changed,
20 insertions(+),
10 deletions(-)
M
src/Screen.cc
→
src/Screen.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.273 2004/03/30 13:46:34 fluxgen Exp $ +// $Id: Screen.cc,v 1.274 2004/04/12 23:05:10 fluxgen Exp $ #include "Screen.hh"@@ -901,6 +901,11 @@ for (; it != it_end; ++it)
(*it)->menu().hide(); } // hide all client menus + hideWindowMenus(); + +} + +void BScreen::hideWindowMenus(const FluxboxWindow* except) { Workspaces::iterator w_it = getWorkspacesList().begin(); const Workspaces::iterator w_it_end = getWorkspacesList().end(); for (; w_it != w_it_end; ++w_it) {@@ -908,13 +913,14 @@ if ((*w_it)->windowList().size()) {
Workspace::Windows::iterator win_it = (*w_it)->windowList().begin(); const Workspace::Windows::iterator win_it_end = (*w_it)->windowList().end(); for (; win_it != win_it_end; ++win_it) { + if (*win_it != except) (*win_it)->menu().hide(); } } } +} -} void BScreen::reconfigure() { m_menutheme->setAlpha(*resource.menu_alpha);
M
src/Screen.hh
→
src/Screen.hh
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.137 2004/03/30 13:45:20 fluxgen Exp $ +// $Id: Screen.hh,v 1.138 2004/04/12 23:05:10 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH@@ -177,6 +177,9 @@ void update(FbTk::Subject *subj);
FbTk::Menu *createMenu(const std::string &label); void hideMenus(); + + /// hide all windowmenus except the given one (if given) + void hideWindowMenus(const FluxboxWindow* except= 0); /// @return the resource value of number of workspace inline int getNumberOfWorkspaces() const { return *resource.workspaces; }
M
src/Window.cc
→
src/Window.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.276 2004/04/12 18:19:10 fluxgen Exp $ +// $Id: Window.cc,v 1.277 2004/04/12 23:03:34 fluxgen Exp $ #include "Window.hh"@@ -393,8 +393,8 @@ frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor());
FbTk::TextButton *btn = new FbTk::TextButton(frame().label(), - frame().theme().font(), - m_client->title()); + frame().theme().font(), + m_client->title()); btn->setJustify(frame().theme().justify()); m_labelbuttons[m_client] = btn; frame().addLabelButton(*btn);@@ -2354,8 +2354,8 @@ m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth(); } - if (m_windowmenu.isVisible()) - m_windowmenu.hide(); + Fluxbox::instance()->hideExtraMenus(screen()); + screen().hideWindowMenus(this); } }@@ -3523,7 +3523,8 @@ * the frame's client area.
*/ void FluxboxWindow::reconfigTheme() { - m_frame.setBorderWidth(decorations.border?frame().theme().border().width():0); + m_frame.setBorderWidth(decorations.border ? + frame().theme().border().width() : 0); if (decorations.handle && frame().theme().handleWidth() != 0) frame().showHandle(); else@@ -3545,7 +3546,7 @@
sendConfigureNotify(); } -// grab pointer an increase counter. +// grab pointer and increase counter. // we need this to count grab pointers, // especially at startup, where we can drag/resize while starting // and causing it to send events to windows later on and make