feat: 提示框添加ToolTip属性

wayland回合master,原始提交: https://gerrit.uniontech.com/c/dde-dock/+/1394

Log: 社区版适配wayland
Task: https://pms.uniontech.com/zentao/task-view-81916.html
Influence: wayland环境下提示框ToolTip属性
Change-Id: I499ef3ea01747104747e01c43b8b505d0c19fa2d
This commit is contained in:
yinjie 2021-08-06 17:23:05 +08:00 committed by chenbin
parent f95055e0b9
commit 153482248e
2 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,7 @@
*/
#include "dockpopupwindow.h"
#include "utils.h"
#include <QScreen>
#include <QApplication>
@ -40,7 +41,12 @@ DockPopupWindow::DockPopupWindow(QWidget *parent)
compositeChanged();
setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus);
setAttribute(Qt::WA_InputMethodEnabled, false);
if (Utils::IS_WAYLAND_DISPLAY) {
setAttribute(Qt::WA_NativeWindow);
windowHandle()->setProperty("_d_dwayland_window-type", "tooltip");
}else {
setAttribute(Qt::WA_InputMethodEnabled, false);
}
connect(m_wmHelper, &DWindowManagerHelper::hasCompositeChanged, this, &DockPopupWindow::compositeChanged);
connect(m_regionInter, &DRegionMonitor::buttonPress, this, &DockPopupWindow::onGlobMouseRelease);

View File

@ -31,6 +31,8 @@ namespace Utils {
#define ICBC_CONF_FILE "/etc/deepin/icbc.conf"
const bool IS_WAYLAND_DISPLAY = !qgetenv("WAYLAND_DISPLAY").isEmpty();
/**
* @brief SettingsPtr QGSettings指针
* @param schema_id The id of the schema