aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-02-01 16:13:52 -0500
committerKen Moore <ken@ixsystems.com>2017-02-01 16:13:52 -0500
commit014ce3d9363b15912a53cc8885358b0436b3bb27 (patch)
tree3fba59a0ffedadac98cb904db64c10ccc29417a0 /src-qt5/core/libLumina
parentAdd a new "NativeWindow" class to the library. This is a pure Qt container cl... (diff)
downloadlumina-014ce3d9363b15912a53cc8885358b0436b3bb27.tar.gz
lumina-014ce3d9363b15912a53cc8885358b0436b3bb27.tar.bz2
lumina-014ce3d9363b15912a53cc8885358b0436b3bb27.zip
Another large batch of work on Lumina2:
The NativeWindow intermediary seems to be working really well, now just to start adding the the various event detection parsing in to modify that object on-demand. There is still a window focus issue too - the setActive routine is not properly setting that window to have focus yet - need to examine further.
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r--src-qt5/core/libLumina/LuminaX11.cpp15
-rw-r--r--src-qt5/core/libLumina/LuminaX11.h12
-rw-r--r--src-qt5/core/libLumina/NativeWindow.cpp2
-rw-r--r--src-qt5/core/libLumina/NativeWindow.h1
-rw-r--r--src-qt5/core/libLumina/RootSubWindow.cpp1
5 files changed, 29 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaX11.cpp b/src-qt5/core/libLumina/LuminaX11.cpp
index a8016460..c586790b 100644
--- a/src-qt5/core/libLumina/LuminaX11.cpp
+++ b/src-qt5/core/libLumina/LuminaX11.cpp
@@ -1609,7 +1609,20 @@ WId LXCB::WM_Get_Active_Window(){
}
void LXCB::WM_Set_Active_Window(WId win){
- xcb_ewmh_set_active_window(&EWMH, QX11Info::appScreen(), win);
+ xcb_ewmh_set_active_window(&EWMH, QX11Info::appScreen(), win);
+ //Also send the active window a message to take input focus
+ xcb_client_message_event_t event;
+ event.response_type = XCB_CLIENT_MESSAGE;
+ event.format = 32;
+ event.window = win; //window to activate
+ event.type = ATOMS[atoms.indexOf("WM_PROTOCOLS")];
+ event.data.data32[0] = ATOMS[atoms.indexOf("WM_TAKE_FOCUS")];
+ event.data.data32[1] = QX11Info::getTimestamp(); //current timestamp
+ event.data.data32[2] = 0;
+ event.data.data32[3] = 0;
+ event.data.data32[4] = 0;
+
+ xcb_send_event(QX11Info::connection(), 0, win, XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *) &event);
}
// _NET_WORKAREA
diff --git a/src-qt5/core/libLumina/LuminaX11.h b/src-qt5/core/libLumina/LuminaX11.h
index 2c741111..dd9f8213 100644
--- a/src-qt5/core/libLumina/LuminaX11.h
+++ b/src-qt5/core/libLumina/LuminaX11.h
@@ -67,6 +67,18 @@ public:
|| width_inc>=0 || height_inc>=0 || min_aspect_num>=0 || min_aspect_den>=0 || max_aspect_num>=0 || max_aspect_den>=0 \
|| base_width>=0 || base_height>=0 || win_gravity>0 );
}
+ bool validMaxSize(){
+ return (max_width>0 && max_width>=min_width) && (max_height>0 && max_height>=min_height);
+ }
+ bool validMinSize(){
+ return (min_width>0 && min_height>0);
+ }
+ bool validBaseSize(){
+ return (base_width>0 && base_height>0);
+ }
+ bool validSize(){ //only check this if the base sizes are invalid (this is the old spec and should not be used any more)
+ return (x>0 && y>0);
+ }
};
//simple data structure for passing around the XRANDR information
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp
index eb85e394..bd42ecaa 100644
--- a/src-qt5/core/libLumina/NativeWindow.cpp
+++ b/src-qt5/core/libLumina/NativeWindow.cpp
@@ -14,7 +14,7 @@ NativeWindow::NativeWindow(WId id) : QObject(){
NativeWindow::~NativeWindow(){
hash.clear();
- WIN->deleteLater();
+ //WIN->deleteLater(); //This class only deals with Native windows which were created outside the app - they need to be cleaned up outside the app too
}
WId NativeWindow::id(){
diff --git a/src-qt5/core/libLumina/NativeWindow.h b/src-qt5/core/libLumina/NativeWindow.h
index bcbe8b6c..c4fdbb47 100644
--- a/src-qt5/core/libLumina/NativeWindow.h
+++ b/src-qt5/core/libLumina/NativeWindow.h
@@ -30,6 +30,7 @@ public:
MaxSize, /*QSize*/
Size, /*int*/
Title, /*QString*/
+ ShortTitle, /*QString*/
Icon, /*QIcon*/
Name, /*QString*/
Workspace, /*int*/
diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp
index 93a49e6b..7be89f48 100644
--- a/src-qt5/core/libLumina/RootSubWindow.cpp
+++ b/src-qt5/core/libLumina/RootSubWindow.cpp
@@ -65,6 +65,7 @@ void RootSubWindow::aboutToActivate(){
void RootSubWindow::propertyChanged(NativeWindow::Property prop, QVariant val){
if(val.isNull()){ return; } //not the same as a default/empty value - the property has just not been set yet
+ qDebug() << "Set Window Property:" << prop << val;
switch(prop){
case NativeWindow::Visible:
if(val.toBool()){ clientShown(); }
bgstack15