Instead of relying on USPosition to avoid tiling Plasma

windows, use the Plasma-desktop window class.
This is a temporary workaround until Plasma exposes
more classes and integrates better with KWin.

Okayed by Lubos Lunak:
http://reviewboard.kde.org/r/4255

Should fix 241051 without having any special
settings for OpenOffice.org windows.

BUG: 241051

svn path=/trunk/KDE/kdebase/workspace/; revision=1137887
This commit is contained in:
Nikhil Marathe 2010-06-14 15:17:17 +00:00
parent 3316aa7aa5
commit 3fa0dbdccb

View file

@ -29,6 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <knotification.h>
#include <klocale.h>
#include <kwindowinfo.h>
#include <kwindowsystem.h>
#include "lib/kdecoration.h"
@ -110,24 +112,16 @@ void Workspace::removeTile( Client *c )
bool Workspace::tileable( Client *c )
{
kDebug(1212) << c->caption();
// TODO: if application specific settings
// to ignore, put them here
// as suggested by Lucas Murray
// see Client::manage ( ~ line 270 of manage.cpp at time of writing )
// This is useful to ignore plasma widget placing.
// According to the ICCCM if an application
// or user requests a certain geometry
// respect it
long msize;
XSizeHints xSizeHint;
XGetWMNormalHints(display(), c->window(), &xSizeHint, &msize);
if( xSizeHint.flags & PPosition ||
xSizeHint.flags & USPosition ) {
kDebug(1212) << "Not tileable due to USPosition requirement";
kDebug(1212) << c->caption();
KWindowInfo info = KWindowSystem::windowInfo( c->window(), -1U, NET::WM2WindowClass );
kDebug(1212) << "WINDOW CLASS IS "<< info.windowClassClass();
if( info.windowClassClass() == "Plasma-desktop" )
{
return false;
}
// TODO: if application specific settings
// to ignore, put them here
if( !c->isNormalWindow() )
{
@ -140,6 +134,7 @@ bool Workspace::tileable( Client *c )
return false;
}
kDebug() << "Tiling" << c;
return true;
}