<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QDialog minimize and maximize buttons on Wayland]]></title><description><![CDATA[<p dir="auto">I have a class that inherits from QDialog and the constructor looks like this:</p>
<pre><code>InfoPopup::InfoPopup(QMainWindow *parent, Info *info) : QDialog(parent), m_info(info)
{
   setWindowFlags(windowFlags() &amp; ~Qt::WindowMinMaxButtonsHint);
   setWindowFlags(windowFlags() &amp; ~Qt::WindowContextHelpButtonHint);
   setAttribute(Qt::WA_DeleteOnClose);
   setWindowTitle(info-&gt;name());

   ...

   show();
   raise();
}
</code></pre>
<p dir="auto">As expected, on both Windows and Liniux/X11 I get a dialog with a title bar and a close button but no minimise or maximise buttons.  However on Linux/Wayland I get both minimise and maximise buttons too.<br />
I have read elsewhere that it's necessary to set the Qt::CustomizeWindowHint flag in order to customise the window so I tried that but it made no difference.  I also saw an example (from a question based on an earlier version of Qt) where a QWidget was being used directly as a Window so I tried inheriting from QWidget as follows:</p>
<pre><code>InfoPopup::InfoPopup(QMainWindow *parent, Info *info) : QWidget(parent), m_info(info)
{
   setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
   setAttribute(Qt::WA_DeleteOnClose);
   setWindowTitle(info-&gt;name());

   ...

   show();
   raise();
}
</code></pre>
<p dir="auto">Again, it works as expected on Windows but I still get minimise and maximise buttons on Wayland.  In fact on Wayland I also get a title bar and a close button even if I don't specify Qt::WindowTitleHint and Qt::WindowCloseButtonHint respectively whereas on Windows I need to specify them.<br />
I appreciate that just because it works fine on Windows and X11 doesn't <em>necessarily</em> mean that it was correct but I've tried various other combinations of flags on Wayland and nothing I've found gets rid of the minimise and maximise buttons.  Does Wayland just ignore setWindowFlags?  Is there anything I can do to get rid of the minimise and maximise buttons on Wayland?</p>
<p dir="auto">In case it has any bearing I'm using Ubuntu 26.04 with Qt 6.12.0 and GCC x86 (64-bit).</p>
]]></description><link>https://forum.qt.io/topic/165209/qdialog-minimize-and-maximize-buttons-on-wayland</link><generator>RSS for Node</generator><lastBuildDate>Wed, 28 Oct 2026 09:52:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/165209.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Oct 2026 20:09:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Tue, 27 Oct 2026 03:10:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sifox">@<bdi>SiFox</bdi></a> said in <a href="/post/840605">QDialog minimize and maximize buttons on Wayland</a>:</p>
<blockquote>
<p dir="auto">As far as I'm aware I'm using whatever standard compositor is installed with Ubuntu 26.04. I did a brief search to try to figure out if there's a way to determine what compositor is in use but couldn't find anything definitive.</p>
</blockquote>
<p dir="auto">Yes, so that would be GNOME with its' standard compositor "Mutter".  The environment variable <code>XDG_SESSION_DESKTOP</code> can confirm that.</p>
<p dir="auto">The main thing to understand about Wayland, that it is just a protocol, and a very bare-bones one at that. Each compositor has to (mostly) independently implement everything from scratch. There are multiple extension protocols, but again each compositor implements a different set of them. This is unlike in the X11 days, in which X was both a protocol but also a common server implementation that handled all the basic stuff in a uniform way and only delegated window handling to a WM. So you can't really target "Wayland" - you need to target GNOME on Wayland, KDE on Wayland, COSMIC, etc... (Qt does a mostly satisfactory job on hiding that).</p>
<p dir="auto">According to your screenshot, you are using the Adwaita client-side window decorations plugin shipped with Qt. Mutter - on purpose - does not support the extensions that allow the compositor to draw decorations for client applications, and never sees your hints. GNOME requires applications to draw their own decorations.</p>
<p dir="auto">From a quick look, Qt's Adwaita-style window decorations don't have any code to check if the window is maximize-able or not. I don't know if it was purposefully left out or is just an oversight. Perhaps you can file a ticket in the Qt issue tracker to ask.</p>
<p dir="auto">You can try switching to the "bardient" decorations plugin by setting the environment variable <code>QT_WAYLAND_DECORATION</code> to the value <code>bradient</code>.</p>
]]></description><link>https://forum.qt.io/post/840606</link><guid isPermaLink="true">https://forum.qt.io/post/840606</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:10:36 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Wed, 28 Oct 2026 08:00:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sifox">@<bdi>SiFox</bdi></a> hi,</p>
<p dir="auto">Please post a link to that ticket so it's easier for other people having the same issue to find it :-)</p>
]]></description><link>https://forum.qt.io/post/840623</link><guid isPermaLink="true">https://forum.qt.io/post/840623</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 28 Oct 2026 08:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Tue, 27 Oct 2026 23:39:36 GMT]]></title><description><![CDATA[<p dir="auto">Hi IgKh.<br />
Your proposed solution of setting QT_WAYLAND_DECORATION to bradient solves my problem and gives me control over the presence or absence of the maximise and minimise buttons.  I would prefer it if Adwaita respected those choices because then my window decorations would be consistent with other Gnome desktop applications so I'll raise a ticket as you suggest and see what happens.<br />
Thank you so much for your help!</p>
]]></description><link>https://forum.qt.io/post/840618</link><guid isPermaLink="true">https://forum.qt.io/post/840618</guid><dc:creator><![CDATA[SiFox]]></dc:creator><pubDate>Tue, 27 Oct 2026 23:39:36 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Tue, 27 Oct 2026 03:10:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sifox">@<bdi>SiFox</bdi></a> said in <a href="/post/840605">QDialog minimize and maximize buttons on Wayland</a>:</p>
<blockquote>
<p dir="auto">As far as I'm aware I'm using whatever standard compositor is installed with Ubuntu 26.04. I did a brief search to try to figure out if there's a way to determine what compositor is in use but couldn't find anything definitive.</p>
</blockquote>
<p dir="auto">Yes, so that would be GNOME with its' standard compositor "Mutter".  The environment variable <code>XDG_SESSION_DESKTOP</code> can confirm that.</p>
<p dir="auto">The main thing to understand about Wayland, that it is just a protocol, and a very bare-bones one at that. Each compositor has to (mostly) independently implement everything from scratch. There are multiple extension protocols, but again each compositor implements a different set of them. This is unlike in the X11 days, in which X was both a protocol but also a common server implementation that handled all the basic stuff in a uniform way and only delegated window handling to a WM. So you can't really target "Wayland" - you need to target GNOME on Wayland, KDE on Wayland, COSMIC, etc... (Qt does a mostly satisfactory job on hiding that).</p>
<p dir="auto">According to your screenshot, you are using the Adwaita client-side window decorations plugin shipped with Qt. Mutter - on purpose - does not support the extensions that allow the compositor to draw decorations for client applications, and never sees your hints. GNOME requires applications to draw their own decorations.</p>
<p dir="auto">From a quick look, Qt's Adwaita-style window decorations don't have any code to check if the window is maximize-able or not. I don't know if it was purposefully left out or is just an oversight. Perhaps you can file a ticket in the Qt issue tracker to ask.</p>
<p dir="auto">You can try switching to the "bardient" decorations plugin by setting the environment variable <code>QT_WAYLAND_DECORATION</code> to the value <code>bradient</code>.</p>
]]></description><link>https://forum.qt.io/post/840606</link><guid isPermaLink="true">https://forum.qt.io/post/840606</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Tue, 27 Oct 2026 03:10:36 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Mon, 26 Oct 2026 22:39:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi IgKh.  Thanks for the response.</p>
<p dir="auto">As far as I'm aware I'm using whatever standard compositor is installed with Ubuntu 26.04.  I did a brief search to try to figure out if there's a way to determine what compositor is in use but couldn't find anything definitive.  You said a screenshot should make it clear - assuming you meant a screenshot of my application, here's the window in question.  What looks like a capital I in the title bar is all that can be seen of my window title obscured by the unwanted buttons.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/0f8528c6-291b-47e9-8e1b-cac9d5738d93.png" alt="Screenshot From 2026-10-26 22-21-38.png" class=" img-fluid img-markdown" /><br />
I also tried grepping for "comp" in the output from wayland-info and I got the following results:</p>
<pre><code>interface: 'wl_compositor'      version:   6, name:   1
interface: 'wl_subcompositor'   version:   1, name:   8
</code></pre>
<p dir="auto">but I'm not really sure if that's a definitive list because it seems that many of the Wayland compositors have names which don't contain the word "Compositor" anyway so I'm not really sure what I'm looking for.  I haven't knowingly installed any compositors but something else that I've installed may have done of course.</p>
<p dir="auto">Sorry if I'm missing something obvious or have misunderstood your response - I've been writing software with Qt on Linux for almost 20 years but I'm really struggling to get my head around Wayland and every time I think I'm starting to get my head around it I read something that makes me question everything I thought I understood :-(</p>
]]></description><link>https://forum.qt.io/post/840605</link><guid isPermaLink="true">https://forum.qt.io/post/840605</guid><dc:creator><![CDATA[SiFox]]></dc:creator><pubDate>Mon, 26 Oct 2026 22:39:23 GMT</pubDate></item><item><title><![CDATA[Reply to QDialog minimize and maximize buttons on Wayland on Mon, 26 Oct 2026 16:56:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/sifox">@<bdi>SiFox</bdi></a>, welcome to the forum.</p>
<p dir="auto">Wayland is not a single "thing", it depends heavily on which compositor you are running under, as especially if the window decorations are drawn by the compositor or by Qt itself (SSDs vs CSDs). A screenshot should make it clear, if you can't tell by yourself.</p>
]]></description><link>https://forum.qt.io/post/840603</link><guid isPermaLink="true">https://forum.qt.io/post/840603</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Mon, 26 Oct 2026 16:56:55 GMT</pubDate></item></channel></rss>