From kde-commits Thu Jan 08 23:42:40 2009 From: "Aaron J. Seigo" Date: Thu, 08 Jan 2009 23:42:40 +0000 To: kde-commits Subject: Re: KDE/kdebase/workspace/plasma/applets/systemtray/protocols/fdo Message-Id: <200901081741.34460.aseigo () kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123145816014375 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart3805020.RQ1LWFGfax" --nextPart3805020.RQ1LWFGfax Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 08 January 2009, Fredrik H=C3=B6glund wrote: > On Thursday 08 January 2009 18:59, Aaron J. Seigo wrote: > > SVN commit 907753 by aseigo: > > > > don't assume 32 bit depth, makes trays work on 16 bit depth with the new > > hint. patch by ddenis @ Qt; thanks! =3D) > > > > > > M +16 -12 fdoselectionmanager.cpp > > M +0 -4 x11embedcontainer.cpp > > > > > > --- > > trunk/KDE/kdebase/workspace/plasma/applets/systemtray/protocols/fdo/fdo= se > >lectionmanager.cpp #907752:907753 @@ -267,20 +267,24 @@ > > int nvi; > > VisualID visual =3D > > XVisualIDFromVisual((Visual*)QX11Info::appVisual()); XVisualInfo templ; > > - templ.screen =3D DefaultScreen(d->display); > > - templ.depth =3D 32; > > - templ.c_class =3D TrueColor; > > - XVisualInfo *xvi =3D XGetVisualInfo(d->display, VisualScreenMask | > > VisualDepthMask | VisualClassMask, - = =20 > > &templ, &nvi); > > - for (int i =3D 0; i < nvi; i++) { > > - XRenderPictFormat *format =3D XRenderFindVisualFormat(d->displ= ay, > > xvi[i].visual); - if (format->type =3D=3D PictTypeDirect && > > format->direct.alphaMask) { - visual =3D xvi[i].visualid; > > - break; > > + templ.visualid =3D visual; > > + XVisualInfo *xvi =3D XGetVisualInfo(d->display, VisualIDMask, &tem= pl, > > &nvi); + if (xvi) { > > + templ.screen =3D xvi[0].screen; > > + templ.depth =3D xvi[0].depth; > > + templ.c_class =3D xvi[0].c_class; > > + XFree(xvi); > > + xvi =3D XGetVisualInfo(d->display, VisualScreenMask | > > VisualDepthMask | VisualClassMask, + &templ, > > &nvi); > > + for (int i =3D 0; i < nvi; i++) { > > + XRenderPictFormat *format =3D > > XRenderFindVisualFormat(d->display, xvi[i].visual); + if > > (format->type =3D=3D PictTypeDirect && format->direct.alphaMask) { + = =20 > > visual =3D xvi[i].visualid; > > + break; > > + } > > } > > + XFree(xvi); > > } > > You just turned this whole block of code into an elaborate no-op that > always ends up right back where you started; with the visual Plasma was > using in the first place. > > The whole point of this code is to tell applications that you want systray > icons to always use the 32 bit ARGB visual regardless of the display dept= h, > so they will always have an alpha channel. > > The new code still accomplishes that by accident, but only because Plasma > itself always uses the ARGB visual. But the minute you remove that hack > and start using the new Qt::WA_TranslucentBackground attribute, you > break the systray. > > So could you explain what you were trying to accomplish with this patch > so we can fix it properly? according to ddenis who worked on the NET_SYSTEM_TRAY_VISUAL for Qt 4.5, th= e=20 old code was failing on 16bpp displays. well, i'll let him speak for himsel= f=20 here: [Thu Jan 8 2009] [03:55:29] Hi. I wanted to talk to about about th= e=20 NET_SYSTEM_TRAY_VISUAL atom - I've implemented support for it in Qt 4.5,=20 however I suspect that its implementation in the systemtray applet in kde i= s=20 not correct - in the fdo/fdoselectionmanager.cpp in the initSelection()=20 function the code that searches for the visual explicitely sets the color=20 depth to be 32 and the problem occurs when I try to create a systray icon=20 window with that visual on a 16bit display. As far as [Thu Jan 8 2009] [03:55:29] I can see the proper way is to get the= =20 depth from the system and then try to find the ARGB-enabled visual with the= =20 same depth on the same screen he provided a patch that he claimed worked for him in those situations, i=20 applied and tested it here as well ... but perhaps you can propose a better= =20 solution that isn't an elaborate no-op? ;) =2D-=20 Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 KDE core developer sponsored by Qt Software --nextPart3805020.RQ1LWFGfax Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAklmnT4ACgkQ1rcusafx20OM7wCgmZkbi3cEpUqbHL89/REpU6E+ JVMAn28tqHCRsiHgQt7HALVbjOokwT/r =sHKm -----END PGP SIGNATURE----- --nextPart3805020.RQ1LWFGfax--