From 9d1f861baa6ee8e0238999770e806e22a57cb301 Mon Sep 17 00:00:00 2001 From: tsic404 Date: Mon, 25 Nov 2024 19:21:52 +0800 Subject: [PATCH] fix: popup has no focus on treeland adjust popup window flags log: as title --- frame/qml/PanelMenuWindow.qml | 2 +- frame/qml/PanelPopupWindow.qml | 3 +-- frame/qml/PanelToolTipWindow.qml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frame/qml/PanelMenuWindow.qml b/frame/qml/PanelMenuWindow.qml index 9a2444486..fecdb0723 100644 --- a/frame/qml/PanelMenuWindow.qml +++ b/frame/qml/PanelMenuWindow.qml @@ -8,7 +8,7 @@ import QtQuick.Window 2.15 PanelPopupWindow { id: root - flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool | Qt.X11BypassWindowManagerHint : Qt.ToolTip) | Qt.WindowStaysOnTopHint + flags: Qt.Popup | Qt.WindowStaysOnTopHint // it's value is useful to distinguish MenuWindow with SubMenuWindow in grabMouse property QtObject mainMenuWindow } diff --git a/frame/qml/PanelPopupWindow.qml b/frame/qml/PanelPopupWindow.qml index eb11e8872..f9ce7e9a7 100644 --- a/frame/qml/PanelPopupWindow.qml +++ b/frame/qml/PanelPopupWindow.qml @@ -53,8 +53,7 @@ Window { width: 10 height: 10 - // TODO: it's a qt bug which make Qt.Popup can not get input focus - flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip) | Qt.WindowStaysOnTopHint + flags: Qt.Popup D.DWindow.enabled: true D.DWindow.windowRadius: D.DTK.platformTheme.windowRadius < 0 ? 4 : D.DTK.platformTheme.windowRadius D.DWindow.enableSystemResize: false diff --git a/frame/qml/PanelToolTipWindow.qml b/frame/qml/PanelToolTipWindow.qml index 189f3da04..32a55c849 100644 --- a/frame/qml/PanelToolTipWindow.qml +++ b/frame/qml/PanelToolTipWindow.qml @@ -10,7 +10,7 @@ import org.deepin.dtk 1.0 as D PanelPopupWindow { id: root - flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip) | Qt.WindowStaysOnTopHint + flags: Qt.ToolTip | Qt.WindowStaysOnTopHint D.DWindow.windowRadius: 8 D.DWindow.shadowRadius: 8 }