aboutsummaryrefslogtreecommitdiff
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
parent7380a1f8f2292f0cbc00bdb8d2e7fc0ded84f816 (diff)
downloadfluxbox-9bd64010135e26f97fa4d4d551737847fedfbcdd.zip
fluxbox-9bd64010135e26f97fa4d4d551737847fedfbcdd.tar.bz2
ignore XRandr events that don't actually change the screen size
-rw-r--r--ChangeLog3
-rw-r--r--src/FbRootWindow.cc4
-rw-r--r--src/FbRootWindow.hh1
-rw-r--r--src/FbTk/FbWindow.cc13
-rw-r--r--src/FbTk/FbWindow.hh6
-rw-r--r--src/Screen.cc20
6 files changed, 25 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 675b073..5eeda89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1.2 2Changes for 1.1.2
3*08/10/15:
4 * Ignore XRandr events that don't change the screen size (Mark)
5 Screen.cc FbTk/FbWindow.cc/hh
3*08/10/13: 6*08/10/13:
4 * Merge menuDelay and menuDelayClose options in init (Mark) 7 * Merge menuDelay and menuDelayClose options in init (Mark)
5 Screen.cc/hh FbTk/MenuTheme.cc/hh FbTk/Menu.cc 8 Screen.cc/hh FbTk/MenuTheme.cc/hh FbTk/Menu.cc
diff --git a/src/FbRootWindow.cc b/src/FbRootWindow.cc
index a3e4bc3..7e2b77e 100644
--- a/src/FbRootWindow.cc
+++ b/src/FbRootWindow.cc
@@ -60,7 +60,3 @@ FbRootWindow::FbRootWindow(int screen_num):
60 m_colormap = DefaultColormap(disp, screen_num); 60 m_colormap = DefaultColormap(disp, screen_num);
61 } 61 }
62} 62}
63
64void FbRootWindow::updateGeometry() {
65 FbTk::FbWindow::updateGeometry();
66}
diff --git a/src/FbRootWindow.hh b/src/FbRootWindow.hh
index 325bab3..34b8219 100644
--- a/src/FbRootWindow.hh
+++ b/src/FbRootWindow.hh
@@ -35,7 +35,6 @@ public:
35 void hide() { } 35 void hide() { }
36 // we should not assign a new window to this 36 // we should not assign a new window to this
37 FbTk::FbWindow &operator = (Window win) { return *this; } 37 FbTk::FbWindow &operator = (Window win) { return *this; }
38 void updateGeometry();
39 Visual *visual() const { return m_visual; } 38 Visual *visual() const { return m_visual; }
40 Colormap colormap() const { return m_colormap; } 39 Colormap colormap() const { return m_colormap; }
41 40
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);
diff --git a/src/Screen.cc b/src/Screen.cc
index 776dd29..8b605e7 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1868,18 +1868,18 @@ void BScreen::updateSize() {
1868 // update xinerama layout 1868 // update xinerama layout
1869 initXinerama(); 1869 initXinerama();
1870 1870
1871 // force update geometry 1871 // check if window geometry has changed
1872 rootWindow().updateGeometry(); 1872 if (rootWindow().updateGeometry()) {
1873 // reset background
1874 m_root_theme->reset();
1873 1875
1874 // reset background 1876 // send resize notify
1875 m_root_theme->reset(); 1877 m_resize_sig.emit(*this);
1876 1878 m_workspace_area_sig.emit(*this);
1877 // send resize notify
1878 m_resize_sig.emit(*this);
1879 m_workspace_area_sig.emit(*this);
1880 1879
1881 // move windows out of inactive heads 1880 // move windows out of inactive heads
1882 clearHeads(); 1881 clearHeads();
1882 }
1883} 1883}
1884 1884
1885 1885