Bug 182487 - Pager is resized upon relogin
Summary: Pager is resized upon relogin
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-30 21:31 UTC by Olaf Lenz
Modified: 2009-02-18 09:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the pager before logging out. (32.90 KB, image/png)
2009-01-30 21:32 UTC, Olaf Lenz
Details
Screenshot of the pager after logging in. (30.85 KB, image/png)
2009-01-30 21:33 UTC, Olaf Lenz
Details
Screenshot of the pager after logging in a second time. (26.98 KB, image/png)
2009-01-30 21:33 UTC, Olaf Lenz
Details
Pager after login. Using Slim Glow plasmatheme (13.76 KB, image/png)
2009-02-01 15:52 UTC, Marc Weidinger
Details
Fix pager plasmoid resizing bug (1.16 KB, patch)
2009-02-02 21:56 UTC, Robin Pedersen
Details
Possible fix (1.45 KB, patch)
2009-02-03 14:23 UTC, Robin Pedersen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Lenz 2009-01-30 21:31:10 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    Ubuntu Packages

When I have a pager plasmoid on my desktop, log out and log in again, the pager has changed its size. After the second (re-)login, the pager has become so small as to be unusable.

This buggy behaviour doesn't seem to depend on the position on the desktop (also when I put it in the center), and also occurs in a fresh user account that has no extra plasmoids installed.

I will attach screenshots that show the pager before logout, after logging in again, and after logging out and in a second time.

PS: If you carefully examine the screenshots, you will notice that something else changes, too, namely the position of the System Monitor plasmoid in the panel on the right side. I will report this in an extra bug report, though.
Comment 1 Olaf Lenz 2009-01-30 21:32:09 UTC
Created attachment 30753 [details]
Screenshot of the pager before logging out.
Comment 2 Olaf Lenz 2009-01-30 21:33:00 UTC
Created attachment 30754 [details]
Screenshot of the pager after logging in.
Comment 3 Olaf Lenz 2009-01-30 21:33:32 UTC
Created attachment 30755 [details]
Screenshot of the pager after logging in a second time.
Comment 4 Marc Weidinger 2009-02-01 15:48:26 UTC
I can confirm this. Furthermore, the pager is drawn with a wrong aspect ratio, and Plasma theme layers do not align correctly. This seems to depend on the theme used, though.
Comment 5 Marc Weidinger 2009-02-01 15:52:37 UTC
Created attachment 30825 [details]
Pager after login. Using Slim Glow plasmatheme
Comment 6 Robin Pedersen 2009-02-02 21:56:24 UTC
Created attachment 30881 [details]
Fix pager plasmoid resizing bug

This patch seems to have fixed the bug for me. The problem was that the rect returned be QGraphicsWidget::contentsRect() was assumed to include the margins, which it doesn't. Thus, subtracting the margins from the rect resulted in the size being slightly smaller each time it was recalculated.

I have svn access, and can apply the patch if there aren't any objections.
Comment 7 Olaf Lenz 2009-02-03 11:29:45 UTC
After I finally managed to compile the pager, I can confirm that this fixes the bug. 
Due to the fix, also some strange artefacts that happened when resizing the pager have disappeared.
Good catch!
From my point of view: apply the patch.
Comment 8 Robin Pedersen 2009-02-03 12:11:34 UTC
SVN commit 920594 by rpedersen:

Fix pager plasmoid resizing bug

The problem was that the rect returned be QGraphicsWidget::contentsRect() was assumed to include the margins, which it doesn't. Thus, subtracting the margins from the rect resulted in the size being slightly smaller each time it was recalculated.

BUG: 182487

 M  +2 -2      pager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=920594
Comment 9 Robin Pedersen 2009-02-03 12:17:25 UTC
SVN commit 920596 by rpedersen:

backport 920594

CCBUG: 182487


 M  +2 -2      pager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=920596
Comment 10 Robin Pedersen 2009-02-03 12:41:10 UTC
I just realized that I just _reverted_ the last bugfix by aseigo. Obviously, this bug was introduced when bug 180440 was fixed.

I think the margins must be handled differently for the desktop and the panel. I will try to figure this out, but unfortunately my current location is not ideal for debugging this.
Comment 11 Robin Pedersen 2009-02-03 14:23:01 UTC
Created attachment 30909 [details]
Possible fix

After some debugging, I came up with this hack to fix the bug, without reintroducing bug 180440.

I'll wait until aseigo is available for comments.
Comment 12 Robin Pedersen 2009-02-05 18:02:44 UTC
SVN commit 921782 by rpedersen:

Handle margins correctly both when pager is on desktop and in panel

This should result in correct behavior in both cases. But IMHO, this
requires a better solution..

BUG: 180440
BUG: 182487

 M  +8 -2      pager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=921782
Comment 13 Robin Pedersen 2009-02-05 18:05:16 UTC
SVN commit 921784 by rpedersen:

backport 921782

CCBUG: 180440
CCBUG: 182487


 M  +8 -2      pager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=921784
Comment 14 Olaf Lenz 2009-02-06 10:20:03 UTC
Unfortunately, I have to reopen the bug. When I apply your latest patch, the pager is still resized upon relogin.

I have experimented a bit, and the problem seems to be that the location()-logic doesn't seem to work: location() == Plasma::Desktop is always false, so that the alternative size calculation is never used.

So, the fix unfortunately is not complete.
Comment 15 Robin Pedersen 2009-02-06 10:42:37 UTC
OK, thanks for testing it. I also tried this first:
if (formFactor() != Plasma::Vertical && formFactor() != Plasma::Horizontal)

It didn't work either, because when the pager is resized on the desktop, it actually is either Vertical or Horizontal, which leads to wierd effects.

I hope someone with more knowledge of plasma can have a look at this. I'll be busy with real life for the next few days.
Comment 16 Olaf Lenz 2009-02-06 10:46:29 UTC
No problem, and thanks for trying it!

Just one more hint: From

http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/namespacePlasma.html#2e56eee20e28bd3df07081e9ac7cf72b

I conclude, that location() does not at all give any hint on whether an applet is used on the Desktop or in the Panel.
Comment 17 Robin Pedersen 2009-02-17 22:17:08 UTC
SVN commit 927574 by rpedersen:

Handle margins correctly both when pager is on desktop and in panel

Using Plasma::Desktop did not work, now using Plasma::Floating instead
which seems to work for me.

CCBUG: 180440
CCBUG: 182487

 M  +2 -2      pager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=927574
Comment 18 Olaf Lenz 2009-02-18 09:39:17 UTC
Now I can confirm that the fix indeed works to fix the resizing problem. Good catch!