diff --git a/client.h b/client.h index 293182b73a..759aef3aa5 100644 --- a/client.h +++ b/client.h @@ -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(); diff --git a/geometry.cpp b/geometry.cpp index 92da87b87e..e59b83a06f 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -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 ); diff --git a/manage.cpp b/manage.cpp index 4f5be79a84..bd22726b43 100644 --- a/manage.cpp +++ b/manage.cpp @@ -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; } diff --git a/utils.h b/utils.h index 931806efac..0d14d4b24c 100644 --- a/utils.h +++ b/utils.h @@ -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