aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authormathias <mathias>2005-04-27 21:18:41 (GMT)
committermathias <mathias>2005-04-27 21:18:41 (GMT)
commitf1c5abd17ffd572a7586d396622c2891881e5ca4 (patch)
treee4f8eaaf1f7f67ff657ff5de9ce989bd38216970 /src/FbTk
parentc0f725806323e370d8eda922e680a0b17db17175 (diff)
downloadfluxbox-f1c5abd17ffd572a7586d396622c2891881e5ca4.zip
fluxbox-f1c5abd17ffd572a7586d396622c2891881e5ca4.tar.bz2
i added an attribute to FbWindow to mark windows which are only used as
"carrier" (maybe a temporarly name?) ... carriers dont need background-updates .. ever. this leads to a big performance"boost" over the last commits. before we updated also the windows which are the hosts for the apps (m_window and m_clientarea in FbWinFrame) -> bad idea.
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/FbWindow.cc17
-rw-r--r--src/FbTk/FbWindow.hh5
2 files changed, 16 insertions, 6 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 5a6417f..d3a7736 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) { 49 m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
50 50
51} 51}
52 52
@@ -58,7 +58,8 @@ 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) {
62 the_copy.m_window = 0; 63 the_copy.m_window = 0;
63} 64}
64 65
@@ -76,7 +77,7 @@ FbWindow::FbWindow(int screen_num,
76 m_destroy(true), 77 m_destroy(true),
77 m_lastbg_color_set(false), 78 m_lastbg_color_set(false),
78 m_lastbg_color(0), 79 m_lastbg_color(0),
79 m_lastbg_pm(0), m_renderer(0) { 80 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
80 81
81 create(RootWindow(display(), screen_num), 82 create(RootWindow(display(), screen_num),
82 x, y, width, height, eventmask, 83 x, y, width, height, eventmask,
@@ -93,7 +94,7 @@ FbWindow::FbWindow(const FbWindow &parent,
93 m_screen_num(parent.screenNumber()), 94 m_screen_num(parent.screenNumber()),
94 m_destroy(true), 95 m_destroy(true),
95 m_lastbg_color_set(false), m_lastbg_color(0), 96 m_lastbg_color_set(false), m_lastbg_color(0),
96 m_lastbg_pm(0), m_renderer(0) { 97 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
97 98
98 create(parent.window(), x, y, width, height, eventmask, 99 create(parent.window(), x, y, width, height, eventmask,
99 override_redirect, save_unders, depth, class_type); 100 override_redirect, save_unders, depth, class_type);
@@ -110,7 +111,7 @@ FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0),
110 m_depth(0), 111 m_depth(0),
111 m_destroy(false), // don't destroy this window 112 m_destroy(false), // don't destroy this window
112 m_lastbg_color_set(false), m_lastbg_color(0), 113 m_lastbg_color_set(false), m_lastbg_color(0),
113 m_lastbg_pm(0), m_renderer(0) { 114 m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
114 115
115 setNew(client); 116 setNew(client);
116} 117}
@@ -150,10 +151,14 @@ void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) {
150} 151}
151 152
152void FbWindow::updateBackground(bool only_if_alpha) { 153void FbWindow::updateBackground(bool only_if_alpha) {
154
155 if (isCarrier())
156 return;
157
153 Pixmap newbg = m_lastbg_pm; 158 Pixmap newbg = m_lastbg_pm;
154 unsigned char alpha = 255; 159 unsigned char alpha = 255;
155 bool free_newbg = false; 160 bool free_newbg = false;
156 161
157 if (m_lastbg_pm == None && !m_lastbg_color_set) 162 if (m_lastbg_pm == None && !m_lastbg_color_set)
158 return; 163 return;
159 164
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh
index b08df5e..a630f4f 100644
--- a/src/FbTk/FbWindow.hh
+++ b/src/FbTk/FbWindow.hh
@@ -187,6 +187,9 @@ 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; }
190 /// forces full background change, recalcing of alpha values if necessary 193 /// forces full background change, recalcing of alpha values if necessary
191 void updateBackground(bool only_if_alpha); 194 void updateBackground(bool only_if_alpha);
192 195
@@ -221,6 +224,8 @@ private:
221 Pixmap m_lastbg_pm; 224 Pixmap m_lastbg_pm;
222 225
223 FbWindowRenderer *m_renderer; 226 FbWindowRenderer *m_renderer;
227
228 bool m_is_carrier;
224}; 229};
225 230
226bool operator == (Window win, const FbWindow &fbwin); 231bool operator == (Window win, const FbWindow &fbwin);