aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorsimonb <simonb>2006-06-24 14:05:19 (GMT)
committersimonb <simonb>2006-06-24 14:05:19 (GMT)
commit0b730c76b10babe20738067ae7aec5a102d451fe (patch)
tree727cc111eeffd9fe838a04d54da834b9d74b6905 /src/FbTk
parent1d0b23bd020c9185dc9cbf8952ab97a27f061be0 (diff)
downloadfluxbox_paul-0b730c76b10babe20738067ae7aec5a102d451fe.zip
fluxbox_paul-0b730c76b10babe20738067ae7aec5a102d451fe.tar.bz2
fix more x errors due to using an invalid background
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/FbWindow.cc5
-rw-r--r--src/FbTk/FbWindow.hh2
-rw-r--r--src/FbTk/TextButton.cc7
3 files changed, 11 insertions, 3 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index b996edc..090b788 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -153,6 +153,11 @@ void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) {
153 updateBackground(false); 153 updateBackground(false);
154} 154}
155 155
156void FbWindow::invalidateBackground() {
157 m_lastbg_pm = None;
158 m_lastbg_color_set = false;
159}
160
156void FbWindow::updateBackground(bool only_if_alpha) { 161void FbWindow::updateBackground(bool only_if_alpha) {
157 Pixmap newbg = m_lastbg_pm; 162 Pixmap newbg = m_lastbg_pm;
158 unsigned char alpha = 255; 163 unsigned char alpha = 255;
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh
index 8f7376c..1f0c4bd 100644
--- a/src/FbTk/FbWindow.hh
+++ b/src/FbTk/FbWindow.hh
@@ -74,6 +74,8 @@ public:
74 virtual ~FbWindow(); 74 virtual ~FbWindow();
75 virtual void setBackgroundColor(const FbTk::Color &bg_color); 75 virtual void setBackgroundColor(const FbTk::Color &bg_color);
76 virtual void setBackgroundPixmap(Pixmap bg_pixmap); 76 virtual void setBackgroundPixmap(Pixmap bg_pixmap);
77 // call when background is freed, and new one not ready yet
78 virtual void invalidateBackground();
77 virtual void setBorderColor(const FbTk::Color &border_color); 79 virtual void setBorderColor(const FbTk::Color &border_color);
78 virtual void setBorderWidth(unsigned int size); 80 virtual void setBorderWidth(unsigned int size);
79 /// set window name ("title") 81 /// set window name ("title")
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index 0d9eef0..474c094 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -63,8 +63,10 @@ void TextButton::setJustify(FbTk::Justify just) {
63} 63}
64 64
65bool TextButton::setOrientation(FbTk::Orientation orient) { 65bool TextButton::setOrientation(FbTk::Orientation orient) {
66 if (!m_font->validOrientation(orient)) 66 if (orient == m_orientation
67 || !m_font->validOrientation(orient))
67 return false; 68 return false;
69 invalidateBackground();
68 70
69 if ((m_orientation == FbTk::ROT0 || m_orientation == FbTk::ROT180) && 71 if ((m_orientation == FbTk::ROT0 || m_orientation == FbTk::ROT180) &&
70 (orient == FbTk::ROT90 || orient == FbTk::ROT270) || 72 (orient == FbTk::ROT90 || orient == FbTk::ROT270) ||
@@ -76,8 +78,7 @@ bool TextButton::setOrientation(FbTk::Orientation orient) {
76 } else { 78 } else {
77 m_orientation = orient; 79 m_orientation = orient;
78 } 80 }
79 updateBackground(false); 81
80 clear();
81 return true; 82 return true;
82} 83}
83 84