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

(fix) waveform / spinnies: don't take keyboard focus on click #13174

Merged
merged 1 commit into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/widget/openglwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
OpenGLWindow::OpenGLWindow(WGLWidget* pWidget)
: m_pWidget(pWidget) {
setFormat(WaveformWidgetFactory::getSurfaceFormat());
// Set the tooltip flag to prevent this window/widget from getting
// keyboard focus on click.
setFlag(Qt::ToolTip);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setFlag(Qt::ToolTip);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
setFlag(Qt::ToolTip);
#else
setFlag(Qt::Tool);
#endif

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this doesn't work either in Qt6.
Also tried SplashScreen and SubWindow

I suggest to stick with this for 2.4.x and take a closer look at the qt sources, i.e. the Qt5 -> Qt6 changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. Adding setFlag(Qt::Tool) definitely works for me with main on macOS...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, obvious Qt::WindowDoesNotAcceptFocus flag does the trick on Linux wit Qt 6.2.3

Will open a fixup.

}

OpenGLWindow::~OpenGLWindow() {
Expand Down
Loading