Summary: | Shade messes up window size | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | illogic-al <illogical1> |
Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apaku, aurel.w, chanika, dylang, hasso, hubn3rd, kdebugs, l.lunak, self |
Priority: | NOR | ||
Version: | CVS | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
illogic-al
2005-01-08 22:20:40 UTC
It happens with KDevelop as well, so it's most probably KMDI's fault. The window itself is not resized at all, only the frame added by KWin, so my guess is KMDI tries some weird tricks. just updating info. *** Bug 98229 has been marked as a duplicate of this bug. *** *** Bug 102262 has been marked as a duplicate of this bug. *** Seli: #102138 reports that with ksirc. No kmdi there *** Bug 102610 has been marked as a duplicate of this bug. *** Can confirm that this also happens with Kopete 0.10 (KDE 3.4 SuSE 9.2) this also happens with kate , on Debian sid with kde 3.4 from experimental (kdelibs 4:3.4.0-0pre4 released Apr 19) *** Bug 104391 has been marked as a duplicate of this bug. *** I too can confirm it most of the time with quanta and showimg ((kdelibs 4:3.4.0-0pre4, Kanotix/Debian). It mostly happens if another window of another program is open too. And it also happend with konqueror clicked to shade the first time on a newly installed Kubuntu 5.04 (afterwards nomore). With showimg I once reached a state where after a lot of shading and resizing the window suddenly resized correctly after a shade and I couldn't reproduce the wrong resizing in that session. But restarting the computer next day showimg couldn't restore the vertical window size again and I cannot deliberately reproduce the behaviour. Never have with other applications... *** Bug 104622 has been marked as a duplicate of this bug. *** See also the comments on bug 102295, this affects emacs and xv. Hi, as this bug has been around for quite a while, with no progess that can be seen, I'd like to ask what the problem is? I mean, will kmdi be thrown out of KDE soon, so that this is irrelevant. Or is it just not reproduceable or too hard to track down? I had hoped that this would be fixed in 3.4.1, but currently it seems nobody is working on it at all... Andreas please be patient. i don't have a lot of spare time. You find me more spare time, I can spend more time to fix the bug. Did you know this bug is reproducable for *all* program windows? I tried it in KDE 3.4.0 and 3.4.1 on Kubuntu and on Kanotix: Shade a program window (it really doesn't matter which program) and open kcontrol and choose a new window decoration and apply it - then unshade the other window et voilĂ : it unshades to a vertically shrinked size. Drag it to the right size, shade it, unshade it - everything's ok. Shade it, choose other window decoration, apply it, unshade window - wrong size and so on. This happens for me all the time for emacs windows since upgrading to KDE 3.4.1 (SuSE 9.1). The window is restored with a height of just one line. Hi, from the last 2 posts, I'd suspect this not to be a kmdi but rather a kwin problem?? Maybe it's possible to open a bug with kwin on this or shift it over to kwin? Andreas It was under kwin as bug 102295, the bug was closed invalid there. SVN commit 423512 by lunakl: An attempt to get the crazy shaded windows geometry handling right. This fixes comment #10 in 96602, I don't know if it fixes as a whole, but I'm quite sure people will complain again if not. BUG: 96602 M +6 -11 client.cpp M +1 -2 client.h M +71 -37 geometry.cpp M +4 -3 rules.cpp Compiled from: File: kdebase-423575.tar.bz2 File: kdelibs-423572.tar.bz2 Kate still does not unshade to correct size when shaded and unshaded. Well, I said this was a KMDI bug. Ok, still kwin's fault after all. SVN commit 425377 by lunakl: Another final attempt at sorting out the shaded geometry problems. This time at least the code should detect properly all attempts to use shaded geometry when the normal one is needed. BUG: 96602 M +1 -0 client.h M +19 -6 geometry.cpp M +1 -1 rules.cpp --- trunk/KDE/kdebase/kwin/client.h #425376:425377 @@ -102,6 +102,7 @@ SizemodeMax // try not to make it larger in either direction }; QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const; + QSize adjustedSize() const; QPixmap icon() const; QPixmap miniIcon() const; --- trunk/KDE/kdebase/kwin/geometry.cpp #425376:425377 @@ -1010,6 +1010,13 @@ return sizeForClientSize( wsize, mode, false ); } +// this helper returns proper size even if the window is shaded +// see also the comment in Client::setGeometry() +QSize Client::adjustedSize() const + { + return sizeForClientSize( clientSize()); + } + /*! Calculate the appropriate frame size for the given client size \a wsize. @@ -1022,6 +1029,11 @@ { int w = wsize.width(); int h = wsize.height(); + if( w < 1 || h < 1 ) + { + kdWarning() << "sizeForClientSize() with empty size!" << endl; + kdWarning() << kdBacktrace() << endl; + } if (w<1) w = 1; if (h<1) h = 1; @@ -1247,7 +1259,7 @@ xSizeHint.win_gravity = NorthWestGravity; if( isManaged()) { // update to match restrictions - QSize new_size = adjustedSize( size()); + QSize new_size = adjustedSize(); if( new_size != size() && !isFullScreen()) resizeWithChecks( new_size ); } @@ -1447,8 +1459,8 @@ { if( h == border_top + border_bottom ) { - kdDebug() << "Shaded geometry passed for size:" << endl; - kdDebug() << kdBacktrace() << endl; + kdWarning() << "Shaded geometry passed for size:" << endl; + kdWarning() << kdBacktrace() << endl; } } int newx = x(); @@ -1614,7 +1626,8 @@ // shading. Then the frame geometry is adjusted for the shaded geometry. // This gets more complicated in the case the code does only something like // setGeometry( geometry()) - geometry() will return the shaded frame geometry. - // Such code is wrong and should be changed to handle the case when the window is shaded. + // Such code is wrong and should be changed to handle the case when the window is shaded, + // for example using Client::clientSize(). if( shade_geometry_change ) ; // nothing else if( isShade()) @@ -1664,7 +1677,7 @@ void Client::plainResize( int w, int h, ForceGeometry_t force ) { - // this code is also duplicated in Client::setGeometry() + // this code is also duplicated in Client::setGeometry(), and it's also commented there if( shade_geometry_change ) ; // nothing else if( isShade()) @@ -1752,7 +1765,7 @@ if( pending_geometry_update ) { if( isShade()) - setGeometry( QRect( pos(), sizeForClientSize( clientSize())), ForceGeometrySet ); + setGeometry( QRect( pos(), adjustedSize()), ForceGeometrySet ); else setGeometry( geometry(), ForceGeometrySet ); pending_geometry_update = false; --- trunk/KDE/kdebase/kwin/rules.cpp #425376:425377 @@ -828,7 +828,7 @@ workspace()->activateNextClient( this ); // MoveResizeMode // Closeable - QSize s = adjustedSize( sizeForClientSize( clientSize())); // handle shading + QSize s = adjustedSize(); if( s != size()) resizeWithChecks( s ); setShortcut( rules()->checkShortcut( shortcut().toString())); Hi, the 2 commits from Lubos Lunak fix the problem here. I integrated both into the debian 3.4.1 packages and reinstalled only kwin with these fixes and shading works again :-) Andreas *** Bug 108491 has been marked as a duplicate of this bug. *** Can i ask if there was a reason these changes were not put into 3.4.2? I don't consider the changes safe enough for backporting. KDE3.5 will be released quite soon. Could you explain a bit more? I backported them to 3.4.1 (into the debian experimental packages) myself and until now I could not encounter _any_ misbehaviour, crashes or any other error that could be related to those changes. Of course this is just an academic discussion as 3.4.2 has already been released... Andreas I assume ( not being a member of the KDE team ) that a *.*.<version> release is meant to a bugfix to direct applications as this change needed NETWM to be adapted it was done for a *.<version> release. When doing changes to KdeCore you need to be sure you have not effected any other applications that depend on it. That takes a lot of testing being such a large codebase. Sorry i meant to say, that it was built apon new changes in NETVM, not that NETWM needed changing for this fix. Its late :) If you've tested the patches, feel free to backport them for the KDE3.4.x branch too. Hi, I'm neither a kde developer (in terms of doing official kde development) nor am I a debian developer - I just write bugreports and sometimes small patches. But Debian QT/KDE Maintainers added the fix to the KDE 3.4.2 packages :-) So no need for me to backport myself... Andreas *** Bug 114192 has been marked as a duplicate of this bug. *** ahh, if only I'd seen this bug on the weekend when I was bored. I'd like to see this fix in gentoo packages, but... how would I make that happen? |