aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-27 13:18:55 -0400
committerKen Moore <ken@ixsystems.com>2017-06-27 13:18:55 -0400
commitcd5553238538bb4dc62aee43a5e1a0cd9c070e68 (patch)
tree14a24c455e82f457fdca39735d41bfced44fd593 /src-qt5
parentAdd a ton of the root-window registration routines to the NativeWindowSystem ... (diff)
downloadlumina-cd5553238538bb4dc62aee43a5e1a0cd9c070e68.tar.gz
lumina-cd5553238538bb4dc62aee43a5e1a0cd9c070e68.tar.bz2
lumina-cd5553238538bb4dc62aee43a5e1a0cd9c070e68.zip
Commit a bunch more root-level session changes - should be almost ready to start testing and see if windows respond to the EWMH hints.
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/libLumina/LuminaX11.cpp7
-rw-r--r--src-qt5/core/libLumina/NativeEventFilter.cpp26
-rw-r--r--src-qt5/core/libLumina/RootWindow.cpp2
-rw-r--r--src-qt5/core/libLumina/RootWindow.h2
-rw-r--r--src-qt5/core/lumina-desktop-unified/LSession.cpp3
-rw-r--r--src-qt5/core/lumina-desktop-unified/lumina-desktop.pro2
6 files changed, 25 insertions, 17 deletions
diff --git a/src-qt5/core/libLumina/LuminaX11.cpp b/src-qt5/core/libLumina/LuminaX11.cpp
index 3bd248b6..b5dd62cd 100644
--- a/src-qt5/core/libLumina/LuminaX11.cpp
+++ b/src-qt5/core/libLumina/LuminaX11.cpp
@@ -75,9 +75,6 @@ void LXCB::createWMAtoms(){
i--;
}
}
-
-
-
}
// === WindowList() ===
@@ -91,13 +88,13 @@ QList<WId> LXCB::WindowList(bool rawlist){
if( 1 == xcb_ewmh_get_client_list_reply( &EWMH, cookie, &winlist, NULL) ){
//qDebug() << " - Loop over items";
unsigned int wkspace = CurrentWorkspace();
- for(unsigned int i=0; i<winlist.windows_len; i++){
+ for(unsigned int i=0; i<winlist.windows_len; i++){
//Filter out the Lumina Desktop windows
if(WindowClass(winlist.windows[i]) == "Lumina Desktop Environment"){ continue; }
//Also filter out windows not on the active workspace
else if( (WindowWorkspace(winlist.windows[i])!=wkspace) && !rawlist ){ continue; }
else{
- output << winlist.windows[i];
+ output << winlist.windows[i];
}
}
}
diff --git a/src-qt5/core/libLumina/NativeEventFilter.cpp b/src-qt5/core/libLumina/NativeEventFilter.cpp
index 4914cea3..c289c450 100644
--- a/src-qt5/core/libLumina/NativeEventFilter.cpp
+++ b/src-qt5/core/libLumina/NativeEventFilter.cpp
@@ -51,26 +51,29 @@ XCB_CLIENT_MESSAGE
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
#define SYSTEM_TRAY_CANCEL_MESSAGE 2
-#include <LuminaX11.h>
+//#include <LuminaX11.h>
+#include <QX11Info>
+#include <xcb/xcb_ewmh.h>
#include <xcb/xcb_keysyms.h>
#include <xcb/damage.h>
#define DEBUG 0
//Special objects/variables for XCB parsing
-static LXCB *XCB = 0;
+static xcb_ewmh_connection_t EWMH;
+//static LXCB *XCB = 0;
static xcb_atom_t _NET_SYSTEM_TRAY_OPCODE = 0;
inline void ParsePropertyEvent(xcb_property_notify_event_t *ev, NativeEventFilter *obj){
//qDebug() << "Got Property Event:" << ev->window << ev->atom;
NativeWindow::Property prop = NativeWindow::None;
//Now determine which properties are getting changed, and update the native window as appropriate
- if(ev->atom == XCB->EWMH._NET_WM_NAME){ prop = NativeWindow::Title; }
- else if(ev->atom == XCB->EWMH._NET_WM_ICON){ prop = NativeWindow::Icon; }
- else if(ev->atom == XCB->EWMH._NET_WM_ICON_NAME){ prop = NativeWindow::ShortTitle; }
- else if(ev->atom == XCB->EWMH._NET_WM_DESKTOP){ prop = NativeWindow::Workspace; }
- else if(ev->atom == XCB->EWMH._NET_WM_WINDOW_TYPE ){ prop = NativeWindow::WinTypes; }
- else if( ev->atom == XCB->EWMH._NET_WM_STATE){ prop = NativeWindow::States; }
+ if(ev->atom == EWMH._NET_WM_NAME){ prop = NativeWindow::Title; }
+ else if(ev->atom == EWMH._NET_WM_ICON){ prop = NativeWindow::Icon; }
+ else if(ev->atom == EWMH._NET_WM_ICON_NAME){ prop = NativeWindow::ShortTitle; }
+ else if(ev->atom == EWMH._NET_WM_DESKTOP){ prop = NativeWindow::Workspace; }
+ else if(ev->atom == EWMH._NET_WM_WINDOW_TYPE ){ prop = NativeWindow::WinTypes; }
+ else if( ev->atom == EWMH._NET_WM_STATE){ prop = NativeWindow::States; }
//Send out the signal if necessary
if(prop!=NativeWindow::None){
obj->emit WindowPropertyChanged(ev->window, prop);
@@ -81,6 +84,12 @@ inline void ParsePropertyEvent(xcb_property_notify_event_t *ev, NativeEventFilte
//Constructor for the Event Filter wrapper
NativeEventFilter::NativeEventFilter() : QObject(){
EF = new EventFilter(this);
+ if(EWMH.nb_screens <=0){
+ xcb_intern_atom_cookie_t *cookie = xcb_ewmh_init_atoms(QX11Info::connection(), &EWMH);
+ if(!xcb_ewmh_init_atoms_replies(&EWMH, cookie, NULL) ){
+ qDebug() << "Error with XCB atom initializations";
+ }
+ }
if(_NET_SYSTEM_TRAY_OPCODE==0){
//_NET_SYSTEM_TRAY_OPCODE
xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), 0, 23,"_NET_SYSTEM_TRAY_OPCODE");
@@ -90,7 +99,6 @@ NativeEventFilter::NativeEventFilter() : QObject(){
free(r);
}
}
- if(XCB==0){ XCB = new LXCB(); }
}
void NativeEventFilter::start(){
diff --git a/src-qt5/core/libLumina/RootWindow.cpp b/src-qt5/core/libLumina/RootWindow.cpp
index f7b73eac..65fb6083 100644
--- a/src-qt5/core/libLumina/RootWindow.cpp
+++ b/src-qt5/core/libLumina/RootWindow.cpp
@@ -130,7 +130,7 @@ void RootWindow::ResizeRoot(){
//Trigger a repaint and send out any signals
this->setGeometry(fullscreen);
this->update();
- emit RootResized();
+ emit RootResized(fullscreen);
if(!valid.isEmpty()){ emit NewScreens(valid); }
if(!invalid.isEmpty()){ emit RemovedScreens(invalid); }
}
diff --git a/src-qt5/core/libLumina/RootWindow.h b/src-qt5/core/libLumina/RootWindow.h
index 080c4bd1..a7792752 100644
--- a/src-qt5/core/libLumina/RootWindow.h
+++ b/src-qt5/core/libLumina/RootWindow.h
@@ -65,7 +65,7 @@ protected:
signals:
void RegisterVirtualRoot(WId);
- void RootResized();
+ void RootResized(QRect);
void NewScreens(QStringList); // [screen_id_1, screen_id_2, etc..]
void RemovedScreens(QStringList); // [screen_id_1, screen_id_2, etc..]
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp
index 3226fa82..c0a0ac7d 100644
--- a/src-qt5/core/lumina-desktop-unified/LSession.cpp
+++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp
@@ -147,6 +147,8 @@ void LSession::setupSession(){
Lumina::ROOTWIN->ChangeWallpaper(scrns[i]->name(), RootWindow::Stretch, LOS::LuminaShare()+"desktop-background.jpg");
}
Lumina::ROOTWIN->start();
+ Lumina::NWS->setRoot_numberOfWorkspaces(QStringList() << "one" << "two");
+
DesktopContextMenu *cmenu = new DesktopContextMenu(Lumina::ROOTWIN);
connect(cmenu, SIGNAL(showLeaveDialog()), this, SLOT(StartLogout()) );
cmenu->start();
@@ -235,6 +237,7 @@ 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)) );
//Native Window Class connections
connect(Lumina::NEF, SIGNAL(WindowCreated(WId)), Lumina::NWS, SLOT(NewWindowDetected(WId)));
diff --git a/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro b/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
index 58c7e774..a4e9867b 100644
--- a/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
+++ b/src-qt5/core/lumina-desktop-unified/lumina-desktop.pro
@@ -12,7 +12,7 @@ target.path = $${L_BINDIR}
include(../libLumina/ResizeMenu.pri)
include(../libLumina/LDesktopUtils.pri) #includes LUtils and LOS
include(../libLumina/LuminaXDG.pri)
-include(../libLumina/LuminaX11.pri)
+#include(../libLumina/LuminaX11.pri)
include(../libLumina/LuminaSingleApplication.pri)
include(../libLumina/LuminaThemes.pri)
include(../libLumina/DesktopSettings.pri)
bgstack15