Bug 463063 - KWin_x11 only shows minimize and maximize button for Qt::Dialog type window
Summary: KWin_x11 only shows minimize and maximize button for Qt::Dialog type window
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: 5.26.4
Platform: Arch Linux Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-12-15 11:10 UTC by Gary Wang
Modified: 2023-01-12 14:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Wang 2022-12-15 11:10:48 UTC
SUMMARY

KWin_x11 only shows minimize and maximize button for Qt::Dialog type window, close button was not shown.

According to Qt documentation, Qt::Dialog...

> Indicates that the widget is a window that should be decorated as a dialog (i.e., typically no maximize or minimize buttons in the title bar). This is the default type for QDialog.

So in KWin it's completely the opposite behavior.

STEPS TO REPRODUCE

1. Go to https://invent.kde.org/network/neochat/-/merge_requests/707#note_580407 and save the sample code to test.qml
2. use qml executable to show the saved qml file
3. see the result

OBSERVED RESULT

Under Plasma desktop, the dialog will have only maximize and minimize button but missing close button.

EXPECTED RESULT

Maximize and minimize button shouldn't be there and the close button should be shown.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (rolling), KDE Plasma desktop environment
KDE Plasma Version: 5.6.24
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION

Aside from the redundant maximize and minimize button issue, the missing close button issue *might* not be a kwin issue.

Please also see https://invent.kde.org/network/neochat/-/merge_requests/707#note_580407 for detailed information.

Let me know if you need any additional information.
Comment 1 Nate Graham 2023-01-04 19:33:05 UTC
Can confirm. This started happening a year or two ago IIRC.
Comment 2 Fushan Wen 2023-01-08 01:43:45 UTC
It's indeed a Qt bug. See https://codereview.qt-project.org/c/qt/qtbase/+/448355/comments/42975ff8_8945d70e for more details
Comment 3 Gary Wang 2023-01-11 13:03:53 UTC
(In reply to Fushan Wen from comment #2)
> It's indeed a Qt bug. See
> https://codereview.qt-project.org/c/qt/qtbase/+/448355/comments/
> 42975ff8_8945d70e for more details

Sorry to bother again, did you mean the redundant minimize and maximize button is an upstream Qt bug or the missing close button is upstream bug, or both are Qt bug?
Comment 4 Fushan Wen 2023-01-12 01:04:36 UTC
The missing close button is upstream bug, I don't know minimize and maximize button are redundant or not.
Comment 5 Gary Wang 2023-01-12 14:28:32 UTC
(In reply to Fushan Wen from comment #4)
> I don't know minimize and maximize button are redundant or not.

They are, as long as the Qt::Dialog documentation is correct:

> Indicates that the widget is a window that should be decorated as a dialog
> (i.e., typically no maximize or minimize buttons in the title bar).
> This is the default type for QDialog.

I created a separated bug report for this issue so hopefully we can track the issue there:

https://bugs.kde.org/show_bug.cgi?id=464193