summaryrefslogtreecommitdiffstats
path: root/kwin/geometry.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
commit10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch)
tree88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kwin/geometry.cpp
parent4aed2c8219774f5d797760606b8489a92ddc5163 (diff)
downloadtdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz
tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/geometry.cpp')
-rw-r--r--kwin/geometry.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp
index 7c64eadcf..cff5a3a19 100644
--- a/kwin/geometry.cpp
+++ b/kwin/geometry.cpp
@@ -43,13 +43,30 @@ namespace KWinInternal
*/
void Workspace::desktopResized()
{
- QRect geom = QApplication::desktop()->geometry();
+ printf("Workspace::desktopResized()\n\r");
+ QRect geom = KApplication::desktop()->geometry();
NETSize desktop_geometry;
desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height();
rootInfo->setDesktopGeometry( -1, desktop_geometry );
- updateClientArea();
+ updateClientArea( true );
+ checkElectricBorders( true );
+ }
+
+/*!
+ Resizes the workspace after kdesktop signals a desktop resize
+ */
+void Workspace::kDestopResized()
+ {
+ printf("Workspace::kDesktopResized()\n\r");
+ QRect geom = KApplication::desktop()->geometry();
+ NETSize desktop_geometry;
+ desktop_geometry.width = geom.width();
+ desktop_geometry.height = geom.height();
+ rootInfo->setDesktopGeometry( -1, desktop_geometry );
+
+ updateClientArea( true );
checkElectricBorders( true );
}
@@ -211,14 +228,11 @@ void Workspace::updateClientArea()
\sa geometry()
*/
-QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
+QRect Workspace::clientArea( clientAreaOption opt, int screen, int desktop ) const
{
if( desktop == NETWinInfo::OnAllDesktops || desktop == 0 )
desktop = currentDesktop();
QDesktopWidget *desktopwidget = KApplication::desktop();
- int screen = desktopwidget->isVirtualDesktop() ? desktopwidget->screenNumber( p ) : desktopwidget->primaryScreen();
- if( screen < 0 )
- screen = desktopwidget->primaryScreen();
QRect sarea = screenarea // may be NULL during KWin initialization
? screenarea[ desktop ][ screen ]
: desktopwidget->screenGeometry( screen );
@@ -263,11 +277,21 @@ QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop
return QRect();
}
+QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
+ {
+ QDesktopWidget *desktopwidget = KApplication::desktop();
+ int screen = desktopwidget->screenNumber( p );
+ if( screen < 0 )
+ screen = desktopwidget->primaryScreen();
+ return clientArea( opt, screen, desktop );
+ }
+
QRect Workspace::clientArea( clientAreaOption opt, const Client* c ) const
{
return clientArea( opt, c->geometry().center(), c->desktop());
}
+
/*!
Client \a c is moved around to position \a pos. This gives the
workspace the opportunity to interveniate and to implement
@@ -896,10 +920,6 @@ void Client::checkWorkspacePosition()
setGeometry( area );
return;
}
- if( maximizeMode() != MaximizeRestore )
- // TODO update geom_restore?
- changeMaximize( false, false, true ); // adjust size
-
if( isFullScreen())
{
QRect area = workspace()->clientArea( FullScreenArea, this );
@@ -926,6 +946,10 @@ void Client::checkWorkspacePosition()
return;
}
+ if( maximizeMode() != MaximizeRestore )
+ // TODO update geom_restore?
+ changeMaximize( false, false, true ); // adjust size
+
if( !isShade()) // TODO
{
int old_diff_x = workarea_diff_x;
@@ -1722,6 +1746,7 @@ void Client::setGeometry( int x, int y, int w, int h, ForceGeometry_t force )
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}
void Client::plainResize( int w, int h, ForceGeometry_t force )
@@ -1775,6 +1800,7 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}
/*!
@@ -1795,6 +1821,7 @@ void Client::move( int x, int y, ForceGeometry_t force )
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}