diff options
author | Ken Moore <ken@ixsystems.com> | 2017-10-18 11:58:59 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-10-18 11:58:59 -0400 |
commit | 7a3e9e46423d999d47e19b26e910c849028599de (patch) | |
tree | 699d7df6a17e797ba1c87566c2b9bdd241a52722 /src-qt5/core/lumina-desktop-unified | |
parent | Updated how video thumbnails are loaded. Now cached to stop crash when (diff) | |
download | lumina-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')
3 files changed, 24 insertions, 11 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp index cc754005..426b91b4 100644 --- a/src-qt5/core/lumina-desktop-unified/LSession.cpp +++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp @@ -104,7 +104,7 @@ void LSession::setupSession(){ splash.showScreen("user"); if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();} //checkUserFiles(); //adds these files to the watcher as well - + Lumina::ROOTWIN->start(); //Initialize the internal variables //DESKTOPS.clear(); @@ -116,7 +116,6 @@ void LSession::setupSession(){ if(DEBUG){ qDebug() << " - Populate App List:" << timer->elapsed();} Lumina::APPLIST->updateList(); //appmenu = new AppMenu(); - splash.showScreen("menus"); //if(DEBUG){ qDebug() << " - Init SettingsMenu:" << timer->elapsed();} //settingsmenu = new SettingsMenu(); @@ -129,12 +128,13 @@ void LSession::setupSession(){ QList<QScreen*> scrns= QApplication::screens(); for(int i=0; i<scrns.length(); i++){ qDebug() << " --- Load Wallpaper for Screen:" << scrns[i]->name(); - RootDesktopObject::instance()->ChangeWallpaper(scrns[i]->name(), LOS::LuminaShare()+"desktop-background.jpg"); + RootDesktopObject::instance()->ChangeWallpaper(scrns[i]->name(),QUrl::fromLocalFile(LOS::LuminaShare()+"desktop-background.jpg").toString() ); } - //Lumina::ROOTWIN->start(); Lumina::NWS->setRoot_numberOfWorkspaces(QStringList() << "one" << "two"); Lumina::NWS->setRoot_currentWorkspace(0); + if(DEBUG){ qDebug() << " - Create Desktop Context Menu"; } + /*DesktopContextMenu *cmenu = new DesktopContextMenu(Lumina::ROOTWIN); connect(cmenu, SIGNAL(showLeaveDialog()), this, SLOT(StartLogout()) ); cmenu->start();*/ @@ -228,8 +228,8 @@ void LSession::setupGlobalConnections(){ //Root window connections connect(Lumina::ROOTWIN, SIGNAL(RegisterVirtualRoot(WId)), Lumina::NWS, SLOT(RegisterVirtualRoot(WId)) ); connect(Lumina::ROOTWIN, SIGNAL(RootResized(QRect)), Lumina::NWS, SLOT(setRoot_desktopGeometry(QRect)) ); - connect(Lumina::ROOTWIN, SIGNAL(MouseMoved()), Lumina::SS, SLOT(newInputEvent()) ); - connect(Lumina::ROOTWIN, SIGNAL(startLogout()), this, SLOT(StartLogout()) ); + connect(RootDesktopObject::instance(), SIGNAL(mouseMoved()), Lumina::SS, SLOT(newInputEvent()) ); + connect(RootDesktopObject::instance(), SIGNAL(startLogout()), this, SLOT(StartLogout()) ); //Native Window Class connections connect(Lumina::NEF, SIGNAL(WindowCreated(WId)), Lumina::NWS, SLOT(NewWindowDetected(WId))); 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(); } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.h b/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.h index 1050ba21..ba489465 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/RootWindow.h @@ -19,6 +19,8 @@ public: RootWindow(); ~RootWindow(); + void start(); + public slots: void syncRootSize(); |