diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-29 22:31:49 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-29 22:31:49 -0400 |
commit | 3cc4bb91529afd0a3454a3db86a7d8a7f51fde96 (patch) | |
tree | e6a724d3b495bfc62a1b1e677883d02c21906a7e /src-qt5/core/libLumina/NativeWindow.cpp | |
parent | Back out that secondary close ID - unrelated to the actual window that was cl... (diff) | |
download | lumina-3cc4bb91529afd0a3454a3db86a7d8a7f51fde96.tar.gz lumina-3cc4bb91529afd0a3454a3db86a7d8a7f51fde96.tar.bz2 lumina-3cc4bb91529afd0a3454a3db86a7d8a7f51fde96.zip |
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.
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 43 |
1 files changed, 28 insertions, 15 deletions
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<WId> >(); } - 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<NativeWindow::Property>() << prop, QList<QVariant>() << val); } -void NativeWindow::setProperties(QList<NativeWindow::Property> props, QList<QVariant> vals){ +void NativeWindow::setProperties(QList<NativeWindow::Property> props, QList<QVariant> vals, bool force){ for(int i=0; i<props.length(); i++){ - if(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<NativeWindow::Property>() << prop, QList<QVariant>() << val); } -void NativeWindow::requestProperties(QList<NativeWindow::Property> props, QList<QVariant> vals){ +void NativeWindow::requestProperties(QList<NativeWindow::Property> props, QList<QVariant> vals, bool force){ //Verify/adjust inputs as needed for(int i=0; i<props.length(); i++){ if(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<NativeWindow::Property>() << props[i], QList<QVariant>() << vals[i]); props.removeAt(i); vals.removeAt(i); i--; - } + }*/ } emit RequestPropertiesChange(winid, props, vals); } |