summaryrefslogtreecommitdiff
path: root/src/FbTk/Transparent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Transparent.cc')
-rw-r--r--src/FbTk/Transparent.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc
index 7c14849..39b0eff 100644
--- a/src/FbTk/Transparent.cc
+++ b/src/FbTk/Transparent.cc
@@ -206,6 +206,17 @@ void Transparent::setAlpha(unsigned char alpha) {
206 allocAlpha(alpha); 206 allocAlpha(alpha);
207} 207}
208 208
209void Transparent::freeDest() {
210#ifdef HAVE_XRENDER
211 if (m_dest_pic != 0) {
212 Display *disp = FbTk::App::instance()->display();
213 XRenderFreePicture(disp, m_dest_pic);
214 m_dest_pic = 0;
215 }
216 m_dest = None;
217#endif
218}
219
209void Transparent::setDest(Drawable dest, int screen_num) { 220void Transparent::setDest(Drawable dest, int screen_num) {
210#ifdef HAVE_XRENDER 221#ifdef HAVE_XRENDER
211 if (m_dest == dest || !s_render) 222 if (m_dest == dest || !s_render)
@@ -213,10 +224,7 @@ void Transparent::setDest(Drawable dest, int screen_num) {
213 224
214 Display *disp = FbTk::App::instance()->display(); 225 Display *disp = FbTk::App::instance()->display();
215 226
216 if (m_dest_pic != 0) { 227 freeDest();
217 XRenderFreePicture(disp, m_dest_pic);
218 m_dest_pic = 0;
219 }
220 // create new dest pic if we have a valid dest drawable 228 // create new dest pic if we have a valid dest drawable
221 if (dest != 0) { 229 if (dest != 0) {
222 230