So this is why fullscreening on xinerama is so random ... reverting r423736.

If you want KWin to obey the app's idea of what fullscreen geometry might be
just force obeying strict geometry in the workarounds tab in window-specific
settings.


svn path=/trunk/KDE/kdebase/workspace/; revision=514433
This commit is contained in:
Luboš Luňák 2006-02-28 13:03:31 +00:00
parent 03725a7d66
commit f9a6c6c9ba
4 changed files with 34 additions and 20 deletions

View file

@ -361,7 +361,7 @@ class Client : public QObject, public KDecorationDefines
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
void changeMaximize( bool horizontal, bool vertical, bool adjust );
void checkMaximizeGeometry();
bool checkFullScreenHack( const QRect& geom ) const;
int checkFullScreenHack( const QRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
void updateFullScreenHack( const QRect& geom );
void getWmNormalHints();
void getMotifHints();

View file

@ -248,7 +248,6 @@ QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop
return desktopwidget->geometry();
case WorkArea:
return warea;
case FullXineramaArea:
case FullArea:
return desktopwidget->geometry();
case ScreenArea:
@ -2060,12 +2059,7 @@ void Client::setFullScreen( bool set, bool user )
workspace()->updateClientLayer( this ); // active fullscreens get different layer
info->setState( isFullScreen() ? NET::FullScreen : 0, NET::FullScreen );
updateDecoration( false, false );
// XINERAMA
if( isFullScreen() && xSizeHint.width > workspace()->clientArea(FullScreenArea, this).width() )
setGeometry( workspace()->clientArea( FullXineramaArea, this ));
else if( isFullScreen() && xSizeHint.height > workspace()->clientArea(FullScreenArea, this).height() )
setGeometry( workspace()->clientArea( FullXineramaArea, this ));
else if( isFullScreen())
if( isFullScreen())
setGeometry( workspace()->clientArea( FullScreenArea, this ));
else
{
@ -2080,24 +2074,38 @@ void Client::setFullScreen( bool set, bool user )
updateWindowRules();
}
bool Client::checkFullScreenHack( const QRect& geom ) const
int Client::checkFullScreenHack( const QRect& geom ) const
{
// if it's noborder window, and has size of one screen or the whole desktop geometry, it's fullscreen hack
return (( geom.size() == workspace()->clientArea( FullArea, geom.center(), desktop()).size()
|| geom.size() == workspace()->clientArea( ScreenArea, geom.center(), desktop()).size())
&& noBorder() && !isUserNoBorder() && isFullScreenable( true ));
if( noBorder() && !isUserNoBorder() && isFullScreenable( true ))
{
if( geom.size() == workspace()->clientArea( FullArea, geom.center(), desktop()).size())
return 2; // full area fullscreen hack
if( geom.size() == workspace()->clientArea( ScreenArea, geom.center(), desktop()).size())
return 1; // xinerama-aware fullscreen hack
}
return 0;
}
void Client::updateFullScreenHack( const QRect& geom )
{
bool is_hack = checkFullScreenHack( geom );
if( fullscreen_mode == FullScreenNone && is_hack )
int type = checkFullScreenHack( geom );
if( fullscreen_mode == FullScreenNone && type != 0 )
{
fullscreen_mode = FullScreenHack;
updateDecoration( false, false );
setGeometry( workspace()->clientArea( FullScreenArea, this ));
QRect geom;
if( rules()->checkStrictGeometry( false ))
{
geom = type == 2 // 1 - it's xinerama-aware fullscreen hack, 2 - it's full area
? workspace()->clientArea( FullArea, geom.center(), desktop())
: workspace()->clientArea( ScreenArea, geom.center(), desktop());
}
else
geom = workspace()->clientArea( FullScreenArea, geom.center(), desktop());
setGeometry( geom );
}
else if( fullscreen_mode == FullScreenHack && !is_hack )
else if( fullscreen_mode == FullScreenHack && type == 0 )
{
fullscreen_mode = FullScreenNone;
updateDecoration( false, false );

View file

@ -205,10 +205,17 @@ bool Client::manage( Window w, bool isMapped )
else
area = workspace()->clientArea( PlacementArea, geom.center(), desktop());
if( checkFullScreenHack( geom ))
if( int type = checkFullScreenHack( geom ))
{
fullscreen_mode = FullScreenHack;
geom = workspace()->clientArea( FullScreenArea, geom.center(), desktop());
if( rules()->checkStrictGeometry( false ))
{
geom = type == 2 // 1 - it's xinerama-aware fullscreen hack, 2 - it's full area
? workspace()->clientArea( FullArea, geom.center(), desktop())
: workspace()->clientArea( ScreenArea, geom.center(), desktop());
}
else
geom = workspace()->clientArea( FullScreenArea, geom.center(), desktop());
placementDone = true;
}

View file

@ -97,8 +97,7 @@ enum clientAreaOption
// these below don't depend on xinerama settings
WorkArea, // whole workarea (all screens together)
FullArea, // whole area (all screens together), ignore struts
ScreenArea, // one whole screen, ignore struts
FullXineramaArea
ScreenArea // one whole screen, ignore struts
};
enum ShadeMode