aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/RootWindow-mgmt.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-08-17 16:11:36 +0000
committerWeblate <noreply@weblate.org>2017-08-17 16:11:36 +0000
commit35915a6a5a72ea5c45af7a787dcad69fee31218b (patch)
tree250dc618a5f8e12f041a1a2166269e3c8c3c4bfa /src-qt5/core/libLumina/RootWindow-mgmt.cpp
parentTranslated using Weblate (French) (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-35915a6a5a72ea5c45af7a787dcad69fee31218b.tar.gz
lumina-35915a6a5a72ea5c45af7a787dcad69fee31218b.tar.bz2
lumina-35915a6a5a72ea5c45af7a787dcad69fee31218b.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core/libLumina/RootWindow-mgmt.cpp')
-rw-r--r--src-qt5/core/libLumina/RootWindow-mgmt.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/RootWindow-mgmt.cpp b/src-qt5/core/libLumina/RootWindow-mgmt.cpp
index e00ce9ce..00b3e336 100644
--- a/src-qt5/core/libLumina/RootWindow-mgmt.cpp
+++ b/src-qt5/core/libLumina/RootWindow-mgmt.cpp
@@ -19,16 +19,31 @@ void RootWindow::arrangeWindows(RootSubWindow *primary, QString type){
// ================
// Public slots for starting the arrangement routine(s) above
// ================
-void RootWindow::ArrangeWindows(WId *primary, QString type){
-
+void RootWindow::ArrangeWindows(WId primary, QString type){
+ RootSubWindow* win = windowForId(primary);
+ if(type.isEmpty()){ type = ""; } //grab the default arrangement format
+ arrangeWindows(win, type);
}
-void RootWindow::TileWindows(WId *primary, QString type){
-
+void RootWindow::TileWindows(WId primary, QString type){
+ RootSubWindow* win = windowForId(primary);
+ if(type.isEmpty()){ type = ""; } //grab the default arrangement format for tiling
+ arrangeWindows(win, type);
}
-void RootWindow::CheckWindowPosition(WId, bool newwindow){
+void RootWindow::CheckWindowPosition(WId id, bool newwindow){
//used after a "drop" to validate/snap/re-arrange window(s) as needed
// if "newwindow" is true, then this is the first-placement routine for a window before it initially appears
-
+ RootSubWindow* win = windowForId(id);
+ if(win==0){ return; } //invalid window
+ QRect geom = win->nativeWindow()->geometry();
+ bool changed = false;
+ //Make sure it is on the screen (quick check)
+ if(geom.x() < 0){ changed = true; geom.moveLeft(0); }
+ if(geom.y() < 0){ changed = true; geom.moveTop(0); }
+ if(geom.width() < 20){ changed = true; geom.setWidth(100); }
+ if(geom.height() < 20){ changed = true; geom.setHeight(100); }
+ if(changed){ win->setGeometry(geom); }
+ //Now run it through the window arrangement routine
+ ArrangeWindows(id);
}
bgstack15