aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorsimonb <simonb>2005-04-28 14:20:59 (GMT)
committersimonb <simonb>2005-04-28 14:20:59 (GMT)
commit94e3fa88fcede0b0e20d39dd577c85d9321b415d (patch)
treefc5e1483ff32065e8fb79431dc667c3dfda2d590 /src/FbTk
parentf1c5abd17ffd572a7586d396622c2891881e5ca4 (diff)
downloadfluxbox_paul-94e3fa88fcede0b0e20d39dd577c85d9321b415d.zip
fluxbox_paul-94e3fa88fcede0b0e20d39dd577c85d9321b415d.tar.bz2
revert mathias last change, and fix it differently using info already
there
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/FbWindow.cc23
-rw-r--r--src/FbTk/FbWindow.hh5
2 files changed, 9 insertions, 19 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index d3a7736..de6b197 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -46,7 +46,7 @@ namespace FbTk {
46 46
47FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), 47FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0),
48 m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true), 48 m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true),
49 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) { 49 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0) {
50 50
51} 51}
52 52
@@ -58,8 +58,7 @@ FbWindow::FbWindow(const FbWindow& the_copy):FbDrawable(),
58 m_border_width(the_copy.borderWidth()), 58 m_border_width(the_copy.borderWidth()),
59 m_depth(the_copy.depth()), m_destroy(true), 59 m_depth(the_copy.depth()), m_destroy(true),
60 m_lastbg_color_set(false), m_lastbg_color(0), 60 m_lastbg_color_set(false), m_lastbg_color(0),
61 m_lastbg_pm(0), m_renderer(the_copy.m_renderer), 61 m_lastbg_pm(0), m_renderer(the_copy.m_renderer) {
62 m_is_carrier(false) {
63 the_copy.m_window = 0; 62 the_copy.m_window = 0;
64} 63}
65 64
@@ -77,7 +76,7 @@ FbWindow::FbWindow(int screen_num,
77 m_destroy(true), 76 m_destroy(true),
78 m_lastbg_color_set(false), 77 m_lastbg_color_set(false),
79 m_lastbg_color(0), 78 m_lastbg_color(0),
80 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) { 79 m_lastbg_pm(0), m_renderer(0) {
81 80
82 create(RootWindow(display(), screen_num), 81 create(RootWindow(display(), screen_num),
83 x, y, width, height, eventmask, 82 x, y, width, height, eventmask,
@@ -94,7 +93,7 @@ FbWindow::FbWindow(const FbWindow &parent,
94 m_screen_num(parent.screenNumber()), 93 m_screen_num(parent.screenNumber()),
95 m_destroy(true), 94 m_destroy(true),
96 m_lastbg_color_set(false), m_lastbg_color(0), 95 m_lastbg_color_set(false), m_lastbg_color(0),
97 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) { 96 m_lastbg_pm(0), m_renderer(0) {
98 97
99 create(parent.window(), x, y, width, height, eventmask, 98 create(parent.window(), x, y, width, height, eventmask,
100 override_redirect, save_unders, depth, class_type); 99 override_redirect, save_unders, depth, class_type);
@@ -111,7 +110,7 @@ FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0),
111 m_depth(0), 110 m_depth(0),
112 m_destroy(false), // don't destroy this window 111 m_destroy(false), // don't destroy this window
113 m_lastbg_color_set(false), m_lastbg_color(0), 112 m_lastbg_color_set(false), m_lastbg_color(0),
114 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) { 113 m_lastbg_pm(0), m_renderer(0) {
115 114
116 setNew(client); 115 setNew(client);
117} 116}
@@ -151,14 +150,10 @@ void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) {
151} 150}
152 151
153void FbWindow::updateBackground(bool only_if_alpha) { 152void FbWindow::updateBackground(bool only_if_alpha) {
154
155 if (isCarrier())
156 return;
157
158 Pixmap newbg = m_lastbg_pm; 153 Pixmap newbg = m_lastbg_pm;
159 unsigned char alpha = 255; 154 unsigned char alpha = 255;
160 bool free_newbg = false; 155 bool free_newbg = false;
161 156
162 if (m_lastbg_pm == None && !m_lastbg_color_set) 157 if (m_lastbg_pm == None && !m_lastbg_color_set)
163 return; 158 return;
164 159
@@ -168,9 +163,9 @@ void FbWindow::updateBackground(bool only_if_alpha) {
168 if (only_if_alpha && alpha == 255) 163 if (only_if_alpha && alpha == 255)
169 return; 164 return;
170 165
171 // still use bg buffer pixmap if transparent 166 // still use bg buffer pixmap if not transparent
172 // cause it does nice caching things 167 // cause it does nice caching things, assuming we have a renderer
173 if (m_lastbg_pm != ParentRelative) { 168 if (m_lastbg_pm != ParentRelative && (m_renderer || alpha != 255)) {
174 // update source and destination if needed 169 // update source and destination if needed
175 Pixmap root = FbPixmap::getRootPixmap(screenNumber()); 170 Pixmap root = FbPixmap::getRootPixmap(screenNumber());
176 if (alpha != 255 && m_transparent->source() != root) 171 if (alpha != 255 && m_transparent->source() != root)
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh
index a630f4f..b08df5e 100644
--- a/src/FbTk/FbWindow.hh
+++ b/src/FbTk/FbWindow.hh
@@ -187,9 +187,6 @@ public:
187 void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; } 187 void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; }
188 void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height); 188 void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height);
189 189
190 /// this window is basicly a carrier and does not need background-updates
191 void setCarrier(bool flag) { m_is_carrier = flag; }
192 bool isCarrier() const { return m_is_carrier; }
193 /// forces full background change, recalcing of alpha values if necessary 190 /// forces full background change, recalcing of alpha values if necessary
194 void updateBackground(bool only_if_alpha); 191 void updateBackground(bool only_if_alpha);
195 192
@@ -224,8 +221,6 @@ private:
224 Pixmap m_lastbg_pm; 221 Pixmap m_lastbg_pm;
225 222
226 FbWindowRenderer *m_renderer; 223 FbWindowRenderer *m_renderer;
227
228 bool m_is_carrier;
229}; 224};
230 225
231bool operator == (Window win, const FbWindow &fbwin); 226bool operator == (Window win, const FbWindow &fbwin);