Skip to content

X11 window manager is not detected when XDG_SESSION_TYPE is incorrect #165

@Absolpega

Description

@Absolpega

I was just setting up a testing setup to try and fix #9.
I am on hyprland.
I have a Xephyr x session opened as display :3.
I ran DISPLAY=:3 awesome to run the wm.
Then I ran DISPLAY=:3 env -u WAYLAND_DISPLAY alacritty to get a terminal in the x session
but when I ran my fetch no wm was detected.

In the libmacchina code when deciding if to check for X11 or Wayland the XDG_SESSION_TYPE env variable is used.
This was still set to wayland so it ran detect_wayland_window_manager() which obviously failed on x11.

This could be prevented by doing detect_wayland_window_manager().or_else(|_| detect_xorg_window_manager()).
But that sounds like a very lazy and incomplete solution.

I just tried to run a regular x session with startx but XDG_SESSION_TYPE was now set to tty creating the same problem.

I don't think we should be relying on XDG_SESSION_TYPE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions