Bug 69897 - kicker's transparency for application windows buggy
Summary: kicker's transparency for application windows buggy
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kstyle (show other bugs)
Version: 3.2-beta
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Karol Szwed
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-09 02:14 UTC by Helge Deller
Modified: 2004-01-11 21:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
bug is visible in the middle of the image - transparency offsets are wrong. (57.50 KB, image/png)
2003-12-09 02:16 UTC, Helge Deller
Details
dont_break_taskbars_background_origin.diff (792 bytes, text/x-diff)
2003-12-12 14:24 UTC, Oliver Bausinger
Details
sample screenshot w/ new bug visible (69.63 KB, image/png)
2003-12-19 22:02 UTC, Helge Deller
Details
kthemestyle.diff (857 bytes, text/x-diff)
2003-12-20 12:47 UTC, Oliver Bausinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Deller 2003-12-09 02:14:59 UTC
Version:           unknown (using KDE 3.1.94 (CVS >= 20031206), compiled sources)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:          Linux (i686) release 2.4.21-99-athlon

please see the attached screenshot. The transparency in the application window region is wrong. Bug is in current KDE CVS HEAD (beta2).
Comment 1 Helge Deller 2003-12-09 02:16:58 UTC
Created attachment 3626 [details]
bug is visible in the middle of the image - transparency offsets are wrong.
Comment 2 Oliver Bausinger 2003-12-10 22:50:18 UTC
Hm. This should already be fixed in the version you reported.
Please try again against CVS HEAD >= 20031210 and if the problem persists
please report details about your kicker and background setting.
Comment 3 Helge Deller 2003-12-11 00:32:30 UTC
Hi Oliver,

it's not. I'm right now running this version (just did a cvs up and verified that nothing has changed in between in CVS regarding the kicker sources).

Here is the relevant part of my ~/.kde/share/config/kickerrc:

[General]
Applets=KMenuButton_1,DesktopButton_1,ExtensionButton_1,ServiceButton_2,ServiceButton_3,ServiceButton_1,Applet_2,Applet_3,Applet_4
BackgroundTheme=/mnt/hdc6/opt/kde32/share/apps/kicker/wallpapers/default.png
ColorizeBackground=false
FadeOutAppletHandles=true
HideAppletHandles=false
HideButtonSize=14
ResizeableHandle=false
ShowToolTips=true
TintColor=163,164,165
TintValue=0
Transparent=true
UseBackgroundTheme=true

To try, enable those settings, then enable in the kdesktop settings Background->Slideshow (the default one is OK) with a 1 minute delay and it should be visible after some time.
 
Comment 4 Helge Deller 2003-12-11 00:33:28 UTC
btw, you oft can see it directly after (re-)starting KDE too.
Comment 5 Oliver Bausinger 2003-12-11 01:32:34 UTC
OK, I can reproduce it with styles that mess with the background (Helge uses marble, I got the same problem with Baghira), Keramik seems unaffected. 
And it looks it's related to the stretching.
Comment 6 Oliver Bausinger 2003-12-12 01:56:30 UTC
OK, I have verified that the code which produces the background pixmap for the applet is correct. InternalAppletContainer::setBackground does the right thing. 
Interestingly, everything works for ExternalAppletContainer's. So a workaround is to put "SecurityLevel=0" in your kickerrc/[General] and it will load the applets through the proxy. This works for me with marble style.

And it's not related to stretching, the "Run ..." applet stretches and does not have the problem.
I'm quite clueless about this, maybe some style guru can help out?
Comment 7 Oliver Bausinger 2003-12-12 14:24:21 UTC
Subject: solution

I found the solution. The style (kthemestyle) breaks the BackgoundOrigin of 
non-toplevel windows. Therefore it works with ExternalAppletContainer, but 
not with InternalAppletContainer because the correct "AncestorOrigin" in the 
TaskbarApplet gets replaced. 
I attached a patch to kthemestyle.cpp which fixes it for the taskbar, but some 
style guy should look whether there is a more generic fix possible.




Created an attachment (id=3669)
dont_break_taskbars_background_origin.diff
Comment 8 Helge Deller 2003-12-16 19:57:21 UTC
Hi Oliver,

I tested your patch and it worked without any problems and correct.
IMHO I think you should submit it.

Thanks,
Helge (deller@kde.org)
Comment 9 Helge Deller 2003-12-19 21:42:29 UTC
I think your patch still has some bugs when the left handle is visible....
Comment 10 Helge Deller 2003-12-19 22:02:22 UTC
Created attachment 3784 [details]
sample screenshot w/ new bug visible
Comment 11 Oliver Bausinger 2003-12-20 12:47:30 UTC
Subject: Next patch

