Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: from linuxdeepin/dtkwidget #8

Merged
merged 1 commit into from
Nov 29, 2023
Merged
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
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
Loading