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

List:       kde-commits
Subject:    branches/work/kwin-tabbing
From:       Jorge Emilio Mata <matamax123 () gmail ! com>
Date:       2009-06-29 13:54:33
Message-ID: 1246283673.266437.15424.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 989117 by mata:

- Function added in ClientGroup to ungroup.
- Function added in Workspace that returns true if the decoration
  supports tabs.
- Workspace ungroups tabs if the decoration doesnt supports tabs.
- ClientGroup doesnt group tabs if the decoration doesnt support it.



 M  +13 -1     clientgroup.cpp  
 M  +2 -0      clientgroup.h  
 M  +1 -1      clients/tabtest/tabtestbutton.cpp  
 M  +2 -2      lib/kdecoration.h  
 M  +8 -0      workspace.cpp  
 M  +6 -0      workspace.h  


--- branches/work/kwin-tabbing/clientgroup.cpp #989116:989117
@@ -101,7 +101,7 @@
 //    - Copy the list to all the clients in this group
 void ClientGroup::merge( Client *c )
     {
-    if( c->clientGroupId() == group_id )
+    if( c->clientGroupId() == group_id || !work->decorationSupportsTabs() )
         return;
     if( groupSize() < 2 )
         updateSettings();
@@ -242,6 +242,18 @@
     cl->triggerDecorationRepaint();
     }
 
+// Ungroup
+void ClientGroup::ungroup()
+    {
+    if( members.count() < 2 )
+        return;
+    ClientList list( members );
+    ClientList::const_iterator i;
+    for( i = list.begin(); i != list.end(); i++ )
+        (*i)->clientGroup()->remove();
+    }
+
+// Close all the clients in the group
 void ClientGroup::closeGroup()
     {
     Client *front;
--- branches/work/kwin-tabbing/clientgroup.h #989116:989117
@@ -52,6 +52,8 @@
         void remove();
         /// Merge the group with c group.
         void merge( Client *c );
+        /// Remove all the clients from the group.
+        void ungroup();
         /// Deletes the element at index id from members.
         void removeAt( int id );
         /// Shows or hides the client.
--- branches/work/kwin-tabbing/clients/tabtest/tabtestbutton.cpp #989116:989117
@@ -30,7 +30,7 @@
 #include <QPixmap>
 #include <QRect>
 
-tabtestButton::tabtestButton( ButtonType type, tabtestDecoration *parent, QString \
tip )  +tabtestButton::tabtestButton( ButtonType type, tabtestDecoration *parent, \
QString tip )  : KCommonDecorationButton( type, parent )
     {
     setAutoFillBackground( false );
--- branches/work/kwin-tabbing/lib/kdecoration.h #989116:989117
@@ -195,8 +195,8 @@
                                         ///  The mask is still used to define the \
                input region and the blurred
                                         ///  region, when the blur plugin is \
enabled.  ///  @since 4.3
-        // tabbing
-        AbilityTabGrouping = 4000, ///< decoration supports tabbing
+        // Tabbing
+        AbilityTabGrouping = 4000, ///< The decoration supports tabbing
         // TODO colors for individual button types
         ABILITY_DUMMY = 10000000
         };
--- branches/work/kwin-tabbing/workspace.cpp #989116:989117
@@ -1058,6 +1058,14 @@
             it != clients.constEnd();
             ++it )
             (*it)->updateDecoration( true, true );
+        // If the decoration dont supports tabs ungroup clients
+        if( !decorationSupportsTabs() )
+            {
+            ClientList::const_iterator i;
+            for( i = tabGroupList.begin(); i != tabGroupList.end(); i++ )
+                if( (*i)->clientGroup()->isShown() )
+                    (*i)->clientGroup()->ungroup();
+            }
         mgr->destroyPreviousPlugin();
         }
     else
--- branches/work/kwin-tabbing/workspace.h #989116:989117
@@ -369,6 +369,7 @@
 
         bool hasDecorationShadows() const;
         bool decorationHasAlpha() const;
+        bool decorationSupportsTabs() const;
 
         // D-Bus interface
         void cascadeDesktop();
@@ -1210,6 +1211,11 @@
     return mgr->factory()->supports( AbilityUsesAlphaChannel );
     }
 
+inline bool Workspace::decorationSupportsTabs() const
+    {
+    return mgr->factory()->supports( AbilityTabGrouping );
+    }
+
 } // namespace
 
 #endif


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

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