aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-10-18 11:58:59 -0400
committerKen Moore <ken@ixsystems.com>2017-10-18 11:58:59 -0400
commit7a3e9e46423d999d47e19b26e910c849028599de (patch)
tree699d7df6a17e797ba1c87566c2b9bdd241a52722 /src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp
parentUpdated how video thumbnails are loaded. Now cached to stop crash when (diff)
downloadlumina-7a3e9e46423d999d47e19b26e910c849028599de.tar.gz
lumina-7a3e9e46423d999d47e19b26e910c849028599de.tar.bz2
lumina-7a3e9e46423d999d47e19b26e910c849028599de.zip
Another quick checkpoint for Lumina 2 files. Nothing too spectacular yet - still in the experimental stage for the QML usage.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp
index c0710bbc..2aac6f3e 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.cpp
@@ -6,7 +6,7 @@
//===========================================
#include "RootWindow.h"
-RootWindow::RootWindow(){
+RootWindow::RootWindow() : QObject(){
root_win = QWindow::fromWinId( QX11Info::appRootWindow() ); //
root_view = new QQuickView(root_win); //make it a child of the root window
root_obj = RootDesktopObject::instance();
@@ -16,8 +16,7 @@ RootWindow::RootWindow(){
//Now setup the QQuickView
root_view->setResizeMode(QQuickView::SizeRootObjectToView);
root_view->engine()->rootContext()->setContextProperty("RootObject", root_obj);
- root_view->setSource(QUrl("qrc:///qml/RootDesktop"));
- root_view->show();
+ RootDesktopObject::RegisterType(); //make sure object classes are registered with the QML subsystems
}
RootWindow::~RootWindow(){
@@ -25,9 +24,21 @@ RootWindow::~RootWindow(){
root_obj->deleteLater();
}
+void RootWindow::start(){
+ root_view->setSource(QUrl("qrc:///qml/RootDesktop"));
+ root_win->show();
+ root_view->show();
+}
+
void RootWindow::syncRootSize(){
- if(root_win->width() != root_view->width() || root_win->height() != root_view->height()){
- root_view->setGeometry(0, 0, root_win->width(), root_win->height() );
+ //qDebug() << "Sync Root Size:" << root_win->width() << root_win->height() << root_view->geometry();
+ QList<QScreen*> screens = QApplication::screens();
+ QRect unif;
+ for(int i=0; i<screens.length(); i++){ unif = unif.united(screens[i]->geometry()); }
+ if(unif.width() != root_view->width() || unif.height() != root_view->height()){
+ root_view->setGeometry(0, 0, unif.width(), unif.height() );
emit RootResized(root_view->geometry());
}
+ root_obj->updateScreens();
+ //qDebug() << " - after:" << root_view->geometry();
}
bgstack15