[Panel-devel] minimization to taskbar

Jason Stubbs jasonbstubbs at gmail.com
Wed Dec 5 16:54:58 CET 2007


On Monday 03 December 2007 02:35:48 Aaron J. Seigo wrote:
> On Sunday 02 December 2007, Jason Stubbs wrote:
> > On Sunday 02 December 2007 21:36:19 Jason Stubbs wrote:
> > > I've reattached the widget patch against current subversion
> > > as well as the changes needed for tasks.
> >
> > I need to get into the habit of doing it before I type it. :/
>
> heh.. or use kmail which reminds you when you mention an attatchment or
> patch? ;)

I do but only "attachment" and "attached" were in the list. I've added "patch" 
and "reattached" for good measure. :)

I've changed function names to be a little more programmer-friendly, moved 
some stuff out of Widget and into Widget::Private and updated View too.
I'm not sure there's much more that can be done with this line of attack.
I'm particularly pleased with the simplicity of the tasks changes.

> that said, i still think it is too expensive to do the bookkeeping in each
> widget. if a widget is interested in tracking this information.

It's actually not that high. The only (semi-)hot path affected is itemChange's 
ItemPositionHashChanged event which has this false condition:

d->globalEventsEnabled || !d->globalEventChildren.isEmpty()

What SystemTray is currently doing with sceneRectChanged() would be heavier...
I've attached debug output that shows exactly what's happening during startup.
There's a lot less activity once plasma is up and running.

> i wonder if this shouldn't be a special subclass of Plasma::Widget that can 
> be used by those elements (taskbar entries, systemtray) that need it without 
> incurring the overhead penalty anywhere else?

I guess this could be done by utilizing sceneRectChanged() in combination with 
event compression. I'm not sure that there's any third way for a widget to 
know if it has moved... Should I implement this and see how it goes?

-- 
Jason Stubbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libplasma.patch
Type: text/x-diff
Size: 8312 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071206/998e6b4d/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tasks.patch
Type: text/x-diff
Size: 1430 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071206/998e6b4d/attachment-0001.bin 
-------------- next part --------------
// There are four tasks. Global position change notification is
// established up the parent change for the first
Plasma::Widget::Private::addGlobalEventChild: Adding WindowTaskItem to global event children of TaskGroupItem
Plasma::Widget::Private::addGlobalEventChild: Adding TaskGroupItem to global event children of Tasks
Plasma::Widget::Private::addGlobalEventChild: Adding Tasks to global event children of Panel

// Notification passing is already established above TaskGroupItem
Plasma::Widget::Private::addGlobalEventChild: Adding WindowTaskItem to global event children of TaskGroupItem
Plasma::Widget::Private::addGlobalEventChild: Adding WindowTaskItem to global event children of TaskGroupItem
Plasma::Widget::Private::addGlobalEventChild: Adding WindowTaskItem to global event children of TaskGroupItem

// (What is this Plasma::View here?)
Plasma::View::updateSceneRect: global event in Plasma::View
Plasma::View::updateSceneRect: sending global event from Plasma::View to DefaultDesktop

// DesktopView moves but notifications aren't sent past the
// DefaultDesktop containment
Plasma::View::event: global event in DesktopView
Plasma::View::event: sending global event from DesktopView to DefaultDesktop

// (Plasma::View again? Shouldn't this be a PanelView?)
// The scene rect is updated after the containment is added to the
// view and notifications are propogated to the WindowTaskItems
Plasma::View::updateSceneRect: global event in Plasma::View
Plasma::View::updateSceneRect: sending global event from Plasma::View to Panel
Plasma::Widget::globalPositionChanged: sending global event from Panel to Tasks
Plasma::Widget::globalPositionChanged: sending global event from Tasks to TaskGroupItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem

// PanelView changes position and notifications are propogated
// to the WindowTaskItems
Plasma::View::event: global event in PanelView
Plasma::View::event: sending global event from PanelView to Panel
Plasma::Widget::globalPositionChanged: sending global event from Panel to Tasks
Plasma::Widget::globalPositionChanged: sending global event from Tasks to TaskGroupItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem
Plasma::Widget::globalPositionChanged: sending global event from TaskGroupItem to WindowTaskItem

// The managing layout has changes the positions of these three
// WindowTaskItems independently
Plasma::Widget::handleGlobalPositionChange: global event in WindowTaskItem
Plasma::Widget::handleGlobalPositionChange: global event in WindowTaskItem
Plasma::Widget::handleGlobalPositionChange: global event in WindowTaskItem


More information about the Panel-devel mailing list