diff options
author | fluxgen <fluxgen> | 2003-09-14 09:51:40 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-09-14 09:51:40 (GMT) |
commit | c8bcddf58b406b67c268aed38d7779816da0424b (patch) | |
tree | 9e4ad9e22187167884fc2bb46aa3dca76a3aa3c4 /src/FbTk/FbWindow.cc | |
parent | 1111861bd245d23613446d09fc299b0e15bfd42a (diff) | |
download | fluxbox-c8bcddf58b406b67c268aed38d7779816da0424b.zip fluxbox-c8bcddf58b406b67c268aed38d7779816da0424b.tar.bz2 |
buffered background
Diffstat (limited to 'src/FbTk/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 6a623d9..f2201d1 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWindow.cc,v 1.25 2003/08/26 23:45:36 fluxgen Exp $ | 22 | // $Id: FbWindow.cc,v 1.26 2003/09/14 09:51:40 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWindow.hh" | 24 | #include "FbWindow.hh" |
25 | 25 | ||
@@ -66,7 +66,8 @@ Pixmap getRootPixmap(int screen_num) { | |||
66 | Display *FbWindow::s_display = 0; | 66 | Display *FbWindow::s_display = 0; |
67 | 67 | ||
68 | FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), | 68 | FbWindow::FbWindow():m_parent(0), m_screen_num(0), m_window(0), m_x(0), m_y(0), |
69 | m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true) { | 69 | m_width(0), m_height(0), m_border_width(0), m_depth(0), m_destroy(true), |
70 | m_buffer_pm(0) { | ||
70 | 71 | ||
71 | if (s_display == 0) | 72 | if (s_display == 0) |
72 | s_display = App::instance()->display(); | 73 | s_display = App::instance()->display(); |
@@ -77,7 +78,8 @@ FbWindow::FbWindow(const FbWindow& the_copy):m_parent(the_copy.parent()), | |||
77 | m_x(the_copy.x()), m_y(the_copy.y()), | 78 | m_x(the_copy.x()), m_y(the_copy.y()), |
78 | m_width(the_copy.width()), m_height(the_copy.height()), | 79 | m_width(the_copy.width()), m_height(the_copy.height()), |
79 | m_border_width(the_copy.borderWidth()), | 80 | m_border_width(the_copy.borderWidth()), |
80 | m_depth(the_copy.depth()), m_destroy(true) { | 81 | m_depth(the_copy.depth()), m_destroy(true), |
82 | m_buffer_pm(0) { | ||
81 | if (s_display == 0) | 83 | if (s_display == 0) |
82 | s_display = App::instance()->display(); | 84 | s_display = App::instance()->display(); |
83 | 85 | ||
@@ -92,7 +94,8 @@ FbWindow::FbWindow(int screen_num, | |||
92 | int depth, | 94 | int depth, |
93 | int class_type): | 95 | int class_type): |
94 | m_screen_num(screen_num), | 96 | m_screen_num(screen_num), |
95 | m_parent(0), m_destroy(true) { | 97 | m_parent(0), m_destroy(true), |
98 | m_buffer_pm(0) { | ||
96 | 99 | ||
97 | create(RootWindow(FbTk::App::instance()->display(), screen_num), | 100 | create(RootWindow(FbTk::App::instance()->display(), screen_num), |
98 | x, y, width, height, eventmask, | 101 | x, y, width, height, eventmask, |
@@ -105,7 +108,8 @@ FbWindow::FbWindow(const FbWindow &parent, | |||
105 | bool override_redirect, | 108 | bool override_redirect, |
106 | int depth, int class_type): | 109 | int depth, int class_type): |
107 | m_parent(&parent), | 110 | m_parent(&parent), |
108 | m_screen_num(parent.screenNumber()), m_destroy(true) { | 111 | m_screen_num(parent.screenNumber()), m_destroy(true), |
112 | m_buffer_pm(0) { | ||
109 | 113 | ||
110 | create(parent.window(), x, y, width, height, eventmask, | 114 | create(parent.window(), x, y, width, height, eventmask, |
111 | override_redirect, depth, class_type); | 115 | override_redirect, depth, class_type); |
@@ -115,7 +119,8 @@ FbWindow::FbWindow(const FbWindow &parent, | |||
115 | 119 | ||
116 | FbWindow::FbWindow(Window client):m_parent(0), m_window(0), | 120 | FbWindow::FbWindow(Window client):m_parent(0), m_window(0), |
117 | m_screen_num(0), | 121 | m_screen_num(0), |
118 | m_destroy(false) { // don't destroy this window | 122 | m_destroy(false), // don't destroy this window |
123 | m_buffer_pm(0) { | ||
119 | 124 | ||
120 | setNew(client); | 125 | setNew(client); |
121 | } | 126 | } |
@@ -189,9 +194,14 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u | |||
189 | if (m_transparent->source() != root) | 194 | if (m_transparent->source() != root) |
190 | m_transparent->setSource(root, screenNumber()); | 195 | m_transparent->setSource(root, screenNumber()); |
191 | 196 | ||
192 | if (m_transparent->dest() != window()) | 197 | if (m_buffer_pm) { |
198 | if (m_transparent->dest() != m_buffer_pm) { | ||
199 | m_transparent->setDest(m_buffer_pm, screenNumber()); | ||
200 | } | ||
201 | } else if (m_transparent->dest() != window()) | ||
193 | m_transparent->setDest(window(), screenNumber()); | 202 | m_transparent->setDest(window(), screenNumber()); |
194 | 203 | ||
204 | |||
195 | // get root position | 205 | // get root position |
196 | 206 | ||
197 | const FbWindow *root_parent = parent(); | 207 | const FbWindow *root_parent = parent(); |
@@ -368,6 +378,10 @@ long FbWindow::eventMask() const { | |||
368 | return 0; | 378 | return 0; |
369 | } | 379 | } |
370 | 380 | ||
381 | void FbWindow::setBufferPixmap(Pixmap pm) { | ||
382 | m_buffer_pm = pm; | ||
383 | } | ||
384 | |||
371 | void FbWindow::updateGeometry() { | 385 | void FbWindow::updateGeometry() { |
372 | if (m_window == 0) | 386 | if (m_window == 0) |
373 | return; | 387 | return; |