applyMainWindowSettings bug?
Lubos Lunak
l.lunak at suse.cz
Fri May 2 15:47:59 BST 2008
On Thursday 01 of May 2008, Vladimir Prus wrote:
> 6. Run application again. Expected result is the the window be maximized.
> Actual result is that the window is 200x200.
http://bugs.kde.org/show_bug.cgi?id=150772 . Qt bug.
> I think what happens is.
> 1. KMainWindow::restoreWindowSize, when handling the maximized window,
> does not call resize(). Instead, it asks the window manager to resize
> the window.
> 2. QWidget::setMinimumSize does:
> resize(qMax(minw,width()), qMax(minh,height()));
> since the size is not yet changed at this point, we explicitly set the
> size to whatever the size the widget already has.
>
> It seems that the only right solution would be to wait for the window
> manager to actually resize the window to whatever size corresponds to
> "maximized".
No. If memory serves me well, that's actually what happens and what is
causing the problem. The resizing in your step 2. actually happens _after_
the window is shown and maximized by the window manager, because of Qt's
delayed layout activation (or whatever it is exactly that triggers it so
late). So the window is first maximized by the window manager and then the
application immediatelly asks to be resized again (and width()/height() still
return old size because of X being asynchronous).
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz
More information about the kde-core-devel
mailing list