Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Some future release
-
None
-
-
87dd49f63 (dev), 8723daf69 (dev), dfb67989d (dev), 2f6fe3a26 (dev), 4ec05ee2a (6.6), 686bb12ba (tqtc/lts-6.5), 9eb06a284 (dev), 75a560515 (dev), cf9b143cb (dev), 565923306 (6.7), 122b4c21a (6.7), 28ac7a4e6 (6.6), 8c3a2f643 (tqtc/lts-6.5)
Description
Window focus is not the same as window activation.
A single window (possibly non-Qt) window is the focus window (receives keyboard input e.g., but not limited to), and is typically also active, but other window may also be active:
- siblings of that window
- children of that window
- parents of that window
- including transient parents
- other windows, that the OS considers active even if another window has keyboard focus
Some things we need to clean up:
- Widgets
- Replace tests calling QApplicationPrivate::setActiveWindow with requestActivate
- Replace QApplicationPrivate::active_window with QGuiApp::focus_window
- Simplify QApplicationPrivate::setActiveWindow if based on focus window
- Replace calls to QApplicationPrivate::setActiveWindow with update of focus window and let code in QApplicationPrivate::setActiveWindow trigger as a result, not a cause
- Gui
- Plumb QWindow::isActive() to QPlatformWindow::isActive()
- Remove QWidget::isActiveWindow() plumbing for the same
Rename QWSI::processActivatedEvent to focusWindowChange- Add dedicated QWSI for window activation change only
- Emit activeChanged along with notifyActiveWindowChange
- Deprecate Qt::WindowActive in favor of QWindow::isActive()
- Send/emit activation change before focus changes in QGuiApplicationPrivate::processFocusWindowEvent
- Logically makes sense, the window is activated first, and as a result, gains focus
- Matches the order that widgets receive the events in QApplicationPrivate::setActiveWindow
- Plumb QWindow::isActive() to QPlatformWindow::isActive()
- Testlib
- Add qWaitForWindowFocus(), to distinguish it from qWaitForWindowActive
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-119287 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
534321,5 | Add dedicated QWSI event for window activation change only | dev | qt/qtbase | Status: NEW | -1 | 0 |
534322,6 | QWindow::isActive() should reflect the status from the platform window | dev | qt/qtbase | Status: NEW | 0 | 0 |
534323,6 | Cocoa: Implement QPlatformWindow::isActive() | dev | qt/qtbase | Status: NEW | 0 | 0 |
535633,3 | Cocoa: Implement new QWSI window activation change event | dev | qt/qtbase | Status: NEW | 0 | 0 |