Skip to content
Closed
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
9 changes: 5 additions & 4 deletions xcb/dxcbwmsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ void DXcbWMSupport::updateHasComposite()

xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection();

auto atom = Utility::internAtom("_NET_KDE_COMPOSITE_TOGGLING");
// _NET_KDE_COMPOSITE_TOGGLING 为 KWin 私有 atom,非 KWin 环境下原本不存在属正常情况。
// intern 后 stage1 查不到属性会自然落入 stage2 的 _NET_WM_CM_S0 selection owner 探测。
// 仅在 X 连接异常时(如会话退出期)intern 才会失败,此时 stage2 同样无意义,静默返回
auto atom = Utility::internAtom("_NET_KDE_COMPOSITE_TOGGLING", false);

if (atom == 0) {
qWarning() << "The value of atom:_NET_KDE_COMPOSITE_TOGGLING is 0 !";
if (atom == XCB_NONE)
return;
}

xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root();

Expand Down
10 changes: 9 additions & 1 deletion xcb/utility_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,18 @@ void Utility::updateMousePointForWindowMove(quint32 WId, bool finished/* = false
// 新增:支持多屏幕的版本,接受自定义全局坐标
void Utility::updateMousePointForWindowMove(quint32 WId, const QPoint &globalPos, bool finished/* = false*/)
{
// internAtom() 默认 only_if_exists=true:_DEEPIN_MOVE_UPDATE 是 deepin kwin 的私有
// atom,窗管未创建它时查询返回 XCB_NONE,此时发送 type 为 0 的 ClientMessage,
// 会被窗管转发回客户端并触发 qtbase 的 "Unhandled client message" 告警。窗管不支持
// 该协议时直接跳过。
const xcb_atom_t moveUpdateType = internAtom("_DEEPIN_MOVE_UPDATE");
if (moveUpdateType == XCB_NONE)
return;

xcb_client_message_event_t xev;

xev.response_type = XCB_CLIENT_MESSAGE;
xev.type = internAtom("_DEEPIN_MOVE_UPDATE");
xev.type = moveUpdateType;
xev.window = WId;
xev.format = 32;
xev.data.data32[0] = globalPos.x();
Expand Down
Loading