aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
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);