Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions frame/dsutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ class UtilityPrivate : public DObjectPrivate
Utility *Utility::instance()
{
static Utility* g_instance = nullptr;
auto platformName = QGuiApplication::platformName();
if (g_instance == nullptr) {
if (QStringLiteral("wayland") == platformName) {
g_instance = new Utility();
}
#ifdef BUILD_WITH_X11
g_instance = new X11Utility();
#else
g_instance = new Utility();
else if (QStringLiteral("xcb") == platformName) {
g_instance = new X11Utility();
}
#endif
}
return g_instance;
Expand Down
4 changes: 2 additions & 2 deletions frame/qml/PanelMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Item {
{
if (!menuWindow)
return

menuWindow.currentItem = null

menuWindow.close()
menuWindow.currentItem = null
}

Connections {
Expand Down
2 changes: 1 addition & 1 deletion frame/qml/PanelMenuWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import QtQuick.Window 2.15
PanelPopupWindow {
id: root

flags: Qt.Tool | Qt.X11BypassWindowManagerHint | Qt.WindowStaysOnTopHint
flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool | Qt.X11BypassWindowManagerHint : Qt.ToolTip) | Qt.WindowStaysOnTopHint
}
2 changes: 1 addition & 1 deletion frame/qml/PanelPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Item {
if (!popupWindow)
return

popupWindow.currentItem = null
popupWindow.close()
popupWindow.currentItem = null
}

Connections {
Expand Down
6 changes: 5 additions & 1 deletion frame/qml/PanelPopupWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Window {
x: selectValue(transientParent ? transientParent.x + xOffset : 0, Screen.virtualX + 10, Screen.virtualX + Screen.width - root.width - 10)
y: selectValue(transientParent ? transientParent.y + yOffset : 0, Screen.virtualY + 10, Screen.virtualY + Screen.height - root.height - 10)
function selectValue(value, min, max) {
// wayland do not need to be limitted in the screen, this has been done by compositor
if (Qt.platform.pluginName === "wayland")
return value

if (value < min)
return min
if (value > max)
Expand All @@ -31,7 +35,7 @@ Window {
value: root.transientParent ? root.transientParent.screen: undefined
}
// TODO: it's a qt bug which make Qt.Popup can not get input focus
flags: Qt.Tool
flags: Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip
D.DWindow.enabled: true
D.DWindow.windowRadius: D.DTK.platformTheme.windowRadius < 0 ? 4 : D.DTK.platformTheme.windowRadius
D.DWindow.enableSystemResize: false
Expand Down
2 changes: 1 addition & 1 deletion frame/qml/PanelToolTipWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.deepin.dtk 1.0 as D
PanelPopupWindow {
id: root

flags: Qt.Tool | Qt.WindowStaysOnTopHint
flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip) | Qt.WindowStaysOnTopHint
D.DWindow.windowRadius: 4
D.DWindow.shadowRadius: 8
}