On 15/04/2014, at 9:36 AM, Ian Wadham wrote: > This could affect a range of KDE apps and libraries in various ways. > > Bug 332335 - "Links fade to pitch black when mouse hovering over them" > https://bugs.kde.org/show_bug.cgi?id=332335 > > reports a nasty painting problem that was found when hovering over a > Plasma ToolButton in KDevelop on the Apple OS X platform. > Screenshot: http://bugsfiles.kde.org/attachment.cgi?id=85991 > > I also discovered the problem in the KBounce game, reported it [1] and, being > a > KDE Games programmer, investigated it and found the cause. See also [2], > which > might relate to this. > > I think the cause is to do with using QPainter::CompositionMode_DestinationIn > to > "blend in" an opaque pixmap and make it look semi-transparent on top of the > main > picture. KBounce creates an opaque message-box pixmap of a color that matches > the graphics theme, attempts to make it semi-transparent, then writes black > (or dark > color) text on it. But on Apple OS X the box comes out black, making the > text invisible > and the game unplayable for most people. > > If I comment out the CompositionMode references, the messages appear OK, but > on an opaque message-box. I can fix the problem completely by using > QPainter::setOpacity() to make the box semi-transparent, instead of > CompositionMode. > > It seems that the problem with Plasma ToolButton (see above) has the same > cause.
Black-on-black problems in the games KBounce and KPat disappear if the games are started (in Apple OS X) with -graphicssystem raster on the command-line. See Thomas Lübking's suggestion in https://bugs.kde.org/show_bug.cgi?id=333429 The black-on-black problem with KDevelop https://bugs.kde.org/show_bug.cgi?id=332335 does NOT respond to similar treatment. Maybe this is because the usage of QPainter::CompositionMode_DestinationIn is in Plasma::ToolButton and not affected by KDevelop's command-line. Failure of QPainter::CompositionMode_DestinationIn when not using the raster graphics painting could be a Qt 4.8 bug. What do others think? > Code references to Plasma::ToolButton::paint() and > KBounceGameWidget::generateOverlay(): > http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/toolbutton_8cpp_source.html#l00329https://projects.kde.org/projects/kde/kdegames/kbounce/repository/revisions/master/entry/gamewidget.cpp > lines 390 to 398 > > But THAT IS NOT ALL … To see if there were other possible occurrences of > black-on-black > problems in KDE on Apple OS X, I went into LXR and here is what I found … > > http://lxr.kde.org/ident?_i=CompositionMode_DestinationIn&_remember=1 > > which shows 146 INSTANCES of using CompositionMode_DestinationIn, across > a broad range of KDE applications and libraries … The 100+ instances of QPainter::CompositionMode_DestinationIn in KDE code remain as potential problems on the Apple OS X platform, except for KPat and KBounce. > Amongst the KDE Games references, KFourInLine seems to work OK on Apple OS X, > but > KPat definitely has some transient black-on-black glitches when animating > highlights. > The KPat code also includes the following interesting comment: > > 0166 // Using QPainter::setOpacity is currently very > inefficient, so to > 0167 // paint a semitransparent pixmap, we have to do some > fiddling. > > Is QPainter::setOpacity more efficient now? > > I do not have the time or the ability to investigate all the references on my > own > and I have some more urgent KDE portability problems to chase up [3]. > > So what can we do about this? Any ideas? I will find out if there is any reason why MacPorts does not build its Qt4-Mac package with raster graphics as the default. All the best, Ian W. > [1] > Bug 333429 - Black on black messages in Apple OS X make KBounce unplayable > https://bugs.kde.org/show_bug.cgi?id=333429 > [2] > Bug 330242 - Strange graphical glitches in Dolphin when the Terminal pane > is open and transparency is enabled in Konsole. > https://bugs.kde.org/show_bug.cgi?id=330242 > [3] > https://trac.macports.org/wiki/KDEProblems/KDETickets > https://trac.macports.org/wiki/KDEProblems > These are some new wiki pages where we are collecting portability issues re > KDE on > the Apple OS X platform, following recent discussions on this list. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<