ignore XRandr events that don't actually change the screen size

This commit is contained in:
Mark Tiefenbruck 2008-10-14 19:40:33 -07:00
parent 7380a1f8f2
commit 9bd6401013
6 changed files with 25 additions and 22 deletions

View file

@ -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

View file

@ -60,7 +60,3 @@ FbRootWindow::FbRootWindow(int screen_num):
m_colormap = DefaultColormap(disp, screen_num);
}
}
void FbRootWindow::updateGeometry() {
FbTk::FbWindow::updateGeometry();
}

View file

@ -35,7 +35,6 @@ public:
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; }

View file

@ -583,16 +583,21 @@ void FbWindow::setOpaque(unsigned char alpha) {
#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,

View file

@ -199,13 +199,13 @@ public:
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
void setNew(Window win);

View file

@ -1868,18 +1868,18 @@ void BScreen::updateSize() {
// update xinerama layout
initXinerama();
// force update geometry
rootWindow().updateGeometry();
// check if window geometry has changed
if (rootWindow().updateGeometry()) {
// reset background
m_root_theme->reset();
// 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();
}
}