繁体   English   中英

在 Wayland 上禁用客户端装饰 (CSD)

[英]Disable client side decorations (CSD) on Wayland

我正在使用 Wayland Compositor,我需要为 Qt 和 Gtk 客户端应用程序禁用 CSD。

我可以使用任何环境变量来做到这一点吗?

我一直在寻找没有运气!

对于 Qt,您可以设置QT_WAYLAND_DISABLE_WINDOWDECORATION=1

2021 年更新(仅与合成器开发相关):

现在还有一个用于协商窗口装饰的官方协议扩展,称为xdg-decoration ,因此如果您正在使用合成器,您可以实现它并确保发送带有server_sideconfigure事件:

    <event name="configure">
      <description summary="suggest a surface change">
        The configure event asks the client to change its decoration mode. The
        configured state should not be applied immediately. Clients must send an
        ack_configure in response to this event. See xdg_surface.configure and
        xdg_surface.ack_configure for details.

        A configure event can be sent at any time. The specified mode must be
        obeyed by the client.
      </description>
      <arg name="mode" type="uint" enum="mode" summary="the decoration mode"/>
    </event>

这将是实现它的标准化和简洁的方式,但请注意,工具包可以自由地不实现此扩展,因此不能保证您将能够使用它。

如果您使用的是 Qt Wayland Compositor API,文档在此处

Qt 客户端实现并遵守它和其他一些工具包,但我认为 GTK 不会。 不过,看起来他们实施了由 KDE 开发的非官方扩展,所以如果您真的想摆脱 GTK 上的装饰,也可以考虑实施服务器装饰

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM