fix _NET_FRAME_EXTENTS
simonb simonb
5 files changed,
38 insertions(+),
13 deletions(-)
M
src/Ewmh.cc
→
src/Ewmh.cc
@@ -1249,11 +1249,16 @@ }
} 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();
M
src/FbWinFrame.hh
→
src/FbWinFrame.hh
@@ -233,7 +233,8 @@ inline bool focused() const { return m_focused; }
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; }
M
src/Screen.cc
→
src/Screen.cc
@@ -696,6 +696,24 @@ // if another signal is added later, will need to differentiate here
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 @@ slit()->menu().hide();
#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 @@ } else
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));
M
src/Window.cc
→
src/Window.cc
@@ -3209,8 +3209,10 @@ client_move = true;
} frame().reconfigure(); - if (!initial && client_move) + if (!initial && client_move) { + Fluxbox::instance()->updateFrameExtents(*this); sendConfigureNotify(); + } }@@ -3936,9 +3938,6 @@ screen().updateNetizenConfigNotify(event);
} } // end for - if (send_to_netizens) { - Fluxbox::instance()->updateFrameExtents(*this); - } }