aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/FbWindow.cc23
-rw-r--r--src/FbTk/FbWindow.hh5
-rw-r--r--src/FbWinFrame.cc2
3 files changed, 9 insertions, 21 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);
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 8313f4a..a1745ef 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -86,8 +86,6 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
86 m_themelistener(*this), 86 m_themelistener(*this),
87 m_shape(new Shape(m_window, theme.shapePlace())) { 87 m_shape(new Shape(m_window, theme.shapePlace())) {
88 m_theme.reconfigSig().attach(&m_themelistener); 88 m_theme.reconfigSig().attach(&m_themelistener);
89 m_window.setCarrier(true);
90 m_clientarea.setCarrier(true);
91 init(); 89 init();
92} 90}
93 91