aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2005-04-27 17:45:56 (GMT)
committersimonb <simonb>2005-04-27 17:45:56 (GMT)
commit690030444b984e6b348284ae3c88671ee65a530b (patch)
treea0e36a3de8afa6a867f395a37757343e9577a24d /src/FbTk/FbPixmap.cc
parent9970dd11c7f9c0d9d91601c9e9785a857ca2c6d8 (diff)
downloadfluxbox-690030444b984e6b348284ae3c88671ee65a530b.zip
fluxbox-690030444b984e6b348284ae3c88671ee65a530b.tar.bz2
add rough support for non-default depth pixmaps. Saves us having ghost
holes in windows
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r--src/FbTk/FbPixmap.cc28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index e573945..b2937c3 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -139,7 +139,8 @@ void FbPixmap::copy(const FbPixmap &the_copy) {
139 } 139 }
140} 140}
141 141
142void FbPixmap::copy(Pixmap pm) { 142// screen doesn't count if depth is "zero"...
143void FbPixmap::copy(Pixmap pm, int depth, int screen_num) {
143 free(); 144 free();
144 if (pm == 0) 145 if (pm == 0)
145 return; 146 return;
@@ -157,15 +158,28 @@ void FbPixmap::copy(Pixmap pm) {
157 &new_width, &new_height, 158 &new_width, &new_height,
158 &border_width, 159 &border_width,
159 &bpp); 160 &bpp);
161
162 if (depth == 0)
163 depth = bpp;
164
160 // create new pixmap and copy area 165 // create new pixmap and copy area
161 create(root, new_width, new_height, bpp); 166 create(root, new_width, new_height, depth);
162 167
163 GC gc = XCreateGC(display(), drawable(), 0, 0); 168 GC gc = XCreateGC(display(), drawable(), 0, 0);
164 169
165 XCopyArea(display(), pm, drawable(), gc, 170 if (depth == bpp) {
166 0, 0, 171 XCopyArea(display(), pm, drawable(), gc,
167 width(), height(), 172 0, 0,
168 0, 0); 173 width(), height(),
174 0, 0);
175 } else {
176 XSetForeground(display(), gc, Color("black", screen_num).pixel());
177 XSetBackground(display(), gc, Color("white", screen_num).pixel());
178 XCopyPlane(display(), pm, drawable(), gc,
179 0, 0,
180 width(), height(),
181 0, 0, 1);
182 }
169 183
170 XFreeGC(display(), gc); 184 XFreeGC(display(), gc);
171} 185}
@@ -254,7 +268,7 @@ void FbPixmap::tile(unsigned int dest_width, unsigned int dest_height) {
254 268
255 FbPixmap new_pm(drawable(), width(), height(), depth()); 269 FbPixmap new_pm(drawable(), width(), height(), depth());
256 270
257 new_pm.copy(m_pm); 271 new_pm.copy(m_pm, 0, 0);
258 272
259 resize(dest_width, dest_height); 273 resize(dest_width, dest_height);
260 274