aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h b/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h
index 0979cf82..f31c7a8e 100644
--- a/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h
+++ b/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h
@@ -59,8 +59,12 @@ protected:
virtual void mouseMoveEvent(QMouseEvent *ev){
//qDebug() << "Got Move Event:" << this->geometry() << ev->pos();
- if(selTab>=0 && !this->parentWidget()->geometry().contains( this->mapToParent(ev->pos())) ){
- //qDebug() << "Starting Drag:" << this->geometry() << ev->pos();
+ QWidget *parent = this->parentWidget(); //top-level parent widget
+ while(parent->parentWidget()!=0 && !parent->isWindow()){ parent = parent->parentWidget(); }
+ if(selTab>=0 && !QRect(QPoint(0,0), parent->size()).contains( this->mapTo(parent, ev->pos())) ){
+ //qDebug() << "Got Mouse outside of parent:" << parent->geometry() << this->geometry() << this->mapTo(parent, ev->pos());
+ //if(ev->button()!=Qt::LeftButton){ QTabBar::mouseMoveEvent(ev); return; }
+ qDebug() << "Starting Drag:" << this->geometry() << ev->pos();
QString tab = selTab;
this->mouseReleaseEvent(new QMouseEvent(QEvent::MouseButtonRelease, ev->pos(), ev->button(), ev->buttons(), ev->modifiers()) ); //will reset selTab
//this->update();
bgstack15