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.
This commit is contained in:
parent
c0f7258063
commit
f1c5abd17f
4 changed files with 20 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 0.9.13
|
Changes for 0.9.13
|
||||||
*05/04/27:
|
*05/04/27:
|
||||||
* Fix some initialisation, plus setting background too much (Simon)
|
* Fix some initialisation, plus setting background too much (Simon + Mathias)
|
||||||
FbWindow.cc
|
FbTk/FbWindow.cc/hh FbWinFrame.cc
|
||||||
* Add some extremely basic handling for icon pixmaps that aren't
|
* Add some extremely basic handling for icon pixmaps that aren't
|
||||||
the same depth as the screen (treat all as 1-bit, easy to handle)
|
the same depth as the screen (treat all as 1-bit, easy to handle)
|
||||||
(Simon)
|
(Simon)
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace FbTk {
|
||||||
|
|
||||||
FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0),
|
FbWindow::FbWindow():FbDrawable(), m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0),
|
||||||
m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true),
|
m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true),
|
||||||
m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0) {
|
m_lastbg_color_set(false), m_lastbg_color(0), m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ FbWindow::FbWindow(const FbWindow& the_copy):FbDrawable(),
|
||||||
m_border_width(the_copy.borderWidth()),
|
m_border_width(the_copy.borderWidth()),
|
||||||
m_depth(the_copy.depth()), m_destroy(true),
|
m_depth(the_copy.depth()), m_destroy(true),
|
||||||
m_lastbg_color_set(false), m_lastbg_color(0),
|
m_lastbg_color_set(false), m_lastbg_color(0),
|
||||||
m_lastbg_pm(0), m_renderer(the_copy.m_renderer) {
|
m_lastbg_pm(0), m_renderer(the_copy.m_renderer),
|
||||||
|
m_is_carrier(false) {
|
||||||
the_copy.m_window = 0;
|
the_copy.m_window = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ FbWindow::FbWindow(int screen_num,
|
||||||
m_destroy(true),
|
m_destroy(true),
|
||||||
m_lastbg_color_set(false),
|
m_lastbg_color_set(false),
|
||||||
m_lastbg_color(0),
|
m_lastbg_color(0),
|
||||||
m_lastbg_pm(0), m_renderer(0) {
|
m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
|
||||||
|
|
||||||
create(RootWindow(display(), screen_num),
|
create(RootWindow(display(), screen_num),
|
||||||
x, y, width, height, eventmask,
|
x, y, width, height, eventmask,
|
||||||
|
@ -93,7 +94,7 @@ FbWindow::FbWindow(const FbWindow &parent,
|
||||||
m_screen_num(parent.screenNumber()),
|
m_screen_num(parent.screenNumber()),
|
||||||
m_destroy(true),
|
m_destroy(true),
|
||||||
m_lastbg_color_set(false), m_lastbg_color(0),
|
m_lastbg_color_set(false), m_lastbg_color(0),
|
||||||
m_lastbg_pm(0), m_renderer(0) {
|
m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
|
||||||
|
|
||||||
create(parent.window(), x, y, width, height, eventmask,
|
create(parent.window(), x, y, width, height, eventmask,
|
||||||
override_redirect, save_unders, depth, class_type);
|
override_redirect, save_unders, depth, class_type);
|
||||||
|
@ -110,7 +111,7 @@ FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0),
|
||||||
m_depth(0),
|
m_depth(0),
|
||||||
m_destroy(false), // don't destroy this window
|
m_destroy(false), // don't destroy this window
|
||||||
m_lastbg_color_set(false), m_lastbg_color(0),
|
m_lastbg_color_set(false), m_lastbg_color(0),
|
||||||
m_lastbg_pm(0), m_renderer(0) {
|
m_lastbg_pm(0), m_renderer(0), m_is_carrier(false) {
|
||||||
|
|
||||||
setNew(client);
|
setNew(client);
|
||||||
}
|
}
|
||||||
|
@ -150,10 +151,14 @@ void FbWindow::setBackgroundPixmap(Pixmap bg_pixmap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FbWindow::updateBackground(bool only_if_alpha) {
|
void FbWindow::updateBackground(bool only_if_alpha) {
|
||||||
|
|
||||||
|
if (isCarrier())
|
||||||
|
return;
|
||||||
|
|
||||||
Pixmap newbg = m_lastbg_pm;
|
Pixmap newbg = m_lastbg_pm;
|
||||||
unsigned char alpha = 255;
|
unsigned char alpha = 255;
|
||||||
bool free_newbg = false;
|
bool free_newbg = false;
|
||||||
|
|
||||||
if (m_lastbg_pm == None && !m_lastbg_color_set)
|
if (m_lastbg_pm == None && !m_lastbg_color_set)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,9 @@ public:
|
||||||
void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; }
|
void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; }
|
||||||
void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height);
|
void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height);
|
||||||
|
|
||||||
|
/// this window is basicly a carrier and does not need background-updates
|
||||||
|
void setCarrier(bool flag) { m_is_carrier = flag; }
|
||||||
|
bool isCarrier() const { return m_is_carrier; }
|
||||||
/// forces full background change, recalcing of alpha values if necessary
|
/// forces full background change, recalcing of alpha values if necessary
|
||||||
void updateBackground(bool only_if_alpha);
|
void updateBackground(bool only_if_alpha);
|
||||||
|
|
||||||
|
@ -221,6 +224,8 @@ private:
|
||||||
Pixmap m_lastbg_pm;
|
Pixmap m_lastbg_pm;
|
||||||
|
|
||||||
FbWindowRenderer *m_renderer;
|
FbWindowRenderer *m_renderer;
|
||||||
|
|
||||||
|
bool m_is_carrier;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator == (Window win, const FbWindow &fbwin);
|
bool operator == (Window win, const FbWindow &fbwin);
|
||||||
|
|
|
@ -86,6 +86,8 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||||
m_themelistener(*this),
|
m_themelistener(*this),
|
||||||
m_shape(new Shape(m_window, theme.shapePlace())) {
|
m_shape(new Shape(m_window, theme.shapePlace())) {
|
||||||
m_theme.reconfigSig().attach(&m_themelistener);
|
m_theme.reconfigSig().attach(&m_themelistener);
|
||||||
|
m_window.setCarrier(true);
|
||||||
|
m_clientarea.setCarrier(true);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue