[Panel-devel] Applets reordering

cedric cedric.borgese at gmail.com
Sat Oct 27 20:16:36 CEST 2007


Ok, I wrote a new patch, but I'm not happy with it as it has some drawbacks.

1) to catch when an applet got focus, I reimplemented focusInEvent, but in 
practice, this method is never called, so I tried with mousePressEvent, it 
works better, but only when you click on the QGraphicsItem that is the 
applet, so in all applets I tested, it works only if you click on the 
border :/
I don't find a reliable way to catch when an applet got focus.

2) using mousePressEvent works only if the applet derivate doesn't 
reimplements it, for example, it not work for the Frame applet.
Of course we can fix all applets, but this is really a bad design as it 
implies all writers of applet know these trics and don't forget to call the 
parent method.

3) this is not directly related to this patch, but it is a bug to fix :
as applets are children of containment, if a containment B is above another 
one A, all applets on A can never be shown above B. This bug is annoying on 
dual screen setups, there are 2 desktop containment lets say A and B, if A is 
the below container, when you drag your applet from A to B, it "magically" 
disappear on the egde of the screen.
I don't know if this could be solved changing the z value of a container once 
one of its applet is selected as I don't know a reliable way to know that 
(same problem for the applets) and I don't know if the QGraphics system will 
take the changes on the fly while we are dragging the applet (I guess it is 
ok for this, but haven't tested)
But with this method we get trouble for panel containments if desktop 
containments are draw above them.

just a comment on my patch, I made this change :

-            r.moveLeft(INTER_CONTAINMENT_MARGIN * screen);
+            //r.moveLeft(r.x() + INTER_CONTAINMENT_MARGIN * screen);

to fix the problem seen by andras (and me) explained here 
http://lists.kde.org/?t=119344065800002&r=1&w=2
I discuss about it on IRC and got no feedback until here, but it is not 
intended to be commited, so you can ignore it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: focus.diff
Type: text/x-diff
Size: 4570 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071027/45fe936f/attachment.bin 


More information about the Panel-devel mailing list