Do not use QWidget::showFullScreen() etc. (was Re: KDE)

Lubos Lunak l.lunak at suse.cz
Fri Mar 14 20:15:47 GMT 2008


On Thursday 13 of March 2008, Armin Berres wrote:
> On Tue, 11 Mar 08 00:16, Lubos Lunak wrote:
> >  Use QWidget::setWindowState() as noted above, or some of the helper
> > functions.
>
> Apropos helper functions: It seems as if  KWindowSystem::setState() is
> broken. This has been reported quite some time ago as #150772. Has
> anyone a clue what's going on? Various programs (e.g. Okular) are hit
> by this bug...

 Yes. All that's needed is to notice that the window has the right size for a 
moment before it resizes and copy&paste kBacktrace() code to 
QWidget::resize() to get:

[
0: /opt/_q/lib/libQtGui.so.4 [0xb67a12ce]
1: /opt/_q/lib/libQtGui.so.4(QWidget::resize(QSize const&)+0x2c) [0xb67aa990]
2: /opt/_k/lib/libkdeui.so.5(QWidget::resize(int, int)+0x3d) [0xb7880bc1]
3: /opt/_q/lib/libQtGui.so.4(QWidget::setMinimumSize(int, int)+0x118) 
[0xb67ad4d0]
4: /opt/_k/lib/libkdeui.so.5(QWidget::setMinimumSize(QSize const&)+0x3e) 
[0xb7898b60]
5: /opt/_q/lib/libQtGui.so.4(QLayout::activate()+0x421) [0xb67822cf]
6: /opt/_q/lib/libQtGui.so.4(QLayout::widgetEvent(QEvent*)+0x24a) [0xb6782be0]
7: /opt/_q/lib/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, 
QEvent*)+0x146) [0xb674dcee]
8: /opt/_q/lib/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x1c0f) 
[0xb674f95d]
9: /opt/_k/lib/libkdeui.so.5(KApplication::notify(QObject*, QEvent*)+0x25b) 
[0xb794095f]
10: /opt/_q/lib/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, 
QEvent*)+0xe4) [0xb7edf3da]
11: /opt/_q/lib/libQtCore.so.4(QCoreApplication::sendEvent(QObject*, 
QEvent*)+0x4f) [0xb7ee2c93]
12: /opt/_q/lib/libQtCore.so.4
(QCoreApplicationPrivate::sendPostedEvents(QObject*, int, 
QThreadData*)+0x350) [0xb7edf8f2]
13: /opt/_q/lib/libQtCore.so.4(QCoreApplication::sendPostedEvents(QObject*, 
int)+0x33) [0xb7edfaa3]
14: /opt/_k/lib/libkdeui.so.5(QCoreApplication::sendPostedEvents()+0x26) 
[0xb79dd208]
15: /opt/_q/lib/libQtGui.so.4
(QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x32) 
[0xb67f4d12]
16: /opt/_q/lib/libQtCore.so.4
(QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x62) 
[0xb7edc25a]
17: /opt/_q/lib/libQtCore.so.4
(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x10b) [0xb7edc407]
18: /opt/_q/lib/libQtCore.so.4(QCoreApplication::exec()+0x119) [0xb7edfbc3]
19: /opt/_q/lib/libQtGui.so.4(QApplication::exec()+0x24) [0xb674da40]
20: okular(main+0x4c2) [0x8050b66]
21: /lib/libc.so.6(__libc_start_main+0xe0) [0xb62c6fe0]
22: okular(KMainWindow::setCaption(QString const&, bool)+0x49) [0x8050641]
]

 That's a Qt bug. It resizes the window when it's already shown. It's better 
visible when one comments out all the KMainWindow resizing code and only uses 
KWin's window-specific settings to set the window initially to maximized - 
the same will happen.

-- 
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