Bug 164800 - kickoff does not save size, after logout size is back to default
Summary: kickoff does not save size, after logout size is back to default
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 164639 169269 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-24 01:09 UTC by Luiz Felipe Talvik
Modified: 2008-09-01 21:02 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
diff file (689 bytes, patch)
2008-07-12 06:11 UTC, Luiz Felipe Talvik
Details
Before logging off. (28.99 KB, image/jpeg)
2008-09-01 19:42 UTC, Chris Robinson
Details
Kickoff after logging out. (59.34 KB, image/jpeg)
2008-09-01 19:43 UTC, Chris Robinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luiz Felipe Talvik 2008-06-24 01:09:32 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

When I resize kickoff, the size I have set is only kept until I logout. Then kickoff is back to its default size.
Comment 1 Tim Beaulen 2008-06-24 19:59:41 UTC
Partially confirmed:
Kickoff doesn't go to its default size.

I resizes differently than what you've set though.
And if the width or height is too small, it uses the minimumSizeHint, which seems to be the default.

After looking at the code and doing some debugging:
- Width and height are saved correctly in plasma-appletsrc
- Width and height are read correctly
- The resizing doesn't reflect the saved or the loaded parameters.


Comment 2 Tim Beaulen 2008-06-24 20:49:46 UTC
"And if the width or height is too small, it uses the minimumSizeHint, which seems to be the default."

That's not correct.

I've added some debugging lines in launcher.cpp
kde4-devel@localhost ~/kde/src/kdebase/workspace/plasma/applets/kickoff $ svn diff                                                          
Index: ui/launcher.cpp                                                                                                                      
===================================================================
--- ui/launcher.cpp     (revision 823779)
+++ ui/launcher.cpp     (working copy)
@@ -639,6 +639,7 @@
     }
     const int width = qMin(sizeGroup.readEntry("Width", 0), QApplication::desktop()->screen()->width()-50);
     const int height = qMin(sizeGroup.readEntry("Height", 0), QApplication::desktop()->screen()->height()-50);
+    kDebug() << " ### KICKOFF LOAD FROM CONFIG ### width = " << width << " and height = " << height;
     QSize wanted(width, height);
     bool isDefault = wanted.isNull();
     wanted = wanted.expandedTo(minimumSizeHint());
@@ -646,6 +647,8 @@
        wanted.setHeight( wanted.height() + ( d->favoritesView->sizeHintForRow(0) * (d->visibleItemCount - 3) ) );
     }

+    kDebug() << " ### KICKOFF WANTED ### width = " << wanted.width() << " and height = " << wanted.height();
+
     return wanted;
 }

@@ -977,6 +980,8 @@
 void Launcher::resizeEvent(QResizeEvent *e)
 {
     d->adjustResizeHandlePosition();
+
+    kDebug() << " ### KICKOFF RESIZE EVENT ### size = " << e->size();
     QWidget::resizeEvent(e);
 }

@@ -1000,6 +1005,7 @@
        }
        sizeGroup.writeEntry("Height", height());
        sizeGroup.writeEntry("Width", width());
+       kDebug() << " ### KICKOFF SAVING ### width = " << width() << " and height = " << height();
        emit configNeedsSaving();
     }
     QWidget::mouseReleaseEvent(e);



This gives the following results:

Run 1: Setting the size of kickoff to 368x287, kquitapp plasma, plasma
This gives the following debug lines:

        ...
        plasma(6764) Kickoff::Launcher::sizeHint:  ### KICKOFF LOAD FROM CONFIG ### width =  368  and height =  287
        plasma(6764) Kickoff::Launcher::sizeHint:  ### KICKOFF WANTED ### width =  368  and height =  287
        ...
        plasma(6764) Kickoff::Launcher::resizeEvent:  ### KICKOFF RESIZE EVENT ### size =  QSize(368, 287)
        ...


Run 2: Setting the size of kickoff to 482x378, kquitapp plasma, plasma
This gives the following debug lines:

        ....
        plasma(6785) Kickoff::Launcher::sizeHint:  ### KICKOFF LOAD FROM CONFIG ### width =  482  and height =  378
        plasma(6785) Kickoff::Launcher::sizeHint:  ### KICKOFF WANTED ### width =  482  and height =  378
        ...
        plasma(6785) Kickoff::Launcher::resizeEvent:  ### KICKOFF RESIZE EVENT ### size =  QSize(482, 378)
        ...


