From 6e60c53ae7fbffa034da952e061f5a81d0f082be Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 26 Jun 2006 11:45:14 +0000 Subject: fix _NET_FRAME_EXTENTS --- ChangeLog | 2 ++ src/Ewmh.cc | 13 +++++++++---- src/FbWinFrame.hh | 3 ++- src/Screen.cc | 26 ++++++++++++++++++++++---- src/Window.cc | 7 +++---- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 280a5e6..8eed445 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc2: *06/06/26: + * Fix _NET_FRAME_EXTENTS implementation (Simon) + Ewmh.cc Window.cc Screen.cc FbWinFrame.hh * Fix FocusHidden (Mark) Window.cc/hh *06/06/25: diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 15caab0..27c938b 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -1249,11 +1249,16 @@ void Ewmh::setupState(FluxboxWindow &win) { } void Ewmh::updateFrameExtents(FluxboxWindow &win) { + /* Frame extents are basically the amount the window manager frame + protrudes from the client window, on left, right, top, bottom + (it is independent of window position). + */ int extents[4]; - extents[0] = win.frame().x(); - extents[1] = win.frame().x() + win.frame().width(); - extents[2] = win.frame().y(); - extents[3] = win.frame().y() + win.frame().height(); + // our frames currently don't protrude from left/right + extents[0] = 0; + extents[1] = 0; + extents[2] = win.frame().titlebarHeight(); + extents[3] = win.frame().handleHeight(); FluxboxWindow::ClientList::iterator it = win.clientList().begin(); FluxboxWindow::ClientList::iterator it_end = win.clientList().end(); diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 6858579..fc64900 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -233,7 +233,8 @@ public: inline bool isShaded() const { return m_shaded; } inline FbWinFrameTheme &theme() const { return m_theme; } /// @return titlebar height - unsigned int titlebarHeight() const { return m_titlebar.height(); } + unsigned int titlebarHeight() const { return (m_use_titlebar?m_titlebar.height()+m_window.borderWidth():0); } + unsigned int handleHeight() const { return (m_use_handle?m_handle.height()+m_window.borderWidth():0); } /// @return size of button unsigned int buttonHeight() const; bool externalTabMode() const { return m_tabmode == EXTERNAL && m_use_tabs; } diff --git a/src/Screen.cc b/src/Screen.cc index a723f3c..c6155fe 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -696,6 +696,24 @@ void BScreen::update(FbTk::Subject *subj) { renderGeomWindow(); renderPosWindow(); + + Fluxbox *fluxbox = Fluxbox::instance(); + + // and update frame extents on theme changes + Workspaces::iterator w_it = getWorkspacesList().begin(); + const Workspaces::iterator w_it_end = getWorkspacesList().end(); + for (; w_it != w_it_end; ++w_it) { + 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) + fluxbox->updateFrameExtents(**win_it); + } + + Icons::iterator it = iconList().begin(); + const Icons::iterator it_end = iconList().end(); + for (; it != it_end; ++it) + fluxbox->updateFrameExtents(**it); + } FbTk::Menu *BScreen::createMenu(const std::string &label) { @@ -749,7 +767,7 @@ void BScreen::hideMenus() { #endif // SLIT // hide icon menus - if (iconList().size()) { + if (!iconList().empty()) { Icons::iterator it = iconList().begin(); const Icons::iterator it_end = iconList().end(); for (; it != it_end; ++it) @@ -764,7 +782,7 @@ 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) { - if ((*w_it)->windowList().size()) { + if (!(*w_it)->windowList().empty()) { 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) { @@ -895,7 +913,7 @@ void BScreen::reconfigureTabs() { Workspaces::iterator w_it = getWorkspacesList().begin(); const Workspaces::iterator w_it_end = getWorkspacesList().end(); for (; w_it != w_it_end; ++w_it) { - if ((*w_it)->windowList().size()) { + if (!(*w_it)->windowList().empty()) { 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) { @@ -1517,7 +1535,7 @@ void BScreen::initMenu() { m_rootmenu.reset(createMenu("")); Fluxbox * const fb = Fluxbox::instance(); - if (fb->getMenuFilename().size() > 0) { + if (!fb->getMenuFilename().empty()) { m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(), screenNumber(), true)); diff --git a/src/Window.cc b/src/Window.cc index 5fb5d86..2016ab9 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3209,8 +3209,10 @@ void FluxboxWindow::applyDecorations(bool initial) { } frame().reconfigure(); - if (!initial && client_move) + if (!initial && client_move) { + Fluxbox::instance()->updateFrameExtents(*this); sendConfigureNotify(); + } } @@ -3936,9 +3938,6 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) { } } // end for - if (send_to_netizens) { - Fluxbox::instance()->updateFrameExtents(*this); - } } -- cgit v0.11.2