summaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-15 02:40:33 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-15 02:40:33 (GMT)
commit9bd64010135e26f97fa4d4d551737847fedfbcdd (patch)
treede54d9641c4923b153d3d79ccc25ac414e22574b /src/FbTk
parent7380a1f8f2292f0cbc00bdb8d2e7fc0ded84f816 (diff)
downloadfluxbox_lack-9bd64010135e26f97fa4d4d551737847fedfbcdd.zip
fluxbox_lack-9bd64010135e26f97fa4d4d551737847fedfbcdd.tar.bz2
ignore XRandr events that don't actually change the screen size
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/FbWindow.cc13
-rw-r--r--src/FbTk/FbWindow.hh6
2 files changed, 12 insertions, 7 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 56f354b..2ef24fa 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -583,16 +583,21 @@ void FbWindow::setOpaque(unsigned char alpha) {
583#endif // HAVE_XRENDER 583#endif // HAVE_XRENDER
584} 584}
585 585
586void FbWindow::updateGeometry() { 586bool FbWindow::updateGeometry() {
587 if (m_window == 0) 587 if (m_window == 0)
588 return; 588 return false;
589
590 int old_x = m_x, old_y = m_y;
591 unsigned int old_width = m_width, old_height = m_height;
589 592
590 Window root; 593 Window root;
591 unsigned int border_width, depth; 594 unsigned int border_width, depth;
592 if (XGetGeometry(display(), m_window, &root, &m_x, &m_y, 595 if (XGetGeometry(display(), m_window, &root, &m_x, &m_y,
593 (unsigned int *)&m_width, (unsigned int *)&m_height, 596 &m_width, &m_height, &border_width, &depth))
594 &border_width, &depth))
595 m_depth = depth; 597 m_depth = depth;
598
599 return (old_x != m_x || old_y != m_y || old_width != m_width ||
600 old_height != m_height);
596} 601}
597 602
598void FbWindow::create(Window parent, int x, int y, 603void FbWindow::create(Window parent, int x, int y,
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh
index a80a5b0..edeffe1 100644
--- a/src/FbTk/FbWindow.hh
+++ b/src/FbTk/FbWindow.hh
@@ -199,13 +199,13 @@ public:
199 199
200 static void updatedAlphaBackground(int screen); 200 static void updatedAlphaBackground(int screen);
201 201
202 /// updates x,y, width, height and screen num from X window
203 bool updateGeometry();
204
202protected: 205protected:
203 /// creates a window with x window client (m_window = client) 206 /// creates a window with x window client (m_window = client)
204 explicit FbWindow(Window client); 207 explicit FbWindow(Window client);
205 208
206 /// updates x,y, width, height and screen num from X window
207 void updateGeometry();
208
209private: 209private:
210 /// sets new X window and destroys old 210 /// sets new X window and destroys old
211 void setNew(Window win); 211 void setNew(Window win);