summaryrefslogtreecommitdiffstats
path: root/twin
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-12-26 13:35:30 -0600
committerDarrell Anderson <humanreadable@yahoo.com>2012-12-26 13:35:30 -0600
commit4d3d2420430fb53000ceda25ae7498e49f6e94b2 (patch)
treef350afc9cba3f615fa3c982b73e57b2272fa8a47 /twin
parentf5c55ca4ce9587598ce81399c2196c876ec55942 (diff)
parent0ef12d60c85f58af9052d83ce1945d71afe16cb4 (diff)
downloadtdebase-4d3d2420430fb53000ceda25ae7498e49f6e94b2.tar.gz
tdebase-4d3d2420430fb53000ceda25ae7498e49f6e94b2.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'twin')
-rw-r--r--twin/KWinInterface.h1
-rw-r--r--twin/client.cpp8
-rw-r--r--twin/workspace.cpp31
-rw-r--r--twin/workspace.h7
4 files changed, 43 insertions, 4 deletions
diff --git a/twin/KWinInterface.h b/twin/KWinInterface.h
index 445e42fe9..dbc132888 100644
--- a/twin/KWinInterface.h
+++ b/twin/KWinInterface.h
@@ -15,6 +15,7 @@ class KWinInterface : virtual public DCOPObject
virtual ASYNC killWindowId(unsigned long winId) = 0;
virtual ASYNC suspendWindowId(unsigned long winId) = 0;
virtual ASYNC resumeWindowId(unsigned long winId) = 0;
+ virtual bool isResumeableWindowID(unsigned long winId) = 0;
virtual void refresh() = 0;
virtual void doNotManage(TQString)= 0;
virtual void showWindowMenuAt(unsigned long winId, int x, int y)= 0;
diff --git a/twin/client.cpp b/twin/client.cpp
index 35b588db5..f421560a4 100644
--- a/twin/client.cpp
+++ b/twin/client.cpp
@@ -664,6 +664,9 @@ void Client::minimize( bool avoid_animation )
if ( !isMinimizable() || isMinimized())
return;
+ if (isShade()) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
+ info->setState(0, NET::Shaded);
+
Notify::raise( Notify::Minimize );
// SELI mainClients().isEmpty() ??? - and in unminimize() too
@@ -687,6 +690,9 @@ void Client::unminimize( bool avoid_animation )
if( !isMinimized())
return;
+ if (isShade()) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
+ info->setState(NET::Shaded, NET::Shaded);
+
Notify::raise( Notify::UnMinimize );
minimized = false;
if( isOnCurrentDesktop() && isShown( true ))
@@ -947,7 +953,7 @@ void Client::setShade( ShadeMode mode )
workspace()->requestFocus( this );
}
checkMaximizeGeometry();
- info->setState( isShade() ? NET::Shaded : 0, NET::Shaded );
+ info->setState( (isShade() && !isMinimized()) ? NET::Shaded : 0, NET::Shaded );
info->setState( isShown( false ) ? 0 : NET::Hidden, NET::Hidden );
updateVisibility();
updateAllowedActions();
diff --git a/twin/workspace.cpp b/twin/workspace.cpp
index 643395e88..cc109918c 100644
--- a/twin/workspace.cpp
+++ b/twin/workspace.cpp
@@ -1974,6 +1974,37 @@ void Workspace::resumeWindowId( Window window_to_resume )
}
+bool Workspace::isResumeableWindowID( Window window_to_check )
+ {
+ if( window_to_check == None )
+ return false;
+ Window window = window_to_check;
+ Client* client = NULL;
+ for(;;)
+ {
+ client = findClient( FrameIdMatchPredicate( window ));
+ if( client != NULL ) // found the client
+ break;
+ Window parent = NULL;
+ Window root = NULL;
+ Window* children = NULL;
+ unsigned int children_count;
+ XQueryTree( tqt_xdisplay(), window, &root, &parent, &children, &children_count );
+ if( children != NULL )
+ XFree( children );
+ if( window == root ) // we didn't find the client, probably an override-redirect window
+ break;
+ window = parent; // go up
+ if( window == NULL )
+ break;
+ }
+ if( client != NULL )
+ return client->isResumeable();
+ else
+ return false;
+ }
+
+
void Workspace::sendPingToWindow( Window window, Time timestamp )
{
rootInfo->sendPing( window, timestamp );
diff --git a/twin/workspace.h b/twin/workspace.h
index f1f7dc97e..0f019cbbf 100644
--- a/twin/workspace.h
+++ b/twin/workspace.h
@@ -96,9 +96,10 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
/**
* @internal
*/
- void killWindowId( Window window);
- void suspendWindowId( Window window);
- void resumeWindowId( Window window);
+ void killWindowId( Window window );
+ void suspendWindowId( Window window );
+ void resumeWindowId( Window window );
+ bool isResumeableWindowID( Window window );
void killWindow() { slotKillWindow(); }
void suspendWindow() { slotSuspendWindow(); }