Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FocusHighlighting is broken after detaching a dock widget (float) #581

Closed
iam-peter opened this issue Nov 23, 2023 · 2 comments
Closed

FocusHighlighting is broken after detaching a dock widget (float) #581

iam-peter opened this issue Nov 23, 2023 · 2 comments
Assignees

Comments

@iam-peter
Copy link

iam-peter commented Nov 23, 2023

After starting the demo application and dragging out any focusable dock widget the focus behavior is broken. In the attached video you can see me clicking on a bunch of docked dock widgets after detaching a dock widget (make it float) that not get focused (tab isn't going to turn blue).
This can be fixed clicking on a tab of any docked dock widget. Afterwards the focus behavior acts normal again.

Tested with Qt 6.4.3 and Qt 6.5.3 on Ubuntu 22.04

2023-11-23.14-40-48.mp4
@iam-peter iam-peter changed the title Focus is broken after making a dock widget floating FocusHighlighting is broken after detach a dock widget (float) Nov 23, 2023
@iam-peter iam-peter changed the title FocusHighlighting is broken after detach a dock widget (float) FocusHighlighting is broken after detaching a dock widget (float) Nov 23, 2023
@iam-peter
Copy link
Author

This issue is also present on Windows. It is about the m_tabPressed not being reset to false after dragging a tab. I fixed it by placing the reset in CDockWidgetTab::mouseReleaseEvent outside the switch statement. Have a look at the diff below.

diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp
index 040939a..941138a 100644
--- a/src/DockWidgetTab.cpp
+++ b/src/DockWidgetTab.cpp
@@ -419,13 +419,10 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
                         ev->accept();
                         d->FloatingWidget->finishDragging();
                         break;
-
-               default:
-                       if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
-                       {
-                               d->focusController()->setDockWidgetTabPressed(false);
-                       }
-                       break; // do nothing
+               }
+               if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
+               {
+                       d->focusController()->setDockWidgetTabPressed(false);
                }
        } 
        else if (ev->button() == Qt::MiddleButton)

@githubuser0xFFFF
Copy link
Owner

@iam-peter Thank you for the bug report - I can reproduce this on Windows. Thank you also for the bug fix. I will review and test it and then integrate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants