[Kde-games-devel] does this solve the multiple resizing bug foryou?

Alan Alpert alanalpert at optusnet.com.au
Thu May 7 01:23:08 CEST 2009


On Thursday 07 May 2009 08:19:57 Aaron J. Seigo wrote:
> On Wednesday 06 May 2009, Stefan Majewsky wrote:
> > On Mittwoch 06 Mai 2009 23:45:00 Wolfgang Rohdewald wrote:
> > > In conclusion, we do not need to ask plasma or whatever window manager
> > > is running for the side panel sizes, but we could ask it how much space
> > > the window borders will take. I don't know such a function - and it
> > > should also work with MAC OS and Windows. Maybe ask KWin via DBus but I
> > > don't know how.
> >
> > We cannot rely neither on KWin nor on Plasma nor on anything in the KDE
> > stack except for KDE's libraries. Rather than playing around all of the
> > above issues, wouldn't it be easier to poke the Qt and kdeui developers
> > to fix [Q| K]MainWindow behavior in this regard, or is this not feasible?
>
> probably, once someone tracks down the issues ... :)

Okay, I think I've found the issue(s) (caveat: I've only had time to look 
through the code and so have not yet tested my theory to confirm it. When I 
have time, in a few days, I'll bring you test results if you don't already 
have them).

In KMainWindow::restoreWindowSize(). inside an #ifdef Q_WS_X11 there are two 
interesting fragments of code. (around line 922 @ r963857)

if(( state & NET::Max ) == NET::Max )
                resize( desk.width(), desk.height() ); // WORKAROUND: this 
should not be needed. KWindowSystem::setState should be enough for maximizing. 
(ereslibre)

and a little further down

// QWidget::showMaximized() is both insufficient and broken
KWindowSystem::setState( winId(), state );

One or both of these fragments is in error. The first one appears to be trying 
to do the same compensation we are doing, but doesn't compensate for the 
panel(s) and thus we might have our problem fixed at the right level if we 
apply the logic from this thread and make it

if(( state & NET::Max ) == NET::Max ){
 QDesktopWidget *desktop = QApplication::desktop();
 QRect r = desktop->availableGeometry(desktop->screen(window));
 resize(r.width(), r.height()); //WORKAROUND: Else applications get resized 
after initialization
}

With respect to the other fragment, it suggests that if 
QWidget::showMaximized() worked then we wouldn't have this problem in the first 
place. Unfortunately it does not provide enough information to easily 
determine how to get QWidget::showMaximized() to work.

It does look like it's possible to solve this problem without convoluted hacks 
in each app.

--
Alan Alpert


More information about the kde-games-devel mailing list