aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/NativeEmbedWidget.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-31 11:42:33 -0400
committerKen Moore <ken@ixsystems.com>2017-08-31 11:42:33 -0400
commit2ed1ee7459868dca7228d61202a38c7c9c3e23f8 (patch)
tree60d44c92e91f63662ceef064b9f9736f0ffca6ce /src-qt5/core/libLumina/NativeEmbedWidget.cpp
parentA but more work on Lumina2: (diff)
downloadlumina-2ed1ee7459868dca7228d61202a38c7c9c3e23f8.tar.gz
lumina-2ed1ee7459868dca7228d61202a38c7c9c3e23f8.tar.bz2
lumina-2ed1ee7459868dca7228d61202a38c7c9c3e23f8.zip
Get all the single-window interactions finished up.
Now the multiple types of animations will not conflict/overwrite each other, and the window itself will be properly "paused" for animations. Also fix up some window resize calculation errors, so the offset to the mouse position is properly handled now
Diffstat (limited to 'src-qt5/core/libLumina/NativeEmbedWidget.cpp')
-rw-r--r--src-qt5/core/libLumina/NativeEmbedWidget.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.cpp b/src-qt5/core/libLumina/NativeEmbedWidget.cpp
index 21b4494f..96393e98 100644
--- a/src-qt5/core/libLumina/NativeEmbedWidget.cpp
+++ b/src-qt5/core/libLumina/NativeEmbedWidget.cpp
@@ -67,7 +67,7 @@ inline void registerClientEvents(WId id){
// ============
//Simplification functions for the XCB/XLib interactions
void NativeEmbedWidget::syncWinSize(QSize sz){
- if(WIN==0 || paused){ return; }
+ if(WIN==0){ return; }
else if(!sz.isValid()){ sz = this->size(); } //use the current widget size
//qDebug() << "Sync Window Size:" << sz;
//if(sz == winSize){ return; } //no change
@@ -117,8 +117,14 @@ QImage NativeEmbedWidget::windowImage(QRect geom){
return img;
-}
+}
+void NativeEmbedWidget::setWinUnpaused(){
+ paused = false;
+ if(!DISABLE_COMPOSITING){
+ repaintWindow(); //update the cached image right away
+ }
+}
// ============
// PUBLIC
// ============
@@ -215,6 +221,7 @@ void NativeEmbedWidget::resume(){
}else{
repaintWindow(); //update the cached image right away
}
+ QTimer::singleShot(10, this, SLOT(setWinUnpaused()) );
}
void NativeEmbedWidget::resyncWindow(){
@@ -267,7 +274,7 @@ void NativeEmbedWidget::reregisterEvents(){
// ==============
void NativeEmbedWidget::resizeEvent(QResizeEvent *ev){
QWidget::resizeEvent(ev);
- if(WIN!=0){
+ if(WIN!=0 && !paused){
syncWinSize(ev->size());
} //syncronize the window with the new widget size
}
@@ -283,13 +290,13 @@ void NativeEmbedWidget::hideEvent(QHideEvent *ev){
}
void NativeEmbedWidget::paintEvent(QPaintEvent *ev){
- if(WIN==0 || paused){ return; }
+ if(WIN==0){ return; }
//else if( winImage.isNull() ){return; }
else if(DISABLE_COMPOSITING){
// Just make it solid black (underneath the embedded window)
// - only visible when looking through the edge of another window)
- QPainter P(this);
- P.fillRect(ev->rect(), Qt::black);
+ //QPainter P(this);
+ //P.fillRect(ev->rect(), Qt::black);
return;
}
//renderWindowToWidget(WIN->id(), this);
bgstack15