hide window menu if click on another window, patch from Mathias Gumz

This commit is contained in:
fluxgen 2004-04-12 23:05:10 +00:00
parent 66af4ea72f
commit e828391b1c
3 changed files with 21 additions and 11 deletions

View file

@ -22,7 +22,7 @@
// 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 @@ void BScreen::hideMenus() {
(*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,14 +913,15 @@ void BScreen::hideMenus() {
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_menutheme->setMenuMode(*resource.menu_mode);

View file

@ -22,7 +22,7 @@
// 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
@ -178,6 +178,9 @@ public:
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; }

View file

@ -22,7 +22,7 @@
// 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 @@ void FluxboxWindow::init() {
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 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
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 @@ void FluxboxWindow::setupWindow() {
*/
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 @@ void FluxboxWindow::reconfigTheme() {
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