mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修复wayland环境时尚模式下打开企业微信崩溃的问题
wayland下时尚模式的xcb_connection_t的值为nullptr,构造函数中传入一个可用的值 Log: 修复wayland环境时尚模式下打开企业微信崩溃的问题 Influence: 进入wayland桌面,进入时尚模式,打开企业微信,双击,观察企业微信是否正常打开 Task: https://pms.uniontech.com/task-view-196629.html Change-Id: Ib0a5ebdadbce672474db9dab57f27da263b8096b
This commit is contained in:
parent
279ff63e41
commit
c9aca4f728
@ -64,14 +64,13 @@ QWidget *TrayDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
|
||||
BaseTrayWidget *trayWidget = nullptr;
|
||||
if(type == TrayIconType::XEMBED) {
|
||||
if (Utils::IS_WAYLAND_DISPLAY) {
|
||||
trayWidget = new XEmbedTrayItemWidget(winId, nullptr, nullptr, parent);
|
||||
} else {
|
||||
int screenp = 0;
|
||||
static Display *display = XOpenDisplay(nullptr);
|
||||
static int screenp = 0;
|
||||
static xcb_connection_t *xcb_connection = xcb_connect(qgetenv("DISPLAY"), &screenp);
|
||||
static Display *m_display = XOpenDisplay(nullptr);
|
||||
trayWidget = new XEmbedTrayItemWidget(winId, xcb_connection, m_display, parent);
|
||||
trayWidget = new XEmbedTrayItemWidget(winId, xcb_connection, display, parent);
|
||||
} else {
|
||||
trayWidget = new XEmbedTrayItemWidget(winId, nullptr, nullptr, parent);
|
||||
}
|
||||
|
||||
const TrayModel *model = qobject_cast<const TrayModel *>(index.model());
|
||||
if (model)
|
||||
connect(model, &TrayModel::requestUpdateIcon, trayWidget, &BaseTrayWidget::updateIcon);
|
||||
|
Loading…
x
Reference in New Issue
Block a user