Bug 237772 - Some pure qt apps have black corners around menus
Summary: Some pure qt apps have black corners around menus
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: style (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-16 00:39 UTC by Jesse Milette
Modified: 2010-05-16 17:26 UTC (History)
1 user (show)

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


Attachments
suggested patch (2.28 KB, patch)
2010-05-16 02:41 UTC, Hugo Pereira Da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Milette 2010-05-16 00:39:06 UTC
Version:            (using KDE 4.4.3)
OS:                Linux
Installed from:    Ubuntu Packages

I can see this in vlc, and in virtualbox.  Open it up, click a menu, and the black corners around the edges of the menu where it is supposed to be curved are very obvious.
Comment 1 Hugo Pereira Da Costa 2010-05-16 00:52:30 UTC
confirmed. 
Been bugged by that for quite some time.
Apparently checking on the WM compositing enable state to decide whether alpha channel or mask is to be used is not enough ... Oxygen must be missing smthing. 

Note:
if you disable compositing in kwin, 
oxygen catches it, uses masks, and vlc looks fine again.
Comment 2 Hugo Pereira Da Costa 2010-05-16 01:46:23 UTC
Renamed cause as far as I know it is not true for all Qt Apps.
(see, e.g. QtDesigner, QtConfig)
Comment 3 Hugo Pereira Da Costa 2010-05-16 02:29:30 UTC
So I digged into vlc code.
It has: 
    putenv( (char *)"XLIB_SKIP_ARGB_VISUALS=1" );
before initializing qApp.
That's the guilty guy.
I bet (though did not check) that virtualBox has the same.
I guess I can check for env variables in oxygen style (will post a patch), but that tastes a bit too much of a hack to my taste.

Does anyone have a better trick ?
Comment 4 Hugo Pereira Da Costa 2010-05-16 02:41:51 UTC
Created attachment 43621 [details]
suggested patch

check for XLIB_SKIP_ARGB_VISUALS when in ::polish( QApplication* )
to further check whether compositing is enabled or not.
Comment 5 Hugo Pereira Da Costa 2010-05-16 17:01:33 UTC
SVN commit 1127429 by hpereiradacosta:

Check QX11Info::depth() to decide whether alphachannel can be use to paint widgets  
like QMenu, ComboBox containers, detached toolbars and detached dockpanels. 

Removed custom setting of mask for combobox containers cause this is nicely handled by 
Qt. 

BUG: 237772 


 M  +42 -39    oxygenstyle.cpp  
 M  +6 -1      oxygenstyle.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1127429
Comment 6 Hugo Pereira Da Costa 2010-05-16 17:26:25 UTC
SVN commit 1127437 by hpereiradacosta:

Backport r1127429
Check QX11Info::depth() to decide whether alphachannel can be use to paint widgets like 
QMenu, ComboBox containers, detached toolbars and detached 
dockpanels.
CCBUG: 237772


 M  +37 -35    oxygen.cpp  
 M  +3 -0      oxygen.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1127437