Bug 113093 - kicker pseudo transparency redrawing is broken
Summary: kicker pseudo transparency redrawing is broken
Status: RESOLVED DUPLICATE of bug 113235
Alias: None
Product: kicker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
: 113160 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-22 19:49 UTC by Thomas Reitelbach
Modified: 2005-09-29 03:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kicker with half-drawn buttons (36.15 KB, image/png)
2005-09-22 19:52 UTC, Thomas Reitelbach
Details
Buttons, now with half black background (104.94 KB, image/png)
2005-09-24 23:12 UTC, Thomas Reitelbach
Details
Kicker which is almost completely non-transparent (20.37 KB, image/png)
2005-09-24 23:15 UTC, Thomas Reitelbach
Details
My kickerrc (3.99 KB, text/plain)
2005-09-25 16:06 UTC, Thomas Reitelbach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Reitelbach 2005-09-22 19:49:51 UTC
Version:           3.4.91 (using KDE 3.4.91 (beta1, >= 20050910), compiled sources)
Compiler:          gcc version 3.4.1
OS:                Linux (i686) release 2.6.11.12

Hello people,

i configured kicker to be pseudo transparent (not the composite real transparency) and it looks quite fine.

But unfortunately in KDE 3.5 beta1 there seems to be a redrawing issue with the buttons and other applets inside of kicker. The background of buttons or applets are redrawn grey sometimes. you can see it on the attached screenshot.

I can reproduce this bug usually when switching desktops or when moving the mouse over the app-buttons next to the k-menu. in general, everything that causes redrawing an applet seems to trigger this bug (not everytime, but sometimes).

Bye,
Thomas
Comment 1 Thomas Reitelbach 2005-09-22 19:52:56 UTC
Created attachment 12665 [details]
kicker with half-drawn buttons

This is kicker with half-drawn buttons for the k-menu and konqueror profiles.
Comment 2 Aaron J. Seigo 2005-09-24 04:42:42 UTC
SVN commit 463429 by aseigo:

paint button backgrounds properly
BUGS:113093,113160


 M  +50 -2     kicker/core/container_button.cpp  
 M  +6 -2      libkicker/panelbutton.cpp  


--- branches/KDE/3.5/kdebase/kicker/kicker/core/container_button.cpp #463428:463429
@@ -36,6 +36,7 @@
 #include "global.h"
 #include "appletop_mnu.h"
 
+#include "containerarea.h"
 #include "panelbutton.h"
 #include "bookmarksbutton.h"
 #include "browserbutton.h"
@@ -43,6 +44,7 @@
 #include "extensionbutton.h"
 #include "kbutton.h"
 #include "kicker.h"
+#include "kickerSettings.h"
 #include "kickertip.h"
 #include "nonkdeappbutton.h"
 #include "paneldrag.h"
@@ -94,13 +96,59 @@
     return width;
 }
 
+#include <iostream>
+using namespace std;
 void ButtonContainer::setBackground()
 {
     PanelButton* b = button();
-    if (b)
+    if (!b)
     {
-        b->repaint();
+        return;
     }
+
+cout << "ButtonContainer::setBackground()" << endl;
+    b->unsetPalette();
+
+    if (!KickerSettings::transparent())
+    {
+        b->update();
+        return;
+    }
+
+    // inheritance is ButtonContainer - ScrollView - ContainerArea
+    ContainerArea* area = 0;
+    QObject* ancestor = parent();
+    while (ancestor && !area)
+    {
+        area = dynamic_cast<ContainerArea*>(ancestor);
+        ancestor = ancestor->parent();
+    }
+
+    const QPixmap* containerBG = area ? area->completeBackgroundPixmap()
+                                        : 0;
+
+    if (!containerBG || containerBG->isNull())
+    {
+cout << "\tsetting no background!" << endl;
+        b->setPaletteBackgroundPixmap(QPixmap());
+    }
+    else
+    {
+        int srcx = x();
+        int srcy = y();
+        int buttonWidth = b->width();
+        int buttonHeight = b->height();
+
+        QPixmap buttonBackground(buttonWidth, buttonHeight);
+        copyBlt(&buttonBackground, 0, 0,
+                containerBG, srcx, srcy,
+                buttonWidth, buttonHeight);
+
+        b->setPaletteBackgroundPixmap(buttonBackground);
+    cout << "\tbackground set!" << endl;
+    }
+
+    b->update();
 }
 
 void ButtonContainer::configure()
--- branches/KDE/3.5/kdebase/kicker/libkicker/panelbutton.cpp #463428:463429
@@ -502,13 +502,17 @@
 
 void PanelButton::drawButton(QPainter *p)
 {
-    // Draw the background. This is always needed, even when using tiles,
-    // because they don't have to cover the entire button.
     if (m_tileColor.isValid())
     {
         p->fillRect(rect(), m_tileColor);
         style().drawPrimitive(QStyle::PE_Panel, p, rect(), colorGroup());
     }
+    else if (paletteBackgroundPixmap())
+    {
+        // Draw the background. This is always needed, even when using tiles,
+        // because they don't have to cover the entire button.
+        p->drawPixmap(0, 0, *paletteBackgroundPixmap());
+    }
 
     const QPixmap& tile = (isDown() || isOn()) ? m_down : m_up;
     if (!tile.isNull())
Comment 3 Thomas Reitelbach 2005-09-24 23:10:01 UTC
Thanks for you effort, Aaron, but unfortunately this bug is not fixed :(
I'll attach two new screenshots which i made after your "fix".
Comment 4 Thomas Reitelbach 2005-09-24 23:12:53 UTC
Created attachment 12691 [details]
Buttons, now with half black background

This time the buttons background appears half black, half transparent.
Comment 5 Thomas Reitelbach 2005-09-24 23:15:57 UTC
Created attachment 12692 [details]
Kicker which is almost completely non-transparent

Here most of kicker is non-transparent. The blue parts in the screenshot are my
real desktop background. all blue (transparent) parts in this screenshot are
parts, not occupied by an applet. maybe this information is useful? so it seems
that "free" space in kicker is not affected by this bug.
Comment 6 Aaron J. Seigo 2005-09-25 00:58:41 UTC
well, thomas, i don't know what to say. i can not reproduce this problem, and it's hard to debug something i can't reproduce. buttons should be painting the correct background.

but as you note it seems to be affecting applets as well which are a completely different matter. can you attach your kickerrc to this bug report please? thanks.
Comment 7 Thomas Reitelbach 2005-09-25 16:06:17 UTC
Created attachment 12701 [details]
My kickerrc

This is the kickerrc. But be aware: I also see this bug with a different user
with a fresh ~/.kde, so i doubt that it's a problem in the configuration file
:(
Comment 8 Aaron J. Seigo 2005-09-26 16:52:30 UTC
*** Bug 113160 has been marked as a duplicate of this bug. ***
Comment 9 Aaron J. Seigo 2005-09-29 03:20:25 UTC

*** This bug has been marked as a duplicate of 113235 ***