aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-05 16:53:18 -0500
committerKen Moore <ken@ixsystems.com>2017-01-05 16:53:18 -0500
commit837a2c7e9618fe31bde83f18e662ba257a40b702 (patch)
tree8c922e633f12477063a260e73f87c47c2e131af3
parentFix up the appearance of the Git menu when opening new tabs. (diff)
downloadlumina-837a2c7e9618fe31bde83f18e662ba257a40b702.tar.gz
lumina-837a2c7e9618fe31bde83f18e662ba257a40b702.tar.bz2
lumina-837a2c7e9618fe31bde83f18e662ba257a40b702.zip
Get some more stuff merged over. Starting to glue the various global structures together.
-rw-r--r--src-qt5/core/lumina-desktop-unified/LSession.cpp16
-rw-r--r--src-qt5/core/lumina-desktop-unified/global-objects.h29
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-WM/LXcbEventFilter.cpp24
3 files changed, 48 insertions, 21 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp
index 482b33ea..a8839cee 100644
--- a/src-qt5/core/lumina-desktop-unified/LSession.cpp
+++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp
@@ -17,6 +17,11 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
//Initialize the global objects to null pointers
mediaObj = 0; //private object used for playing login/logout chimes
Lumina::SYSTEM = 0;
+ Lumina::EFILTER = 0;
+ Lumina::SS = 0;
+ Lumina::WM = 0;
+ Lumina::EVThread = 0;
+
if(this->isPrimaryProcess()){
//Setup the global registrations
this->setApplicationName("Lumina Desktop Environment");
@@ -30,11 +35,16 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu
//this->setAttribute(Qt::AA_UseDesktopOpenGL);
//this->setAttribute(Qt::AA_UseHighDpiPixmaps); //allow pixmaps to be scaled up as well as down
- //Now initialize the global objects which need instant usage/access
+ //Now initialize the global objects (but do not start them yet)
Lumina::SYSTEM = new LXCB(); //need access to XCB data/functions right away
+ Lumina::EFILTER = new EventFilter(); //Need the XCB Event filter
+ Lumina::SS = new LScreenSaver();
+ Lumina::WM = new LWindowManager();
+ //Now put the Event Filter into it's own thread to keep things snappy
+ Lumina::EVThread = new QThread();
+ Lumina::EFILTER->moveToThread(Lumina::EVThread);
+
- //Setup the event filter for Qt5
- //this->installNativeEventFilter( new XCBEventFilter(this) );
} //end check for primary process
}
diff --git a/src-qt5/core/lumina-desktop-unified/global-objects.h b/src-qt5/core/lumina-desktop-unified/global-objects.h
index d712c32b..84133563 100644
--- a/src-qt5/core/lumina-desktop-unified/global-objects.h
+++ b/src-qt5/core/lumina-desktop-unified/global-objects.h
@@ -1,15 +1,29 @@
//===========================================
// Lumina-desktop source code
-// Copyright (c) 2015-2016, Ken Moore
+// Copyright (c) 2015-2017, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
-// Global defines and enumerations for external includes
+// Global defines and enumerations for internal includes
//===========================================
+
+//====WARNING=====
+// ONLY #include this file within *.cpp files
+// Use "global-includes.h" for the generic includes in *.h files
+//=================
+
#ifndef _LUMINA_INTERNAL_GLOBAL_OBJECTS_H
#define _LUMINA_INTERNAL_GLOBAL_OBJECTS_H
-#include "Global-includes.h"
+#include "global-includes.h"
+
+//Load the appropriate "EventFilter" class for the graphics subsystem
+#ifndef USE_WAYLAND
+#include "src-WM/LXcbEventFilter.h"
+#endif
+
+#include "src-WM/LScreenSaver.h"
+#include "src-WM/LWindowManager.h"
//Any special defines for settings/testing
#define ANIMTIME 80 //animation time in milliseconds
@@ -20,7 +34,14 @@ namespace Lumina{
enum WindowAction{MoveResize, Show, Hide, TryClose, Closed, WA_NONE};
//Data structures and objects
- extern LXCB *SYSTEM;
+ extern LXCB *SYSTEM; //Native graphic system interface
+ EventFilter *EFILTER; //Native Event Watcher
+ //ScreenSaver
+ LScreenSaver *SS;
+ //Window Manager
+ LWindowManager *WM;
+
+ QThread *EVThread; //X Event thread
};
diff --git a/src-qt5/core/lumina-desktop-unified/src-WM/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop-unified/src-WM/LXcbEventFilter.cpp
index abbe5a5a..0a7ca536 100644
--- a/src-qt5/core/lumina-desktop-unified/src-WM/LXcbEventFilter.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-WM/LXcbEventFilter.cpp
@@ -1,6 +1,6 @@
//===========================================
-// Lumina-DE source code
-// Copyright (c) 2015, Ken Moore
+// Lumina-desktop source code
+// Copyright (c) 2015-2017, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -8,15 +8,11 @@
//==================================================
// NOTE: All the XCB interactions and atoms are accessed via:
-// LWM::SYSTEM->EWMH.(atom name)
-// LWM::SYSTEM->(do something)
-// (LWM::SYSTEM is the global XCB structure)
+// Lumina::SYSTEM->EWMH.(atom name)
+// Lumina::SYSTEM->(do something)
+// (Lumina::SYSTEM is the global XCB structure)
//==================================================
-
-#include <LuminaX11.h>
-#include <QDebug>
-
-//#include <xcb/screensaver.h>
+#include "global-objects.h"
#define DEBUG 1
// Also keep the root window/screen around for use in the filters
@@ -38,14 +34,14 @@ void EventFilter::start(){
if(DEBUG){ qDebug() << " - Install event filter..."; }
QCoreApplication::instance()->installNativeEventFilter(EF);
if(DEBUG){ qDebug() << " - Run request check..."; }
- if(!LWM::SYSTEM->setupEventsForRoot()){
+ if(!Lumina::SYSTEM->setupEventsForRoot()){
qCritical() << "[ERROR] Unable to setup WM event retrieval. Is another WM running?";
exit(1);
}
if(DEBUG){ qDebug() << " - Create WM ID Window"; }
- WMFlag = LWM::SYSTEM->WM_CreateWindow();
- LWM::SYSTEM->setupEventsForRoot(WMFlag);
- LWM::SYSTEM->WM_Set_Supporting_WM(WMFlag);
+ WMFlag = Lumina::SYSTEM->WM_CreateWindow();
+ Lumina::SYSTEM->setupEventsForRoot(WMFlag);
+ Lumina::SYSTEM->WM_Set_Supporting_WM(WMFlag);
QCoreApplication::instance()->flush();
}
bgstack15