aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-31 14:12:29 -0500
committerKen Moore <ken@ixsystems.com>2017-01-31 14:12:29 -0500
commit223e28da7a0c67b5ad1e844dbbbd6f4bd7557977 (patch)
treeb2533ffd6cfbad97c09ba8a36c51a79902ef6a33 /src-qt5/core/lumina-desktop-unified
parentGet the next phase of Lumina2 working: The context menu for the desktop itself. (diff)
downloadlumina-223e28da7a0c67b5ad1e844dbbbd6f4bd7557977.tar.gz
lumina-223e28da7a0c67b5ad1e844dbbbd6f4bd7557977.tar.bz2
lumina-223e28da7a0c67b5ad1e844dbbbd6f4bd7557977.zip
Get a lot more of Lumina2 working. Now the window embed systems are functional, with 2-way create/show/hide/close detection. Windows do not detect/resize as needed yet though.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-rw-r--r--src-qt5/core/lumina-desktop-unified/LSession.cpp11
-rw-r--r--src-qt5/core/lumina-desktop-unified/global-includes.h1
-rw-r--r--src-qt5/core/lumina-desktop-unified/lumina-desktop.pro1
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp7
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h1
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp41
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h5
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp3
8 files changed, 53 insertions, 17 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp
index cb0144d5..706c6006 100644
--- a/src-qt5/core/lumina-desktop-unified/LSession.cpp
+++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp
@@ -41,7 +41,7 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
//this->setAttribute(Qt::AA_UseHighDpiPixmaps); //allow pixmaps to be scaled up as well as down
//Now initialize the global objects (but do not start them yet)
- Lumina::EFILTER = new EventFilter(); //Need the XCB Event filter
+ Lumina::EFILTER = new EventFilter(); //Need the XCB Event filter first
Lumina::SETTINGS = new DesktopSettings();
Lumina::SS = new LScreenSaver();
//Lumina::WM = new LWindowManager();
@@ -60,7 +60,10 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
//Setup the various connections between the global classes
// NOTE: Most of these connections will only become "active" as the global objects get started during the setupSession routine
connect(Lumina::ROOTWIN, SIGNAL(RegisterVirtualRoot(WId)), Lumina::EFILTER, SLOT(RegisterVirtualRoot(WId)) );
-
+ connect(Lumina::EFILTER, SIGNAL(WindowCreated(WId)), Lumina::ROOTWIN, SLOT(NewWindow(WId)) );
+ connect(Lumina::EFILTER, SIGNAL(WindowClosed(WId)), Lumina::ROOTWIN, SLOT(CloseWindow(WId)) );
+ connect(Lumina::EFILTER, SIGNAL(WindowHidden(WId)), Lumina::ROOTWIN, SLOT(HideWindow(WId)) );
+ connect(Lumina::EFILTER, SIGNAL(WindowShown(WId)), Lumina::ROOTWIN, SLOT(ShowWindow(WId)) );
} //end check for primary process
}
@@ -176,7 +179,7 @@ void LSession::setupSession(){
Lumina::SHORTCUTS->start(); //Startup the shortcut handler now
//for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen
//launchStartupApps();
- //QTimer::singleShot(500, this, SLOT(launchStartupApps()) );
+ QTimer::singleShot(500, this, SLOT(launchStartupApps()) );
splash.hide();
LSession::processEvents();
splash.close();
@@ -279,7 +282,7 @@ void LSession::launchStartupApps(){
LOS::setScreenBrightness( tmp );
qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%";
}
- QProcess::startDetached("nice lumina-open -autostart-apps");
+ //ExternalProcess::launch("nice lumina-open -autostart-apps");
//Re-load the screen brightness and volume settings from the previous session
// Wait until after the XDG-autostart functions, since the audio system might be started that way
diff --git a/src-qt5/core/lumina-desktop-unified/global-includes.h b/src-qt5/core/lumina-desktop-unified/global-includes.h
index 6a753cd1..ed687917 100644
--- a/src-qt5/core/lumina-desktop-unified/global-includes.h
+++ b/src-qt5/core/lumina-desktop-unified/global-includes.h
@@ -57,6 +57,7 @@
#include <LuminaSingleApplication.h>
#include <DesktopSettings.h>
#include <RootWindow.h>
+#include <ExternalProcess.h>
// Standard C includes
#include <unistd.h>
diff --git a/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro b/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
index 497ce635..1de8308d 100644
--- a/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
+++ b/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
@@ -17,6 +17,7 @@ include(../libLumina/LuminaSingleApplication.pri)
include(../libLumina/LuminaThemes.pri)
include(../libLumina/DesktopSettings.pri)
include(../libLumina/RootWindow.pri)
+include(../libLumina/ExternalProcess.pri)
#include all the main individual source groups
include(src-screensaver/screensaver.pri)
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
index fa4af5ba..e363af01 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
@@ -24,7 +24,7 @@ void DesktopContextMenu::UpdateMenu(){
for(int i=0; i<items.length(); i++){
if(items[i]=="terminal"){ this->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"))->setWhatsThis("lumina-open -terminal"); }
else if(items[i]=="lockdesktop"){ this->addAction(LXDG::findIcon("system-lock-screen",""), tr("Lock Session"), this, SIGNAL(LockSession()) ); }
- else if(items[i]=="filemanager"){ this->addAction( LXDG::findIcon("user-home",""), tr("Browse Files"))->setWhatsThis("lumina-open ~"); }
+ else if(items[i]=="filemanager"){ this->addAction( LXDG::findIcon("user-home",""), tr("Browse Files"))->setWhatsThis("lumina-open \""+QDir::homePath()+"\""); }
//else if(items[i]=="applications"){ this->addMenu( LSession::handle()->applicationMenu() ); }
else if(items[i]=="line"){ this->addSeparator(); }
//else if(items[i]=="settings"){ this->addMenu( LSession::handle()->settingsMenu() ); }
@@ -34,7 +34,7 @@ void DesktopContextMenu::UpdateMenu(){
QString file = items[i].section("::::",1,1).simplified();
XDGDesktop xdgf(file);// = LXDG::loadDesktopFile(file, ok);
if(xdgf.type!=XDGDesktop::BAD){
- this->addAction( LXDG::findIcon(xdgf.icon,""), xdgf.name)->setWhatsThis(file);
+ this->addAction( LXDG::findIcon(xdgf.icon,""), xdgf.name)->setWhatsThis("lumina-open \""+file+"\"");
}else{
qDebug() << "Could not load application file:" << file;
}
@@ -86,8 +86,9 @@ void DesktopContextMenu::start(){
// === PRIVATE SLOTS ===
void DesktopContextMenu::LaunchAction(QAction *act){
if(act->whatsThis().isEmpty() || act->parent()!=this ){ return; }
+ qDebug() << "Launch Menu Action:" << act->whatsThis();
QString cmd = act->whatsThis();
- emit LaunchApplication(cmd);
+ ExternalProcess::launch(cmd);
}
void DesktopContextMenu::showMenu(const QPoint &pt){
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h
index 1a4befc9..8b0509fb 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.h
@@ -30,7 +30,6 @@ private slots:
void showMenu(const QPoint&);
signals:
- void LaunchApplication(QString); //cmd to run
void LockSession();
void showLeaveDialog();
};
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp
index 4a192aa4..6660e41e 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.cpp
@@ -132,13 +132,13 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
//==============================
case XCB_KEY_PRESS:
//This is a keyboard key press
- qDebug() << "Key Press Event";
+ //qDebug() << "Key Press Event";
stopevent = BlockInputEvent( ((xcb_key_press_event_t *) ev)->root ); //use the main "root" window - not the child widget
if(!stopevent){ obj->emit KeyPressed( InputWindow(((xcb_key_press_event_t *) ev)->root), ((xcb_key_press_event_t *) ev)->detail ); }
break;
case XCB_KEY_RELEASE:
//This is a keyboard key release
- qDebug() << "Key Release Event";
+ //qDebug() << "Key Release Event";
stopevent = BlockInputEvent( ((xcb_key_release_event_t *) ev)->root ); //use the main "root" window - not the child widget
if(!stopevent){ obj->emit KeyReleased( InputWindow(((xcb_key_release_event_t *) ev)->root), ((xcb_key_release_event_t *) ev)->detail ); }
break;
@@ -183,24 +183,27 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
break;
//==============================
case XCB_MAP_NOTIFY:
+ qDebug() << "Window Map Event:" << ((xcb_map_notify_event_t *)ev)->window;
+ obj->emit WindowShown( ((xcb_map_notify_event_t *)ev)->window);
break; //This is just a notification that a window was mapped - nothing needs to change here
case XCB_MAP_REQUEST:
qDebug() << "Window Map Request Event";
- obj->emit ModifyWindow( ((xcb_map_request_event_t *) ev)->window, Lumina::Show);
+ SetupNewWindow( ((xcb_map_request_event_t *) ev) );
break;
//==============================
case XCB_CREATE_NOTIFY:
- qDebug() << "Window Create Event";
+ //qDebug() << "Window Create Event";
break;
//==============================
case XCB_UNMAP_NOTIFY:
- qDebug() << "Window Unmap Event";
- obj->emit ModifyWindow( ((xcb_unmap_notify_event_t *)ev)->window, Lumina::Hide);
+ qDebug() << "Window Unmap Event:" << ((xcb_unmap_notify_event_t *)ev)->window;
+ obj->emit WindowHidden( ((xcb_unmap_notify_event_t *)ev)->window);
break;
//==============================
case XCB_DESTROY_NOTIFY:
- qDebug() << "Window Closed Event";
+ qDebug() << "Window Closed Event:" << ((xcb_destroy_notify_event_t *)ev)->window;
if( !rmTrayApp( ((xcb_destroy_notify_event_t *) ev)->window ) ){
+ qDebug() <<" - Non-tray window";
obj->emit WindowClosed( ((xcb_destroy_notify_event_t *) ev)->window );
}
break;
@@ -389,3 +392,27 @@ void XCBEventFilter::checkDamageID(WId id){
//Could check for window damage ID's - but we should not need this
}
}
+
+// WINDOW HANDLING FUNCTIONS
+void XCBEventFilter::SetupNewWindow(xcb_map_request_event_t *ev){
+ WId win = ev->window;
+
+ bool ok = obj->XCB->WM_ManageWindow(win, true);
+ //Quick check if this is a transient window if we could not manage it directly
+ if(!ok){
+ WId tran = obj->XCB->WM_ICCCM_GetTransientFor(win);
+ if(tran!=win && tran!=0){
+ win = tran;
+ ok = obj->XCB->WM_ManageWindow(win);
+ }
+ }
+ qDebug() << "New Window:" << win << obj->XCB->WM_ICCCM_GetClass(win) << " Managed:" << ok;
+ obj->XCB->WM_Set_Active_Window(win);
+ //Determing the requested geometry/location/management within the event,
+ // and forward that on to the graphical embedding side of the WM
+
+
+ obj->emit WindowCreated(win);
+ //TEMPORARY FOR DEBUGGING
+ //obj->XCB->WM_ShowWindow(win);
+}
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h
index 9e76ba53..30dc925d 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h
+++ b/src-qt5/core/lumina-desktop-unified/src-events/LXcbEventFilter.h
@@ -69,7 +69,9 @@ public slots:
signals:
void NewInputEvent();
- void NewManagedWindow(WId);
+ void WindowCreated(WId);
+ void WindowShown(WId);
+ void WindowHidden(WId);
void WindowClosed(WId);
void ModifyWindow(WId win, Lumina::WindowAction);
@@ -120,6 +122,7 @@ private:
void checkDamageID(WId);
//Longer Event handling functions
+ void SetupNewWindow(xcb_map_request_event_t *ev);
//bool ParseKeyPressEvent();
//bool ParseKeyReleaseEvent();
//bool ParseButtonPressEvent();
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
index 83b82ff8..9ad31f5c 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
@@ -19,6 +19,7 @@ SSBaseWidget::SSBaseWidget(QWidget *parent, QSettings *set) : QWidget(parent){
this->setObjectName("LuminaBaseSSWidget");
ANIM = 0;
this->setMouseTracking(true);
+ plugType="none";
}
SSBaseWidget::~SSBaseWidget(){
@@ -51,7 +52,7 @@ void SSBaseWidget::startPainting(){
//Now list all the various plugins and start them appropriately
QString style;
if(cplug=="none"){
- style = "background: transparent;"; //show the underlying black parent widget
+ style = "background: black;"; //show the underlying black parent widget
}else{
style = "background: black;";
}
bgstack15