Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#535
  • Loading branch information
deepin-ci-robot committed Nov 13, 2023
1 parent 50bd273 commit 260a478
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,22 @@ StartupNotificationMonitor::StartupNotificationMonitor() :
return;

int screen = 0;

xcb_screen_t *s = xcb_aux_get_screen (QX11Info::connection(), screen);
const uint32_t select_input_val[] = { XCB_EVENT_MASK_PROPERTY_CHANGE };
xcb_change_window_attributes (QX11Info::connection(), s->root, XCB_CW_EVENT_MASK,
select_input_val);
xcb_get_window_attributes_cookie_t attr_cookie = xcb_get_window_attributes (QX11Info::connection(), s->root);
xcb_get_window_attributes_reply_t *attr_reply = xcb_get_window_attributes_reply (QX11Info::connection(), attr_cookie, NULL);

if (attr_reply) {
uint32_t old_event_mask = attr_reply->your_event_mask;
if (!(old_event_mask & XCB_EVENT_MASK_PROPERTY_CHANGE)) {
const uint32_t select_input_val[] = { XCB_EVENT_MASK_PROPERTY_CHANGE | old_event_mask };

xcb_change_window_attributes (QX11Info::connection(), s->root, XCB_CW_EVENT_MASK,
select_input_val);
}
free(attr_reply);
} else {
qWarning() << "can not get xcb window attributes reply";
}

display = sn_xcb_display_new (QX11Info::connection(), NULL, NULL);

Expand Down

0 comments on commit 260a478

Please sign in to comment.