Linux 上的无边框窗口

发布于 2024-08-14 06:13:36 字数 132 浏览 13 评论 0原文

它们是在 Linux 上使特定窗口无边框的标准方法吗?我相信窗口边框是由您的窗口管理器绘制的,所以可能我只需要使用特定的窗口管理器(可以找到,我只需要知道是哪个)...我的希望是所有窗口管理器都可能遵循一些标准,允许我以编程方式执行此操作......

Is their a standard way to make a particular window borderless on Linux? I believe that the window border is drawn by your window manager, so it may be that I just need to use a particular window manager (that would be find, I'd just need to know which one)... My hope is that all the window managers might follow some standard that allows me to do this programatically...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

标点 2024-08-21 06:13:36

使用 Xlib 和旧的 _MOTIF_WM_HINTS

struct MwmHints {
    unsigned long flags;
    unsigned long functions;
    unsigned long decorations;
    long input_mode;
    unsigned long status;
};
enum {
    MWM_HINTS_FUNCTIONS = (1L << 0),
    MWM_HINTS_DECORATIONS =  (1L << 1),

    MWM_FUNC_ALL = (1L << 0),
    MWM_FUNC_RESIZE = (1L << 1),
    MWM_FUNC_MOVE = (1L << 2),
    MWM_FUNC_MINIMIZE = (1L << 3),
    MWM_FUNC_MAXIMIZE = (1L << 4),
    MWM_FUNC_CLOSE = (1L << 5)
};

Atom mwmHintsProperty = XInternAtom(display, "_MOTIF_WM_HINTS", 0);
struct MwmHints hints;
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = 0;
XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32,
        PropModeReplace, (unsigned char *)&hints, 5);

现在 NetWM/EWMH 提示 是首选,但据我所知所有现代窗口管理器仍然支持这一点。

Using Xlib and old _MOTIF_WM_HINTS:

struct MwmHints {
    unsigned long flags;
    unsigned long functions;
    unsigned long decorations;
    long input_mode;
    unsigned long status;
};
enum {
    MWM_HINTS_FUNCTIONS = (1L << 0),
    MWM_HINTS_DECORATIONS =  (1L << 1),

    MWM_FUNC_ALL = (1L << 0),
    MWM_FUNC_RESIZE = (1L << 1),
    MWM_FUNC_MOVE = (1L << 2),
    MWM_FUNC_MINIMIZE = (1L << 3),
    MWM_FUNC_MAXIMIZE = (1L << 4),
    MWM_FUNC_CLOSE = (1L << 5)
};

Atom mwmHintsProperty = XInternAtom(display, "_MOTIF_WM_HINTS", 0);
struct MwmHints hints;
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = 0;
XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32,
        PropModeReplace, (unsigned char *)&hints, 5);

These days NetWM/EWMH hints are preferred, but as far as I know all modern window managers still support this.

拥有 2024-08-21 06:13:36

使用 GTK+,您可以调用 gtk_window_set_decorated( )

With GTK+ you can call gtk_window_set_decorated().

酒解孤独 2024-08-21 06:13:36

在悲伤地告别 Compiz“窗口规则”后,我发现
devilspie

对于那些想要精确控制窗口出现时的行为的怪胎和怪人来说,这是一个完全充满漏洞的程序。如果您希望所有 XChat 窗口都位于桌面 3 的左下角,透明度为 40%,您可以这样做。

我用它在我的桌面上建立了一个无边框、粘性、任务跳过的终端。

还有一个 devilspie 2,它使用 Lua 而不是 s 表达式,并声称可以更好地维护。

https://live.gnome.org/DevilsPie
http://www.burtonini.com/blog/computers/devilspie

After a sad farewell to Compiz "window rules" I found
devilspie

A totally crack-ridden program for freaks and weirdos who want precise control over what windows do when they appear. If you want all XChat windows to be on desktop 3, in the lower-left, at 40% transparency, you can do it.

I use it to have a borderless, sticky, task-skipped terminal on my desktop.

There's also a devilspie 2 which uses Lua instead of s-expressions and claims to be better maintained.

https://live.gnome.org/DevilsPie
http://www.burtonini.com/blog/computers/devilspie

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文