Bug 89313 - kuickshow don't display images with xorg 6.8
Summary: kuickshow don't display images with xorg 6.8
Status: RESOLVED FIXED
Alias: None
Product: kuickshow
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
: 91318 96373 100785 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-11 20:40 UTC by Frank Hellmuth
Modified: 2007-01-29 09:29 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Hellmuth 2004-09-11 20:40:33 UTC
Version:           0.8.6 (using KDE 3.3.89 (CVS >= 20040820), Gentoo)
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.8-rc2

After switching from xfree tp xorg 6.8 kuickshow just shows black windows instead of the image, no error messages shows up. Recompiling kuickshow from CVS doesn't help. kview doesn't suffer from that problem, so it seems not a qt or kdelibs problen, but kuickshow specific.

$ kuickshow --version
Qt: 3.3.2
KDE: 3.3.89 (CVS >= 20040820)
KuickShow: 0.8.6
Comment 1 Heiko Liebfried 2004-09-12 14:03:41 UTC
Same problem here.
Gentoo 
kuickshow 0.8.6 (kde 3.3)
gcc-3.3.4-r1
Kde 3.3 stable
Qt 3.3.3
2.6.7-gentoo-r13

Preview window of kuickshow works, but the normal picture window is black in normal and fullscreen mode.

There is no output in any consoles when loading pictures with kuickshow.
Other Kde picture applications like kview work as expected.
Comment 2 Heiko Liebfried 2004-09-12 14:10:35 UTC
! Update:
When the extension 'composite' in xorg.conf is commented out the bug disappears
and kuickshow works with xorg 6.8.
Comment 3 Frank Hellmuth 2004-09-12 14:28:49 UTC
Confirmed!

Disabling the "Composite" extension in /etx/X11/xorg.conf makes kuickshow working again.

Thank you, Heiko!
Comment 4 Dik Takken 2004-09-12 22:13:01 UTC
Errr.. I guess this is a "won't fix" because the Composite extension is not stable yet?
Comment 5 Karol Pucyński 2004-09-15 22:43:55 UTC
I have this bug too...

Slackware current
Qt: 3.3.3
KDE: 3.3.0
KuickShow: 0.8.6
X.org 6.8.0 with Composite enabled
Comment 6 Frank Hellmuth 2004-09-17 15:21:54 UTC
Taking a look at the sources, it looks like kuickshow uses imlib to display the pixmap. So I'ld guess this is rather an imlib bug than kuickshows fault.

Does anyone know other applications that use imlib to display pixmap so we can verify that it's an imlib bug?
Comment 7 Heiko Liebfried 2004-09-19 02:25:37 UTC
I successfully managed to compile kuickshow from kde 3.3.0 against imlib2.
Normally kuckshow demands imlib1.9.x

The same situation.

Gqview, an Imageviewer which also depends on imlib doesn't have this problem.

So perhaps this indicates, that imlib isn't the bad guy.
But i am no expert.
 
Comment 8 Dan Doel 2004-09-20 12:21:24 UTC
As a temporary workaround, you can make kuickshow work by hiding the ARGB visuals exported by the composite extension like so:

XLIB_SKIP_ARGB_VISUALS=1

kuickshow (or something it depends on) needs to be made aware of the ARGB visuals for it to work properly. I added that to the kuickshow launcher and it worked (that is, clicking on an image now executes "XLIB_SKIP_ARGB_VISUALS=1 kuickshow ..."), but KDE complained a little about it (says it can't execute /bin/sh or some such), but it works if you don't mind that.
Comment 9 Heiko Liebfried 2004-09-21 11:57:40 UTC
Thanks a lot Frank !

I now use an lauchnscript wich exports 'XLIB_SKIP_ARGB_VISUALS=1' and starts kuickshow.No problems anymore with black picture window.
Until the bug is fixed this helps out. 
Comment 10 Frank Hellmuth 2004-09-21 19:20:13 UTC
Thanks, but ... honour to whom honour deserves ;)

That workaround was not contributed by me, but by Dan Doel!

Thank you, Dan, also from me!
Comment 11 Lubos Lunak 2004-10-14 15:39:10 UTC
*** Bug 91318 has been marked as a duplicate of this bug. ***
Comment 12 Maksim Orlovich 2005-01-05 21:59:21 UTC
*** Bug 96373 has been marked as a duplicate of this bug. ***
Comment 13 Jan Callewaert 2005-01-24 14:19:58 UTC
The problem still exists in kde-3.4.0_beta1. Is this going to be resolved? Since the beta2 will include composite patches, I think the Composite extension will become more and more popular, and the problem is not solved yet. Perhaps indeed create a wrapper script and include it without every one having to search for a solution and create a wrapper script themselves.
Comment 14 Carsten Pfeiffer 2005-01-24 15:01:00 UTC
On Monday 24 January 2005 14:20, Jan Callewaert wrote:

> 2005-01-24 14:19 ------- The problem still exists in kde-3.4.0_beta1. Is
> this going to be resolved? Since the beta2 will include composite patches,
> I think the Composite extension will become more and more popular, and the
> problem is not solved yet. Perhaps indeed create a wrapper script and
> include it without every one having to search for a solution and create a
> wrapper script themselves.

The composite extension is marked experimental for a reason (it breaks 
existing applications), but sadly, its developers seem to put up with that.

Does anyone know how to recognize the ARGB visual (without using XRender) so 
that Imlib can prefer the RGB one? Unfortunately, I don't have access to any 
computer with XOrg installed.

