[PATCH] Ghost Shadows

Till Krech till at snafu.de
Sun Oct 6 14:34:45 BST 2002


On Sunday 06 October 2002 02:26, Hamish Rodda wrote:
> > On Saturday 05 October 2002 14:01, Malte Starostik wrote:
> > [...]
> >
> >> in the event handler from running twice. But as the problem is rather
> >> intrusive maybe it's still good to commit this as a workaround (marked
> >> with a comment).
> >
> > done. till.
>
> The problem is still reproducable here if you move over multiple menus
> before the original menu is completely drawn.
Yes. I see :-(
The KPOpupMenu which leaves its shadows gets a second show event even after the hide event !
Look at this commented debug output when moving the mouse in konqui over the menu bar:

******* (0x818f970) "tools" Show Event, has shadowMap entry = false
      + (0x818f970) "tools" Create Shadows, has shadowMap entry = false

correct. The tools menu gets a show event. There is no entry in the shadow map. 
The shadow is created.

******* (0x818f970) "tools" Hide Event, has shadowMap entry = true
      - (0x818f970) "tools" Remove Shadows, has shadowMap entry = true

correct. The tools menu gets a Hide event. The shadows are removed.
 
******* (0x8156920) "KActionMenu::KActionMenuPrivate" Show Event, has shadowMap entry = false
      + (0x8156920) "KActionMenu::KActionMenuPrivate" Create Shadows, has shadowMap entry = false

correct. Another menu gets a show event and creates a shadow.

******* (0x818f970) "tools" Show Event, has shadowMap entry = false
      + (0x818f970) "tools" Create Shadows, has shadowMap entry = false

OOOPS. A second show event for the "tools" menu creates another shadow. No hide event follows. 
Interesting that the tools popup menu does not reappear but only the shadow is drawn.

The problem does not only affect the shadows but also transparency. Upon the second show event,
The widget takes the background of itself and this doesn't look very transparent ;-/
 
The question is still: where does the second show event come from ? 
How can this be determined ?

Here are two stacktraces from a debugging session in gdb. One for the first show event, one for the second.

--------------------- first show event ---------------------------

>******* (0x8180018) "file" Show Event, has shadowMap entry = false

Breakpoint 3, TransparencyHandler::eventFilter (this=0x80b0e68, object=0x8180018, event=0xbfffe688)
    at /home/till/kde+/kdelibs/kdefx/kstyle.cpp:1940
1940                    if (te != Disabled)
(gdb) bt
#0  TransparencyHandler::eventFilter (this=0x80b0e68, object=0x8180018, event=0xbfffe688)
    at /home/till/kde+/kdelibs/kdefx/kstyle.cpp:1940
#1  0x40b911ee in QObject::activate_filters (this=0x8180018, e=0xbfffe688) at kernel/qobject.cpp:827
#2  0x40b91005 in QObject::event (this=0x8180018, e=0xbfffe688) at kernel/qobject.cpp:660
#3  0x40bc29c8 in QWidget::event (this=0x8180018, e=0xbfffe688) at kernel/qwidget.cpp:4293
#4  0x40b41299 in QApplication::internalNotify (this=0xbffff2b4, receiver=0x8180018, e=0xbfffe688)
    at kernel/qapplication.cpp:2290
#5  0x40b40e93 in QApplication::notify (this=0xbffff2b4, receiver=0x8180018, e=0xbfffe688)
    at kernel/qapplication.cpp:2213
#6  0x407b63b2 in KApplication::notify (this=0xbffff2b4, receiver=0x8180018, event=0xbfffe688)
    at /home/till/kde+/kdelibs/kdecore/kapplication.cpp:421
#7  0x40f1ea84 in QApplication::sendEvent (receiver=0x8180018, event=0xbfffe688)
    at .moc/debug-shared-mt/../../kernel/qapplication.h:475
#8  0x40bc172e in QWidget::show (this=0x8180018) at kernel/qwidget.cpp:3666
#9  0x40c6d868 in QPopupMenu::show (this=0x8180018) at widgets/qpopupmenu.cpp:1278
#10 0x40c6a69c in QPopupMenu::popup (this=0x8180018, pos=@0xbfffe908, indexAtPoint=-1)
    at widgets/qpopupmenu.cpp:601
#11 0x40c62b78 in QMenuBar::openActPopup (this=0x81716f8) at widgets/qmenubar.cpp:710
#12 0x40c65626 in QMenuBar::setActiveItem (this=0x81716f8, i=0, show=true, activate_first_item=false)
    at widgets/qmenubar.cpp:1366
#13 0x40c6487e in QMenuBar::mousePressEvent (this=0x81716f8, e=0xbfffed24) at widgets/qmenubar.cpp:1122
#14 0x40bc2beb in QWidget::event (this=0x81716f8, e=0xbfffed24) at kernel/qwidget.cpp:4305
#15 0x40b41299 in QApplication::internalNotify (this=0xbffff2b4, receiver=0x81716f8, e=0xbfffed24)
    at kernel/qapplication.cpp:2290
#16 0x40b40990 in QApplication::notify (this=0xbffff2b4, receiver=0x81716f8, e=0xbfffed24)
    at kernel/qapplication.cpp:2098
#17 0x407b63b2 in KApplication::notify (this=0xbffff2b4, receiver=0x81716f8, event=0xbfffed24)
---Type <return> to continue, or q <return> to quit---
    at /home/till/kde+/kdelibs/kdecore/kapplication.cpp:421
#18 0x40f1eaf4 in QApplication::sendSpontaneousEvent (receiver=0x81716f8, event=0xbfffed24)
    at .moc/debug-shared-mt/../../kernel/qapplication.h:478
#19 0x40aee2bd in QETWidget::translateMouseEvent (this=0x81716f8, event=0xbffff04c)
    at kernel/qapplication_x11.cpp:4153
#20 0x40aebb65 in QApplication::x11ProcessEvent (this=0xbffff2b4, event=0xbffff04c)
    at kernel/qapplication_x11.cpp:3311
#21 0x40afdf2c in QEventLoop::processEvents (this=0x8097600, flags=4) at kernel/qeventloop_x11.cpp:167
#22 0x40b53d70 in QEventLoop::enterLoop (this=0x8097600) at kernel/qeventloop.cpp:188
#23 0x40b53cb5 in QEventLoop::exec (this=0x8097600) at kernel/qeventloop.cpp:138
#24 0x40b41495 in QApplication::exec (this=0xbffff2b4) at kernel/qapplication.cpp:2409
#25 0x40065b64 in main (argc=1, argv=0xbffff3f4) at /home/till/kde+/kdebase/konqueror/konq_main.cc:130
#26 0x4124f9ed in __libc_start_main () from /lib/libc.so.6
(gdb) 


--------------------- second show event ------------------------------
******* (0x8180018) "file" Show Event, has shadowMap entry = true

Breakpoint 3, TransparencyHandler::eventFilter (this=0x80b0e68, object=0x8180018, event=0xbfffeea8)
    at /home/till/kde+/kdelibs/kdefx/kstyle.cpp:1940
1940                    if (te != Disabled)
(gdb) bt
#0  TransparencyHandler::eventFilter (this=0x80b0e68, object=0x8180018, event=0xbfffeea8)
    at /home/till/kde+/kdelibs/kdefx/kstyle.cpp:1940
#1  0x40b911ee in QObject::activate_filters (this=0x8180018, e=0xbfffeea8) at kernel/qobject.cpp:827
#2  0x40b91005 in QObject::event (this=0x8180018, e=0xbfffeea8) at kernel/qobject.cpp:660
#3  0x40bc29c8 in QWidget::event (this=0x8180018, e=0xbfffeea8) at kernel/qwidget.cpp:4293
#4  0x40b41299 in QApplication::internalNotify (this=0xbffff2b4, receiver=0x8180018, e=0xbfffeea8)
    at kernel/qapplication.cpp:2290
#5  0x40b40e93 in QApplication::notify (this=0xbffff2b4, receiver=0x8180018, e=0xbfffeea8)
    at kernel/qapplication.cpp:2213
#6  0x407b63b2 in KApplication::notify (this=0xbffff2b4, receiver=0x8180018, event=0xbfffeea8)
    at /home/till/kde+/kdelibs/kdecore/kapplication.cpp:421
#7  0x40f1eaf4 in QApplication::sendSpontaneousEvent (receiver=0x8180018, event=0xbfffeea8)
    at .moc/debug-shared-mt/../../kernel/qapplication.h:478
#8  0x40aec1f7 in QApplication::x11ProcessEvent (this=0xbffff2b4, event=0xbffff04c)
    at kernel/qapplication_x11.cpp:3457
#9  0x40afdf2c in QEventLoop::processEvents (this=0x8097600, flags=4) at kernel/qeventloop_x11.cpp:167
#10 0x40b53d70 in QEventLoop::enterLoop (this=0x8097600) at kernel/qeventloop.cpp:188
#11 0x40b53cb5 in QEventLoop::exec (this=0x8097600) at kernel/qeventloop.cpp:138
#12 0x40b41495 in QApplication::exec (this=0xbffff2b4) at kernel/qapplication.cpp:2409
#13 0x40065b64 in main (argc=1, argv=0xbffff3f4) at /home/till/kde+/kdebase/konqueror/konq_main.cc:130
#14 0x4124f9ed in __libc_start_main () from /lib/libc.so.6
(gdb)

Anyone an idea ?

regards, till

> Cheers,
>
> Hamish.

-- 
Till Krech from Berlin, Germany is happy with
SuSE Linux 8.0 (i386) 2.4.18-64GB-SMP * KDE: 3.0.8 (KDE 3.1 beta2)
Qt: 3.1.0-b2 * gcc version 3.2





More information about the kde-core-devel mailing list