Run 3: Setting the size of kickoff to 685x516, kquitapp plasma, plasma
This gives the following debug lines:

        ....
        plasma(6792) Kickoff::Launcher::sizeHint:  ### KICKOFF LOAD FROM CONFIG ### width =  685  and height =  516
        plasma(6792) Kickoff::Launcher::sizeHint:  ### KICKOFF WANTED ### width =  685  and height =  516
        ....
        plasma(6792) Kickoff::Launcher::resizeEvent:  ### KICKOFF RESIZE EVENT ### size =  QSize(682, 512)
        ....


Run 3: Setting the size of kickoff to 992x706, kquitapp plasma, plasma
This gives the following debug lines:

        ....
        plasma(6798) Kickoff::Launcher::sizeHint:  ### KICKOFF LOAD FROM CONFIG ### width =  974  and height =  706
        plasma(6798) Kickoff::Launcher::sizeHint:  ### KICKOFF WANTED ### width =  974  and height =  706
        ....
        plasma(6798) Kickoff::Launcher::resizeEvent:  ### KICKOFF RESIZE EVENT ### size =  QSize(682, 512)
        ....


Conclusion:
Above a size of 682x512, kickoff seems to be limited (on my pc, I don't know where these numbers come from).
All the sizes are saved and loaded correctly.
Sizes smaller than 682x512 are displayed correctly too.
Comment 3 Tim Beaulen 2008-06-24 21:16:04 UTC
*** Bug 164639 has been marked as a duplicate of this bug. ***
Comment 4 Luiz Felipe Talvik 2008-07-11 18:42:30 UTC
The same happens here. But it works with sizes bellow 853x533.

I tried fixing the bug. But after hours all I could come was this hack. I don't think its a proper solution. I removed launcher->adjustSize() and put launcher->resize(launcher->sizeHint()) instead. It is working as intended now.

~/kde/src/KDE/kdebase/workspace/plasma/applets/kickoff$ svn diff
Index: applet/applet.cpp
===================================================================
--- applet/applet.cpp   (revision 830982)
+++ applet/applet.cpp   (working copy)
@@ -66,7 +66,8 @@
     launcher = new Kickoff::Launcher(q);
     launcher->setWindowFlags(launcher->windowFlags()|Qt::WindowStaysOnTopHint|Qt::Popup);
     launcher->setAutoHide(true);
-    launcher->adjustSize();
+    //launcher->adjustSize();
+    launcher->resize(launcher->sizeHint());
     QObject::connect(launcher, SIGNAL(aboutToHide()), icon, SLOT(setUnpressed()));
     QObject::connect(launcher, SIGNAL(configNeedsSaving()), q, SIGNAL(configNeedsSaving()));
 }


This is the first time i tried fixing a bug and the first time I looked at "real" C++ code(looks very different from the books, i didn't get the d pointers to a class called Private). All QT knowledge I've got is from the first six chapters C++GUI Programming.

For some reason sizeHint is ignored above cretain size. I tried changing sizepolicy and other things but nothing worked. In which situations sizehint is ignored? And is sizehint overload implemented correctly? Is the above solution acceptable?
Comment 5 Luiz Felipe Talvik 2008-07-12 06:11:19 UTC
Created attachment 26052 [details]
diff file

Patch related to my comment above.
Comment 6 Alex Merry 2008-08-07 20:03:05 UTC
Fixed by Alexis Ménard in r840757 (4.1 branch) and r840754 (trunk).
Comment 7 Alex Merry 2008-08-23 16:00:35 UTC
*** Bug 169269 has been marked as a duplicate of this bug. ***
Comment 8 Chris Robinson 2008-09-01 19:40:49 UTC
Not sure if this warrants reopening the bug, but I figured this was similar enough not to have its own bug entry.  If you resize Kickoff to the point where it reaches the edges of the screen, after logging out/rebooting it only stretches to around 2/3 of the size.  It seems that there's a maximum value that Kickoff saves that's dependent on the screen resolution and stops the Kickoff menu from stretching to the edges of the screen.  This isn't much of a problem with larger screens but for ultraportables with small vertical resolutions this makes Kickoff irritating to use, and there doesn't seem to be any functional reason for having a maximum size for Kickoff that's less than the size of the screen.  

I've attached two attachments: kickoff1 shows before, kickoff2 shows after.
Comment 9 Chris Robinson 2008-09-01 19:42:28 UTC
Created attachment 27175 [details]
Before logging off.
Comment 10 Chris Robinson 2008-09-01 19:43:14 UTC
Created attachment 27176 [details]
Kickoff after logging out.
Comment 11 Luiz Felipe Talvik 2008-09-01 21:02:52 UTC
Hi Chris,
the bug you're are experiencing it's the same I reported. It has been fixed both in branch and svn.

Looking at your screenshot, it seems the buttons tab take too much space. I think it would be nice if the buttons could have another layout(Icon + Text horizontal).