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

fix: some windows have dual title bars #622

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Nov 27, 2024

  • 使用windowhandle的close()去关闭窗口
  • DDialog和DMainWindow适配Treeland

pms: BUG-286173

@mhduiy mhduiy requested a review from 18202781743 November 27, 2024 02:25
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
@mhduiy mhduiy requested a review from FeiWang1119 November 27, 2024 02:38
18202781743
18202781743 previously approved these changes Nov 27, 2024
FeiWang1119
FeiWang1119 previously approved these changes Nov 27, 2024
@mhduiy mhduiy dismissed stale reviews from FeiWang1119 and 18202781743 via 1b7f746 November 27, 2024 03:53
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
- 使用windowhandle的close()去关闭窗口
- DDialog和DMainWindow适配Treeland

pms: BUG-286173
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 27, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

代码审查意见:

  1. dabstractdialog.cpp文件中,移除了一个匿名函数noTitlebarEnabled,这个函数被替换为DWindowManagerHelper::instance()->hasNoTitlebar()。这是一个好的做法,因为它提高了代码的可读性和可维护性。

  2. dfloatingmessage.cpp文件中,添加了对q->windowHandle()的检查,以确保在调用close()方法之前窗口句柄存在。这是一个重要的安全检查,可以防止潜在的空指针异常。

  3. dmainwindow.cppdtitlebar.cpp文件中,移除了匿名函数noTitlebarEnabled,并使用DWindowManagerHelper::instance()->hasNoTitlebar()替代。这同样提高了代码的可读性和可维护性。

  4. dtitlebar.cpp文件中,添加了_q_closeWindow私有槽函数,并在DTitlebar类中连接了d->closeButtonclicked信号到这个槽函数。这是一个好的做法,因为它将关闭窗口的逻辑封装在了一个独立的函数中,使得代码更加模块化和易于维护。

  5. dtitlebar.cpp文件中,将d->closeButtonclicked信号连接到d->targetWindow()close方法,改为连接到this_q_closeWindow槽函数。这是一个好的做法,因为它将关闭窗口的逻辑封装在了一个独立的函数中,使得代码更加模块化和易于维护。

总体来说,这些修改提高了代码的可读性、可维护性和安全性。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mhduiy
Copy link
Contributor Author

mhduiy commented Nov 27, 2024

/retest

@mhduiy mhduiy merged commit 5b338f0 into linuxdeepin:master Nov 28, 2024
19 of 21 checks passed
mhduiy pushed a commit to linuxdeepin/dtk6widget that referenced this pull request Nov 28, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants