|
|
d01ed22 |
Imlib picks visual with highest possible depth, which are ARGB visuals in
|
|
|
d01ed22 |
case Composite extensions are in use, and which it can not handle. Use the
|
|
|
d01ed22 |
default, RGB, instead.
|
|
|
d01ed22 |
|
|
|
d01ed22 |
Lubomir Rintel <lkundrak@v3.sk>
|
|
|
d01ed22 |
|
|
|
d01ed22 |
diff -up xteddy-2.0.1/xteddy.c.visual xteddy-2.0.1/xteddy.c
|
|
|
d01ed22 |
--- xteddy-2.0.1/xteddy.c.visual 2008-12-04 12:30:18.000000000 +0100
|
|
|
d01ed22 |
+++ xteddy-2.0.1/xteddy.c 2008-12-04 12:30:21.000000000 +0100
|
|
|
d01ed22 |
@@ -122,6 +122,8 @@ int main(int argc, char **argv)
|
|
|
d01ed22 |
Cursor cursor;
|
|
|
d01ed22 |
char *teddy;
|
|
|
d01ed22 |
char *file;
|
|
|
d01ed22 |
+ ImlibInitParams params;
|
|
|
d01ed22 |
+ Visual *visual;
|
|
|
d01ed22 |
|
|
|
d01ed22 |
/* Window movement variables */
|
|
|
d01ed22 |
XWindowChanges winchanges;
|
|
|
d01ed22 |
@@ -172,7 +174,12 @@ int main(int argc, char **argv)
|
|
|
d01ed22 |
display_width = DisplayWidth(display, screen_num);
|
|
|
d01ed22 |
display_height = DisplayHeight(display, screen_num);
|
|
|
d01ed22 |
|
|
|
d01ed22 |
- if ( !(id=Imlib_init(display)) ) return -1;
|
|
|
d01ed22 |
+ /* Determine the correct visual */
|
|
|
d01ed22 |
+ visual = DefaultVisual(display, screen_num);
|
|
|
d01ed22 |
+ params.flags = PARAMS_VISUALID;
|
|
|
d01ed22 |
+ params.visualid = visual->visualid;
|
|
|
d01ed22 |
+
|
|
|
d01ed22 |
+ if ( !(id=Imlib_init_with_params(display, ¶ms)) ) return -1;
|
|
|
d01ed22 |
if ( !(file = InitTeddy(teddy)) ) {
|
|
|
d01ed22 |
fprintf(stderr, "Can not find any image with name %s.\n", teddy);
|
|
|
d01ed22 |
return -1;
|