Otherwise, I'll add the environment hack to kuickshow, so that users don't 
have to do that.

Cheers
Carsten Pfeiffer
Comment 15 Frank Hellmuth 2005-01-25 15:49:31 UTC
I'm no expert, but maybe you could "borrow" some code from konsole.

Searching for "ARGB visual" I found this in the KDE CVS Digest http://members.shaw.ca/dkite/apr92004.html

> Fredrik Höglund committed a change to kdebase/konsole/konsole
> 
> - Added support for "real" transparency on X servers that have a
>   32 bit visual format with an alpha channel. The ARGB visual is
>   autodetected on startup, and if it's not available konsole falls
>   back to using the psuedo transparency hack.
> 
> - Made the text widget render background colors semi-transparent
>   when transparency is enabled and the ARGB visual is used, thus
>   removing the need for a special color scheme to have a
>   translucent midnight commander.
> 
> This currently only works with the kdrive DDX on freedesktop.org.
> In addition to the kdrive server you need Qt 3.3 and a running
> composite manager to use this feature.
Comment 16 Carsten Pfeiffer 2005-01-25 16:03:28 UTC
On Tuesday 25 January 2005 15:49, Frank Hellmuth wrote:
> I'm no expert, but maybe you could "borrow" some code from konsole.
>
> Searching for "ARGB visual" I found this in the KDE CVS Digest
> http://members.shaw.ca/dkite/apr92004.html
>
> > Fredrik Höglund committed a change to kdebase/konsole/konsole
> >
> > - Added support for "real" transparency on X servers that have a
> >   32 bit visual format with an alpha channel. The ARGB visual is
> >   autodetected on startup, and if it's not available konsole falls
> >   back to using the psuedo transparency hack.

Unfortunately, it uses the Render extension to detect the ARGB visual. 
Fredrik: do you know any other way to determine whether a visual is ARGB or 
not?

Cheers
Carsten

Comment 17 Fredrik Höglund 2005-01-25 17:46:30 UTC
There's no way to identify the ARGB visual without using the Render extension,
but you can know that A) Servers that don't have the Render extension won't
have the ARGB visual either, and B) The default visual is never the ARGB
visual.

The Imlib behavior of always picking the visual with the highest bit depth is
broken since it assumes that none of the visuals are "special", and it can
lead to unpredictable behavior even on X servers that don't have visuals with
alpha channels.

One of the reasons that the Composite extension is disabled by default is to
give developers time to identify these problems in applications and fix them
before it becomes enabled by default.

The safest way to fix this in kuickshow is probably to just use the default
visual, if that's possible.
Comment 18 Jakub Stachowski 2005-02-06 21:58:21 UTC
CVS commit by qbast: 

Always use default visual.
BUG: 89313 


  M +4 -1      imlibwidget.cpp   1.18
  M +4 -1      kuickshow.cpp   1.92


--- kdegraphics/kuickshow/src/imlibwidget.cpp  #1.17:1.18
@@ -55,8 +55,10 @@ ImlibWidget::ImlibWidget( ImData *_idata
 
     // PARAMS_PALETTEOVERRIDE taken out because of segfault in imlib :o(
-    par.flags = ( PARAMS_REMAP |
+    par.flags = ( PARAMS_REMAP | PARAMS_VISUALID |
                   PARAMS_FASTRENDER | PARAMS_HIQUALITY | PARAMS_DITHER |
                   PARAMS_IMAGECACHESIZE | PARAMS_PIXMAPCACHESIZE );
 
+    Visual* defaultvis = DefaultVisual(x11Display(), x11Screen());
+
     par.paletteoverride = idata->ownPalette ? 1 : 0;
     par.remap           = idata->fastRemap ? 1 : 0;
@@ -64,4 +66,5 @@ ImlibWidget::ImlibWidget( ImData *_idata
     par.hiquality       = idata->dither16bit ? 1 : 0;
     par.dither          = idata->dither8bit ? 1 : 0;
+    par.visualid        = defaultvis->visualid;
     uint maxcache       = idata->maxCache;
 

--- kdegraphics/kuickshow/src/kuickshow.cpp  #1.91:1.92
@@ -1091,8 +1091,10 @@ void KuickShow::initImlib()
 void KuickShow::initImlibParams( ImData *idata, ImlibInitParams *par )
 {
-    par->flags = ( PARAMS_REMAP |
+    par->flags = ( PARAMS_REMAP | PARAMS_VISUALID |
                    PARAMS_FASTRENDER | PARAMS_HIQUALITY | PARAMS_DITHER |
                    PARAMS_IMAGECACHESIZE | PARAMS_PIXMAPCACHESIZE );
 
+    Visual* defaultvis = DefaultVisual(x11Display(), x11Screen());
+
     par->paletteoverride = idata->ownPalette  ? 1 : 0;
     par->remap           = idata->fastRemap   ? 1 : 0;
@@ -1100,4 +1102,5 @@ void KuickShow::initImlibParams( ImData 
     par->hiquality       = idata->dither16bit ? 1 : 0;
     par->dither          = idata->dither8bit  ? 1 : 0;
+    par->visualid        = defaultvis->visualid;
     uint maxcache        = idata->maxCache;
 


Comment 19 Stephan Binner 2005-03-11 19:45:56 UTC
*** Bug 100785 has been marked as a duplicate of this bug. ***
Comment 20 nick 2007-01-28 23:38:34 UTC
This is still broken in FC6 
Qt: 3.3.7
KDE: 3.5.5-3.fc6
KuickShow: 0.8.5

The env var works but ...

Thanks to all for the great software