[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Drop kwin's fullscreen hack
From:       Martin =?utf-8?q?Gr=C3=A4=C3=9Flin?= <kde () martin-graesslin ! com>
Date:       2009-08-30 16:58:13
Message-ID: 200908301858.24370.kde () martin-graesslin ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Attached is a patch to remove kwin's fullscreen hack for not-netwm windows 
without borders and the screen geometry. I want to drop it because the Plasma 
netbook shell has no border and has the screen geometry and has said to be not 
fullscreen, but is made fullscreen by the hack and by that set above all other 
windows which isn't intended.

Are there any reasons to not commit the patch? It will break legacy 
applications, but after all that time I think we could start enforcing netwm 
;-) And it is still possible to define a window rule for supporting the legacy 
applications.

["fullscreen-hack.diff" (text/x-patch)]

commit bf48780d46358fb6249a63c8ca8ee666bf795b84
Author: Martin Gräßlin <ubuntu@martin-graesslin.com>
Date:   Sun Aug 30 18:48:15 2009 +0200

    Remove fullscreen hack

diff --git a/client.h b/client.h
index fa5dc47..b2de3d8 100644
--- a/client.h
+++ b/client.h
@@ -391,8 +391,6 @@ class Client
         QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const;
         void changeMaximize( bool horizontal, bool vertical, bool adjust );
         void checkMaximizeGeometry();
-        int checkFullScreenHack( const QRect& geom ) const; // 0 - None, 1 - One \
                xinerama screen, 2 - Full area
-        void updateFullScreenHack( const QRect& geom );
         void getWmNormalHints();
         void getMotifHints();
         void getIcons();
@@ -528,8 +526,7 @@ class Client
         enum FullScreenMode
             {
             FullScreenNone,
-            FullScreenNormal,
-            FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
+            FullScreenNormal
             };
         FullScreenMode fullscreen_mode;
         MaximizeMode max_mode;
diff --git a/geometry.cpp b/geometry.cpp
index c4cc4f2..d502299 100644
--- a/geometry.cpp
+++ b/geometry.cpp
@@ -1722,7 +1722,6 @@ void Client::configureRequest( int value_mask, int rx, int ry, \
int rw, int rh, i  move( new_pos );
             plainResize( ns );
             setGeometry( QRect( calculateGravitation( false, gravity ), size()));
-            updateFullScreenHack( QRect( new_pos, QSize( nw, nh )));
             QRect area = workspace()->clientArea( WorkArea, this );
             if( !from_tool && ( !isSpecialWindow() || isToolbar()) && \
!isFullScreen()  && area.contains( orig_geometry ))
@@ -1756,7 +1755,6 @@ void Client::configureRequest( int value_mask, int rx, int ry, \
int rw, int rh, i  xSizeHint.win_gravity = gravity;
             resizeWithChecks( ns );
             xSizeHint.win_gravity = save_gravity;
-            updateFullScreenHack( QRect( calculateGravitation( true, \
                xSizeHint.win_gravity ), QSize( nw, nh )));
             if( !from_tool && ( !isSpecialWindow() || isToolbar()) && \
!isFullScreen())  {
                 // try to keep the window in its xinerama screen if possible,
@@ -2442,8 +2440,6 @@ bool Client::isFullScreenable( bool fullscreen_hack ) const
 
 bool Client::userCanSetFullScreen() const
     {
-    if( fullscreen_mode == FullScreenHack )
-        return false;
     if( !isFullScreenable( false ))
         return false;
     // isMaximizable() returns false if fullscreen
@@ -2455,8 +2451,6 @@ void Client::setFullScreen( bool set, bool user )
     {
     if( !isFullScreen() && !set )
         return;
-    if( fullscreen_mode == FullScreenHack )
-        return;
     if( user && !userCanSetFullScreen())
         return;
     set = rules()->checkFullScreen( set );
@@ -2535,48 +2529,6 @@ QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors \
requestedTopology) co  return total;
     }
 
-
-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
-    if( noBorder() && app_noborder && 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 )
-    {
-    int type = checkFullScreenHack( geom );
-    if( fullscreen_mode == FullScreenNone && type != 0 )
-        {
-        fullscreen_mode = FullScreenHack;
-        updateDecoration( false, false );
-        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 && type == 0 )
-        {
-        fullscreen_mode = FullScreenNone;
-        updateDecoration( false, false );
-        // whoever called this must setup correct geometry
-        }
-    StackingUpdatesBlocker blocker( workspace());
-    workspace()->updateClientLayer( this ); // active fullscreens get different \
                layer
-    }
-
 static QRect*       visible_bound  = 0;
 static GeometryTip* geometryTip    = 0;
 
diff --git a/manage.cpp b/manage.cpp
index 7a8f661..850b6a5 100644
--- a/manage.cpp
+++ b/manage.cpp
@@ -215,20 +215,6 @@ bool Client::manage( Window w, bool isMapped )
     else
         area = workspace()->clientArea( PlacementArea, cursorPos(), desktop() );
 
-    if( int type = checkFullScreenHack( geom ))
-        {
-        fullscreen_mode = FullScreenHack;
-        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;
-        }
-
     if( isDesktop() )
         // KWin doesn't manage desktop windows
         placementDone = true;
@@ -377,8 +363,6 @@ bool Client::manage( Window w, bool isMapped )
             maximize( MaximizeMode( session->maximized ));
             geom_restore = session->restore;
             }
-        if( session->fullscreen == FullScreenHack )
-            ; // Nothing, this should be already set again above
         else if( session->fullscreen != FullScreenNone )
             {
             setFullScreen( true, false );
@@ -436,7 +420,7 @@ bool Client::manage( Window w, bool isMapped )
             demandAttention();
         if( info->state() & NET::Modal )
             setModal( true );
-        if( fullscreen_mode != FullScreenHack && isFullScreenable() )
+        if( isFullScreenable() )
             setFullScreen( rules()->checkFullScreen( info->state() & \
NET::FullScreen, !isMapped ), false );  }
 


["signature.asc" (application/pgp-signature)]

_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic