Bug 166149

Summary: Plasma applet position reverts after move
Product: [Unmaintained] plasma4 Reporter: Jonathan Thomas <echidnaman>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: case 1
case 2

Description Jonathan Thomas 2008-07-09 17:01:25 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

Using the Project Neon KDE Nightly packages, svn 829712.

Steps to reproduce:
-Add an applet that can be dragged around by the actual applet. (Digital clock, icon, etc)
-Drag it somewhere by dragging on the actual applet.
-Don't let the applet handles go away. Now try dragging the applet by the applet handles. (The new ones are nice, btw)
-The applet will jump back to it's old position on the screen.
Comment 1 Mario Oschwald 2008-07-10 01:35:09 UTC
I can confirm this bug and have encountered another similar one:

-add a battery applet
-make it really large with the applet handle
-make it really small with the applet handle
-don't let the applet handles go away and click on the applet to move it
-watch it jump to the former top left corner of the larger version

Two videos attached to show the behavior.
Comment 2 Mario Oschwald 2008-07-10 01:36:34 UTC
Created attachment 25998 [details]
case 1
Comment 3 Mario Oschwald 2008-07-10 01:37:09 UTC
Created attachment 25999 [details]
case 2
Comment 4 Mario Oschwald 2008-07-10 03:11:28 UTC
OK, I think I found the reason for the 1st case of this bug, even though I don't know how to fix this properly (The entanglement between applet handles, and applets in regard to moving is imo pretty nasty)

If you move an Applet via the Applet::MouseMoveEvent Method it changes (if a handle is present) the position of the handle. Since at that time it is child of
the handle it moves along with the handle as it's coordinate system is relative to the parents - this does not change the applets local coordinates. If you then (before the handle is destroyed) use the the handle to move the applet the bug occurs in that the handle stores the current position of the applet (which hasn't changed during the previous move) then adjusts its own position to that position (+delta).

In other words the applet thinks "I'll stick with the handle" and the handle thinks, "I'll stick with the applet".
Comment 5 Aaron J. Seigo 2008-07-10 03:36:20 UTC
SVN commit 830264 by aseigo:

fix various handle regressions, including:
* move applet or resize it then move with handle and it pops to a new location
* handles unhover too soon
* handles don't show on the correct side always
* handles are not visually associated well enough with the target applet
* icons are hard to see
BUG:166149


 M  +105 -46   applethandle.cpp  
 M  +4 -2      applethandle_p.h  
 M  +4 -3      containment.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=830264