From 5de759a52a3339741bff176d47efb9d9399d7c0d Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 27 Jun 2017 12:21:43 -0400 Subject: Commit some more debugging and changes to the event systems for Lumina2. --- src-qt5/core/libLumina/NativeWindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 97131b52..020e4596 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -17,6 +17,14 @@ NativeWindow::~NativeWindow(){ //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 } +void NativeWindow::addFrameWinID(WId fid){ + relatedTo << fid; +} + +bool NativeWindow::isRelatedTo(WId tmp){ + return (relatedTo.contains(tmp) || winid == tmp); +} + WId NativeWindow::id(){ return winid; } -- cgit From b02fd1721f71e3f120c2fe56d866fac5b3a796d1 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 28 Jun 2017 10:20:24 -0400 Subject: Work on making a new NativeWindow property "RelatedWindows" which is a special property used only for seeing which Window ID's are also associated with a given window. --- src-qt5/core/libLumina/NativeWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 020e4596..1fcaa552 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -35,11 +35,13 @@ QWindow* NativeWindow::window(){ QVariant NativeWindow::property(NativeWindow::Property prop){ if(hash.contains(prop)){ return hash.value(prop); } + else if(prop == NativeWindow::RelatedWindows){ return QVariant::fromValue(relatedTo); } return QVariant(); //null variant } void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){ - if(prop == NativeWindow::None || hash.value(prop)==val){ return; } + if(prop == NativeWindow::RelatedWindows){ relatedTo = val.value< QList >(); } + else if(prop == NativeWindow::None || hash.value(prop)==val){ return; } hash.insert(prop, val); emit PropertiesChanged(QList() << prop, QList() << val); } @@ -54,7 +56,7 @@ void NativeWindow::setProperties(QList props, QList() << prop, QList() << val); } @@ -62,7 +64,7 @@ void NativeWindow::requestProperties(QList props, QList< //Verify/adjust inputs as needed for(int i=0; i=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this property - if(props[i] == NativeWindow::None || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value + if(props[i] == NativeWindow::None || props[i] == NativeWindow::RelatedWindows || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value } emit RequestPropertiesChange(winid, props, vals); } -- cgit From 431e837ead4e8fd7f7aef6b7d198dac50156c2b2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 28 Jun 2017 17:18:57 -0400 Subject: Get a lot more of the Lumina2 window-management functionality working. --- src-qt5/core/libLumina/NativeWindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 1fcaa552..68610ce2 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -9,6 +9,7 @@ // === PUBLIC === NativeWindow::NativeWindow(WId id) : QObject(){ winid = id; + frameid = 0; WIN = QWindow::fromWinId(winid); } @@ -18,11 +19,11 @@ NativeWindow::~NativeWindow(){ } void NativeWindow::addFrameWinID(WId fid){ - relatedTo << fid; + frameid = fid; } bool NativeWindow::isRelatedTo(WId tmp){ - return (relatedTo.contains(tmp) || winid == tmp); + return (relatedTo.contains(tmp) || winid == tmp || frameid == tmp); } WId NativeWindow::id(){ @@ -65,6 +66,11 @@ void NativeWindow::requestProperties(QList props, QList< for(int i=0; i=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this property if(props[i] == NativeWindow::None || props[i] == NativeWindow::RelatedWindows || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value + if( (props[i] == NativeWindow::Visible || props[i] == NativeWindow::Active) && frameid !=0){ + //These particular properties needs to change the frame - not the window itself + emit RequestPropertiesChange(frameid, QList() << props[i], QList() << vals[i]); + props.removeAt(i); vals.removeAt(i); i--; + } } emit RequestPropertiesChange(winid, props, vals); } -- cgit From d911eba7e870937803e68562729b38173cdd5857 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 29 Jun 2017 11:02:42 -0400 Subject: Ensure that the Global Position (and Size) properties *always* reference the embedded window. Also make a new "geometry()" function in NativeWindow to return the full window+frame geometry. --- src-qt5/core/libLumina/NativeWindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 68610ce2..8853c48e 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -75,6 +75,16 @@ void NativeWindow::requestProperties(QList props, QList< emit RequestPropertiesChange(winid, props, vals); } +QRect NativeWindow::geometry(){ + //Calculate the "full" geometry of the window + frame (if any) + QRect geom( hash.value(NativeWindow::GlobalPos).toPoint(), hash.value(NativeWindow::Size).toSize() ); + //Now adjust the window geom by the frame margins + QList frame = hash.value(NativeWindow::FrameExtents).value< QList >(); //Left,Right,Top,Bottom + if(frame.length()==4){ + geom = geom.adjusted( -frame[0], -frame[2], frame[1], frame[3] ); + } + return geom; +} // ==== PUBLIC SLOTS === void NativeWindow::requestClose(){ emit RequestClose(winid); -- cgit From 3cc4bb91529afd0a3454a3db86a7d8a7f51fde96 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 29 Jun 2017 22:31:49 -0400 Subject: Commit another large block of work on Lumina2. 1. Starting to get the compositing put together, but not functional yet. 2. Get the window close routines completely finished, with memory being freed properly on close. 3. Get some of the "reset" of window properties after an animation all setup. Not quite finished yet. --- src-qt5/core/libLumina/NativeWindow.cpp | 43 +++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 8853c48e..819661d5 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -10,7 +10,8 @@ NativeWindow::NativeWindow(WId id) : QObject(){ winid = id; frameid = 0; - WIN = QWindow::fromWinId(winid); + dmgID = 0; + //WIN = QWindow::fromWinId(winid); } NativeWindow::~NativeWindow(){ @@ -22,6 +23,10 @@ void NativeWindow::addFrameWinID(WId fid){ frameid = fid; } +void NativeWindow::addDamageID(unsigned int dmg){ + dmgID = dmg; +} + bool NativeWindow::isRelatedTo(WId tmp){ return (relatedTo.contains(tmp) || winid == tmp || frameid == tmp); } @@ -30,47 +35,55 @@ WId NativeWindow::id(){ return winid; } -QWindow* NativeWindow::window(){ - return WIN; +WId NativeWindow::frameId(){ + return frameid; +} + +unsigned int NativeWindow::damageId(){ + return dmgID; } +/*QWindow* NativeWindow::window(){ + return WIN; +}*/ + QVariant NativeWindow::property(NativeWindow::Property prop){ if(hash.contains(prop)){ return hash.value(prop); } else if(prop == NativeWindow::RelatedWindows){ return QVariant::fromValue(relatedTo); } return QVariant(); //null variant } -void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){ +void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val, bool force){ if(prop == NativeWindow::RelatedWindows){ relatedTo = val.value< QList >(); } - else if(prop == NativeWindow::None || hash.value(prop)==val){ return; } - hash.insert(prop, val); + else if(prop == NativeWindow::None || (!force && hash.value(prop)==val)){ return; } + else{ hash.insert(prop, val); } emit PropertiesChanged(QList() << prop, QList() << val); } -void NativeWindow::setProperties(QList props, QList vals){ +void NativeWindow::setProperties(QList props, QList vals, bool force){ for(int i=0; i=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this propertu - if(props[i] == NativeWindow::None || (hash.value(props[i]) == vals[i]) ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value + if(i>=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this property + if(props[i] == NativeWindow::None || (!force && (hash.value(props[i]) == vals[i])) ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value hash.insert(props[i], vals[i]); } emit PropertiesChanged(props, vals); } -void NativeWindow::requestProperty(NativeWindow::Property prop, QVariant val){ - if(prop == NativeWindow::None || prop == NativeWindow::RelatedWindows || hash.value(prop)==val ){ return; } +void NativeWindow::requestProperty(NativeWindow::Property prop, QVariant val, bool force){ + if(prop == NativeWindow::None || prop == NativeWindow::RelatedWindows || (!force && hash.value(prop)==val) ){ return; } emit RequestPropertiesChange(winid, QList() << prop, QList() << val); } -void NativeWindow::requestProperties(QList props, QList vals){ +void NativeWindow::requestProperties(QList props, QList vals, bool force){ //Verify/adjust inputs as needed for(int i=0; i=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this property - if(props[i] == NativeWindow::None || props[i] == NativeWindow::RelatedWindows || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value - if( (props[i] == NativeWindow::Visible || props[i] == NativeWindow::Active) && frameid !=0){ + if(props[i] == NativeWindow::None || props[i] == NativeWindow::RelatedWindows || (!force && hash.value(props[i])==vals[i]) ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value + /*if( (props[i] == NativeWindow::Visible || props[i] == NativeWindow::Active) && frameid !=0){ //These particular properties needs to change the frame - not the window itself emit RequestPropertiesChange(frameid, QList() << props[i], QList() << vals[i]); props.removeAt(i); vals.removeAt(i); i--; - } + }*/ } emit RequestPropertiesChange(winid, props, vals); } -- cgit From 6a2af03c68033a9683de619b4ae6493a4f7254b7 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 13 Jul 2017 14:02:59 -0400 Subject: Large update to the window embedding systems - almost have the compositing up and running. --- src-qt5/core/libLumina/NativeWindow.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 819661d5..ff7322f6 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -11,12 +11,10 @@ NativeWindow::NativeWindow(WId id) : QObject(){ winid = id; frameid = 0; dmgID = 0; - //WIN = QWindow::fromWinId(winid); } NativeWindow::~NativeWindow(){ hash.clear(); - //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 } void NativeWindow::addFrameWinID(WId fid){ @@ -43,10 +41,6 @@ unsigned int NativeWindow::damageId(){ return dmgID; } -/*QWindow* NativeWindow::window(){ - return WIN; -}*/ - QVariant NativeWindow::property(NativeWindow::Property prop){ if(hash.contains(prop)){ return hash.value(prop); } else if(prop == NativeWindow::RelatedWindows){ return QVariant::fromValue(relatedTo); } @@ -93,9 +87,11 @@ QRect NativeWindow::geometry(){ QRect geom( hash.value(NativeWindow::GlobalPos).toPoint(), hash.value(NativeWindow::Size).toSize() ); //Now adjust the window geom by the frame margins QList frame = hash.value(NativeWindow::FrameExtents).value< QList >(); //Left,Right,Top,Bottom + qDebug() << "Calculate Geometry:" << geom << frame; if(frame.length()==4){ geom = geom.adjusted( -frame[0], -frame[2], frame[1], frame[3] ); } + qDebug() << " - Total:" << geom; return geom; } // ==== PUBLIC SLOTS === -- cgit From c6cf1c1799aa3e6f095cae0aa579e0ea2971340e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 13 Jul 2017 15:49:07 -0400 Subject: Start working on getting the frame extents set/used properly. Still off on the geom calculations right now. --- src-qt5/core/libLumina/NativeWindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src-qt5/core/libLumina/NativeWindow.cpp') diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index ff7322f6..94d39cb7 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -6,6 +6,8 @@ //=========================================== #include "NativeWindow.h" +#include + // === PUBLIC === NativeWindow::NativeWindow(WId id) : QObject(){ winid = id; -- cgit