Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.0
-
None
Description
When running this example on Windows or Linux everything works as expected.
How to reproduce:
- Click on the button
- Red window should open, console should output qml: activate changed true
- Click inside the "main" window, console should output qml: activate changed false
On macOS nothing is output which means the signal onActiveChanged is never triggered.
import QtQuick import QtQuick.Controls Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") Button { anchors.centerIn: parent text: "click" onClicked: { window.show() window.requestActivate() } } Window { id: window width: 320 height: 240 visible: false flags: Qt.Popup | Qt.NoDropShadowWindowHint modality: Qt.NonModal transientParent: root.Window.window color: "red" onActiveChanged: { console.log("activate changed", window.active) } } }
This is the output on macOS from qt.qpa.window logging category:
QML debugging is enabled. Only use this in a safe environment. qt.qpa.window: QCocoaWindow::QCocoaWindow QQuickWindowQmlImpl(0x6000036d41e0) qt.qpa.window: QCocoaWindow::initialize QQuickWindowQmlImpl(0x6000036d41e0) qt.qpa.window: QCocoaWindow::setGeometry QQuickWindowQmlImpl(0x6000036d41e0) QRect(580,336 640x480) qt.qpa.window: QCocoaWindow::setCocoaGeometry QQuickWindowQmlImpl(0x6000036d41e0) QRect(580,336 640x480) qt.qpa.window: QCocoaWindow::recreateWindowIfNeeded QQuickWindowQmlImpl(0x6000036d41e0) QFlags<QCocoaWindow::RecreationReason>(MissingWindow|ContentViewChanged) qt.qpa.window: Ensuring that <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> is content view for <QNSWindow: 0x149a052a0; contentView=NSObject(0x0)>qt.qpa.window: Re-parenting <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> from NSObject(0x0) to <NSThemeFrame: 0x1498c08a0>qt.qpa.window: Done re-parenting <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> into <NSThemeFrame: 0x1498c08a0>qt.qpa.window: Moving <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> from NSObject(0x0) to <QNSWindow: 0x149a052a0; contentView=<QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))>>qt.qpa.window: Done moving <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> to <QNSWindow: 0x149a052a0; contentView=<QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))>>qt.qpa.window: QCocoaWindow::propagateSizeHints QQuickWindowQmlImpl(0x6000036d41e0) min: QSize(0, 0) max: QSize(16777215, 16777215) increment: QSize(-1, -1) base: QSize(-1, -1) qt.qpa.window: QCocoaWindow::setMask QQuickWindowQmlImpl(0x6000036d41e0) QRegion(null) qt.qpa.window: QCocoaWindow::setVisible QQuickWindowQmlImpl(0x6000036d41e0) true qt.qpa.window: QCocoaWindow::recreateWindowIfNeeded QQuickWindowQmlImpl(0x6000036d41e0) QFlags<QCocoaWindow::RecreationReason>(RecreationNotNeeded) qt.qpa.window: QCocoaWindow::handleGeometryChange QQuickWindowQmlImpl(0x6000036d41e0) current QRect(580,336 640x480) new QRect(580,336 640x480) qt.qpa.window: QCocoaWindow::windowDidChangeOcclusionState QQuickWindowQmlImpl(0x6000036d41e0) is now visible qt.qpa.window: QQuickWindowQmlImpl(0x6000036d41e0) did change <NSScreen: 0x600002df0000>qt.qpa.window: Screen changed for QQuickWindowQmlImpl(0x6000036d41e0) from QCocoaScreen(0x600003ed82c0, "Built-in Retina Display", QRect(0,0 1800x1169), dpr=2, displayId=1, <NSScreen: 0x600002df0000>) to QCocoaScreen(0x600003ed82c0, "Built-in Retina Display", QRect(0,0 1800x1169), dpr=2, displayId=1, <NSScreen: 0x600002df0000>) qt.qpa.window: QCocoaWindow::QCocoaWindow QQuickWindowQmlImpl(0x6000036d83c0) qt.qpa.window: QCocoaWindow::initialize QQuickWindowQmlImpl(0x6000036d83c0) qt.qpa.window: QCocoaWindow::setGeometry QQuickWindowQmlImpl(0x6000036d83c0) QRect(0,0 320x240) qt.qpa.window: QCocoaWindow::setCocoaGeometry QQuickWindowQmlImpl(0x6000036d83c0) QRect(0,0 320x240) qt.qpa.window: QCocoaWindow::recreateWindowIfNeeded QQuickWindowQmlImpl(0x6000036d83c0) QFlags<QCocoaWindow::RecreationReason>(MissingWindow|ContentViewChanged|PanelChanged) qt.qpa.window: Ensuring that <QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))> is content view for <QNSPanel: 0x14861ec10; contentView=NSObject(0x0)>qt.qpa.window: Re-parenting <QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))> from NSObject(0x0) to <NSNextStepFrame: 0x1486200e0>qt.qpa.window: Done re-parenting <QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))> into <NSNextStepFrame: 0x1486200e0>qt.qpa.window: Moving <QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))> from NSObject(0x0) to <QNSPanel: 0x14861ec10; contentView=<QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))>>qt.qpa.window: Done moving <QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))> to <QNSPanel: 0x14861ec10; contentView=<QNSView: 0x14861f590; QCocoaWindow(0x600003ed0b00, window=QQuickWindowQmlImpl(0x6000036d83c0))>>qt.qpa.window: QCocoaWindow::propagateSizeHints QQuickWindowQmlImpl(0x6000036d83c0) min: QSize(0, 0) max: QSize(16777215, 16777215) increment: QSize(-1, -1) base: QSize(-1, -1) qt.qpa.window: QCocoaWindow::setMask QQuickWindowQmlImpl(0x6000036d83c0) QRegion(null) qt.qpa.window: QCocoaWindow::setVisible QQuickWindowQmlImpl(0x6000036d83c0) true qt.qpa.window: QCocoaWindow::recreateWindowIfNeeded QQuickWindowQmlImpl(0x6000036d83c0) QFlags<QCocoaWindow::RecreationReason>(RecreationNotNeeded) qt.qpa.window: QCocoaWindow::handleGeometryChange QQuickWindowQmlImpl(0x6000036d83c0) current QRect(0,0 320x240) new QRect(0,0 320x240) qt.qpa.window: QCocoaWindow::windowDidChangeOcclusionState QQuickWindowQmlImpl(0x6000036d83c0) is now visible qt.qpa.window: QCocoaWindow::windowShouldClose QQuickWindowQmlImpl(0x6000036d41e0) qt.qpa.window: QCocoaWindow::setVisible QQuickWindowQmlImpl(0x6000036d41e0) false qt.qpa.window: QCocoaWindow::~QCocoaWindow QQuickWindowQmlImpl(0x6000036d41e0) qt.qpa.window: Re-parenting <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> from <NSThemeFrame: 0x1498c08a0> to NSObject(0x0) qt.qpa.window: Done re-parenting <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> into NSObject(0x0) qt.qpa.window: Moving <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> from <QNSWindow: 0x149a052a0; contentView=<QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))>> to NSObject(0x0) qt.qpa.window: Done moving <QNSView: 0x149a17c10; QCocoaWindow(0x600003ec7de0, window=QQuickWindowQmlImpl(0x6000036d41e0))> to NSObject(0x0) qt.qpa.window: Deallocating <QNSWindow: 0x149a052a0; contentView=NSObject(0x0)>qt.qpa.window: Deallocating <QNSView: 0x149a17c10; QCocoaWindow(0x0)>