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 13658cf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/widgets/darrowrectangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ QPainterPath DArrowRectanglePrivate::getLeftCornerPath()
border.arcTo(bottomRight.x() - 2 * radius, bottomRight.y() - 2 * radius, 2 * radius, 2 * radius, 0, -90);

if (radiusArrowStyleEnable) {
border.lineTo(bottomLeft.x() + arrowWidth, bottomLeft.y());
border.lineTo(bottomLeft.x() + radius, bottomLeft.y());
border.arcTo(bottomLeft.x(), bottomLeft.y() - widgetRadius, widgetRadius, widgetRadius, -90, -90);
border.lineTo(bottomLeft.x(), cornerPoint.y() + m_arrowWidth / 2 + radius / 2);

Expand All @@ -818,9 +818,11 @@ QPainterPath DArrowRectanglePrivate::getLeftCornerPath()

border.lineTo(topLeft.x(), cornerPoint.y() - m_arrowWidth / 2 - radius / 2);
border.arcTo(topLeft.x(), topLeft.y(), widgetRadius, widgetRadius, -180, -90);

border.lineTo(topLeft.x() + radius, topLeft.y());
} else {
if (leftRightRadius) {
border.lineTo(bottomLeft.x() + arrowWidth, bottomLeft.y());
border.lineTo(bottomLeft.x() + radius, bottomLeft.y());
border.arcTo(bottomLeft.x(), bottomLeft.y() - widgetRadius, widgetRadius, widgetRadius, -90, -90);
border.lineTo(bottomLeft.x(), cornerPoint.y() + m_arrowWidth / 2);
} else {
Expand Down Expand Up @@ -900,6 +902,8 @@ QPainterPath DArrowRectanglePrivate::getRightCornerPath()

border.lineTo(bottomRight.x(), cornerPoint.y() + m_arrowWidth / 2 + radius / 2);
border.arcTo(bottomRight.x() - widgetRadius, bottomRight.y() - widgetRadius, widgetRadius, widgetRadius, 0, -90);

border.lineTo(bottomRight.x() - radius, bottomRight.y());
} else {
if (leftRightRadius) {
border.lineTo(topRight.x() - radius, topRight.y());
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dlicensedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DLicenseDialogPrivate::DLicenseDialogPrivate(DLicenseDialog *qq)
: DAbstractDialogPrivate(qq)
, backwardBtn(new DIconButton(QStyle::SP_ArrowBack))
, listView(new DListView)
, listModel(new QStandardItemModel)
, listModel(new QStandardItemModel(listView))
, stackedLayout(new QStackedLayout)
, componentNameLabel(new QLabel)
, componentVersionLabel(new QLabel)
Expand Down
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 13658cf

Please sign in to comment.