ignore XRandr events that don't actually change the screen size
Mark Tiefenbruck mark@fluxbox.org
6 files changed,
25 insertions(+),
22 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,8 @@
(Format: Year/Month/Day) Changes for 1.1.2 +*08/10/15: + * Ignore XRandr events that don't change the screen size (Mark) + Screen.cc FbTk/FbWindow.cc/hh *08/10/13: * Merge menuDelay and menuDelayClose options in init (Mark) Screen.cc/hh FbTk/MenuTheme.cc/hh FbTk/Menu.cc
M
src/FbRootWindow.cc
→
src/FbRootWindow.cc
@@ -60,7 +60,3 @@ m_visual = DefaultVisual(disp, screen_num);
m_colormap = DefaultColormap(disp, screen_num); } } - -void FbRootWindow::updateGeometry() { - FbTk::FbWindow::updateGeometry(); -}
M
src/FbRootWindow.hh
→
src/FbRootWindow.hh
@@ -35,7 +35,6 @@ void show() { }
void hide() { } // we should not assign a new window to this FbTk::FbWindow &operator = (Window win) { return *this; } - void updateGeometry(); Visual *visual() const { return m_visual; } Colormap colormap() const { return m_colormap; }
M
src/FbTk/FbWindow.cc
→
src/FbTk/FbWindow.cc
@@ -583,16 +583,21 @@ changeProperty(m_alphaatom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1l);
#endif // HAVE_XRENDER } -void FbWindow::updateGeometry() { +bool FbWindow::updateGeometry() { if (m_window == 0) - return; + return false; + + int old_x = m_x, old_y = m_y; + unsigned int old_width = m_width, old_height = m_height; Window root; unsigned int border_width, depth; if (XGetGeometry(display(), m_window, &root, &m_x, &m_y, - (unsigned int *)&m_width, (unsigned int *)&m_height, - &border_width, &depth)) + &m_width, &m_height, &border_width, &depth)) m_depth = depth; + + return (old_x != m_x || old_y != m_y || old_width != m_width || + old_height != m_height); } void FbWindow::create(Window parent, int x, int y,
M
src/FbTk/FbWindow.hh
→
src/FbTk/FbWindow.hh
@@ -199,12 +199,12 @@ void updateBackground(bool only_if_alpha);
static void updatedAlphaBackground(int screen); + /// updates x,y, width, height and screen num from X window + bool updateGeometry(); + protected: /// creates a window with x window client (m_window = client) explicit FbWindow(Window client); - - /// updates x,y, width, height and screen num from X window - void updateGeometry(); private: /// sets new X window and destroys old
M
src/Screen.cc
→
src/Screen.cc
@@ -1868,18 +1868,18 @@ void BScreen::updateSize() {
// update xinerama layout initXinerama(); - // force update geometry - rootWindow().updateGeometry(); - - // reset background - m_root_theme->reset(); + // check if window geometry has changed + if (rootWindow().updateGeometry()) { + // reset background + m_root_theme->reset(); - // send resize notify - m_resize_sig.emit(*this); - m_workspace_area_sig.emit(*this); + // send resize notify + m_resize_sig.emit(*this); + m_workspace_area_sig.emit(*this); - // move windows out of inactive heads - clearHeads(); + // move windows out of inactive heads + clearHeads(); + } }