diff options
author | fluxgen <fluxgen> | 2006-07-16 15:55:19 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2006-07-16 15:55:19 (GMT) |
commit | 06320420a575ecb54a4d2099a971ffc24fa1d30d (patch) | |
tree | d7968eeaa0659d6c071bf04c8c7dd7b8ee178178 /src/FbTk | |
parent | fde970a21d62756cdbca1fe5acd75386b251814c (diff) | |
download | fluxbox-06320420a575ecb54a4d2099a971ffc24fa1d30d.zip fluxbox-06320420a575ecb54a4d2099a971ffc24fa1d30d.tar.bz2 |
Fixed bug #1362913, did not check format pointer.
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Transparent.cc | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc index 81aca99..a68b766 100644 --- a/src/FbTk/Transparent.cc +++ b/src/FbTk/Transparent.cc | |||
@@ -52,7 +52,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) { | |||
52 | PictFormatDepth | PictFormatAlphaMask, | 52 | PictFormatDepth | PictFormatAlphaMask, |
53 | &pic_format, 0); | 53 | &pic_format, 0); |
54 | if (format == 0) { | 54 | if (format == 0) { |
55 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")<<endl; | 55 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderFormat, |
56 | "Warning: Failed to find valid format for alpha.", | ||
57 | "transparency requires a pict format, can't get one...")<<endl; | ||
56 | return 0; | 58 | return 0; |
57 | } | 59 | } |
58 | 60 | ||
@@ -60,7 +62,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) { | |||
60 | Pixmap alpha_pm = XCreatePixmap(disp, drawable, | 62 | Pixmap alpha_pm = XCreatePixmap(disp, drawable, |
61 | 1, 1, 8); | 63 | 1, 1, 8); |
62 | if (alpha_pm == 0) { | 64 | if (alpha_pm == 0) { |
63 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap failed for our transparency pixmap")<<endl; | 65 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPixmap, |
66 | "Warning: Failed to create alpha pixmap.", | ||
67 | "XCreatePixmap failed for our transparency pixmap")<<endl; | ||
64 | return 0; | 68 | return 0; |
65 | } | 69 | } |
66 | 70 | ||
@@ -71,7 +75,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) { | |||
71 | format, CPRepeat, &attr); | 75 | format, CPRepeat, &attr); |
72 | if (alpha_pic == 0) { | 76 | if (alpha_pic == 0) { |
73 | XFreePixmap(disp, alpha_pm); | 77 | XFreePixmap(disp, alpha_pm); |
74 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPicture, "Warning: Failed to create alpha picture.", "XRenderCreatePicture failed")<<endl; | 78 | cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPicture, |
79 | "Warning: Failed to create alpha picture.", | ||
80 | "XRenderCreatePicture failed")<<endl; | ||
75 | return 0; | 81 | return 0; |
76 | } | 82 | } |
77 | 83 | ||
@@ -228,17 +234,22 @@ void Transparent::setDest(Drawable dest, int screen_num) { | |||
228 | // create new dest pic if we have a valid dest drawable | 234 | // create new dest pic if we have a valid dest drawable |
229 | if (dest != 0) { | 235 | if (dest != 0) { |
230 | 236 | ||
231 | XRenderPictFormat *format = | 237 | XRenderPictFormat *format = |
232 | XRenderFindVisualFormat(disp, | 238 | XRenderFindVisualFormat(disp, |
233 | DefaultVisual(disp, screen_num)); | 239 | DefaultVisual(disp, screen_num)); |
234 | if (format == 0) { | 240 | if (format == 0) { |
235 | _FB_USES_NLS; | 241 | _FB_USES_NLS; |
236 | cerr<<"FbTk::Transparent: "; | 242 | cerr<<"FbTk::Transparent: "; |
237 | fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num); | 243 | fprintf(stderr, |
244 | _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, | ||
245 | "Failed to find format for screen(%d)", | ||
246 | "XRenderFindVisualFormat failed... include %d for screen number"). | ||
247 | c_str(), screen_num); | ||
248 | |||
238 | cerr<<endl; | 249 | cerr<<endl; |
250 | } else { | ||
251 | m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0); | ||
239 | } | 252 | } |
240 | m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0); | ||
241 | |||
242 | 253 | ||
243 | } | 254 | } |
244 | m_dest = dest; | 255 | m_dest = dest; |
@@ -273,11 +284,15 @@ void Transparent::setSource(Drawable source, int screen_num) { | |||
273 | if (format == 0) { | 284 | if (format == 0) { |
274 | _FB_USES_NLS; | 285 | _FB_USES_NLS; |
275 | cerr<<"FbTk::Transparent: "; | 286 | cerr<<"FbTk::Transparent: "; |
276 | fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num); | 287 | fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, |
288 | "Failed to find format for screen(%d)", | ||
289 | "XRenderFindVisualFormat failed... include %d for screen number"). | ||
290 | c_str(), screen_num); | ||
277 | cerr<<endl; | 291 | cerr<<endl; |
292 | } else { | ||
293 | m_src_pic = XRenderCreatePicture(disp, m_source, format, | ||
294 | 0, 0); | ||
278 | } | 295 | } |
279 | m_src_pic = XRenderCreatePicture(disp, m_source, format, | ||
280 | 0, 0); | ||
281 | } | 296 | } |
282 | 297 | ||
283 | // recreate new alpha | 298 | // recreate new alpha |