Attached patch excludes even more widgets from the setBackgroundOrigin madness 
of kthemestyle. This should fix Helges latest problems. 


Created an attachment (id=3794)
kthemestyle.diff
Comment 12 Helge Deller 2003-12-20 13:30:04 UTC
YES ! THAT'S IT!!!
Tested and it works perfect. 
I moved around the taskbar, created childs and tested a few other things and everthing looks fine.
Please commit...
Comment 13 Oliver Bausinger 2003-12-20 13:43:26 UTC
Subject: Re:  kicker's transparency for application windows buggy

> ------- Additional Comments From deller@kde.org  2003-12-20 13:30 -------
> YES ! THAT'S IT!!!
> Tested and it works perfect.

Nothing is perfect :-)
OK, I asked already Maks about this, but didn't get an answer yet. Please bug 
some style guru about this, it might well be that the whole 
setBackgroundOrigin call in kthemestyle can be omitted. 

But as I'm not really fine with this patch (It will break apps which have 
widgets called TaskBar or ContainerArea), some style guru has to decide what 
the right solution is. And I won't commit any code into kstyle since I'm not 
familiar with it.

Greetings
Bausi
Comment 14 Maksim Orlovich 2003-12-20 15:52:45 UTC
I'll try to review it in a few days. I am afraid I can't at the moment. 
Comment 15 Helge Deller 2003-12-29 18:26:29 UTC
Subject: Re:  kicker's transparency for application windows buggy

> ------- Additional Comments From maksim@kde.org  2003-12-20 15:52 -------
> I'll try to review it in a few days. I am afraid I can't at the moment.

Hi Maksim,

FYI, I'm running this patch now since more than a week without any 
regressions or problems.

Comment 16 Maksim Orlovich 2004-01-11 21:22:10 UTC
Subject: kdelibs/kstyles/kthemestyle

CVS commit by orlovich: 

Apply a modified version of a patch from  Oliver Bausinger (bausi at the host bausi tld org), to fix 
kicker w/transparent background and KThemeStyle. This is not the clean way of doing it, but it's a safe 
way of doing it, which is preferrable at this point.
CCMAIL: 69897-done@bugs.kde.org


  M +11 -11    kthemestyle.cpp   1.43
  M +2 -1      kthemestyle.h   1.16


--- kdelibs/kstyles/kthemestyle/kthemestyle.cpp  #1.42:1.43
@@ -395,5 +395,5 @@ int KThemeStyle::pixelMetric ( PixelMetr
 KThemeStyle::KThemeStyle( const QString& configDir, const QString &configFile )
         : KThemeBase( configDir, configFile ), paletteSaved( false ), polishLock( false ), menuCache( 0 ), vsliderCache( 0 ),
-         brushHandle( 0 ), brushHandleSet( false )
+         brushHandle( 0 ), brushHandleSet( false ), kickerMode( false )
 {
     mtfstyle = QStyleFactory::create( "Motif" );
@@ -410,6 +410,9 @@ KThemeStyle::~KThemeStyle()
 
 
-void KThemeStyle::polish( QApplication * /*app*/ )
-{}
+void KThemeStyle::polish( QApplication * app )
+{
+    if (!qstrcmp(app->argv()[0], "kicker"))
+        kickerMode = true;
+}
 
 
@@ -502,5 +505,7 @@ void KThemeStyle::polish( QWidget *w )
 
 
-    if (w->backgroundPixmap() && !w->isTopLevel())
+    if (w->backgroundPixmap() && !w->isTopLevel() && 
+        (!kickerMode || 
+        (!w->inherits("TaskBar") && !w->inherits("TaskBarContainer") && !w->inherits("TaskbarApplet") && !w->inherits("ContainerArea") && !w->inherits("AppletHandle"))))
     {
         //The brushHandle check verifies that the bg pixmap is actually the brush..
@@ -2364,9 +2369,4 @@ int KThemeStyle::popupMenuItemHeight( bo
 }
 
-
-
-
 #include "kthemestyle.moc"
-
-
-
+// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent on;

--- kdelibs/kstyles/kthemestyle/kthemestyle.h  #1.15:1.16
@@ -205,4 +205,5 @@ protected:
     Qt::HANDLE brushHandle;
     bool brushHandleSet;
+    bool kickerMode;
 
 protected slots: