Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway/workspaces window-rewrite does not support Xwayland #3020

Closed
mliszcz opened this issue Mar 17, 2024 · 5 comments · Fixed by #3801
Closed

sway/workspaces window-rewrite does not support Xwayland #3020

mliszcz opened this issue Mar 17, 2024 · 5 comments · Fixed by #3801

Comments

@mliszcz
Copy link

mliszcz commented Mar 17, 2024

It is not possible to map X11 applications to icons using the window-rewrite mechanism. The implementation currently checks only for the app_id to match against the <class> pattern.

std::string windowClass = node["app_id"].asString();

Sway does not provide this for X11 applications running with Xwayland. Instead we could use node["window_properties"]["class"] and node["window_properties"]["instance"] to determine the application.

I could send a PR if it would be accepted, but I'm not sure what would be the preferred way to solve this.

  • for example: <class> could fall back to checking window_properties.class if app_id is not provided,
  • or we could add new patterns like <x11class> (also it would be best to rename <class> to <app_id> to avoid any confusion but I guess it must stay for backwards compatibility).
@alxdb
Copy link

alxdb commented May 18, 2024

Having this same issue and would also be interested in a fix. Can help contribute if I find the time

@euglevi
Copy link

euglevi commented Oct 4, 2024

I think this fix would be very useful. Sorry that I do not know enough about coding to help.

@cobbles
Copy link

cobbles commented Nov 3, 2024

Am also running into this problem, and for me it is not picking up the window-rewrite-default as the fallback so the impact is it looks like no windows are open on the workspace.

For me the application that does not show an icon is Code - OSS

output from get_tree:

➜ ~ swaymsg -t get_tree
    #6: workspace "2"
      #16: con "config - .dotfiles - Code - OSS" (xwayland, pid: 6049, instance: "code-oss", class: "code-oss", X11 window: 0x400004)
      #14: con "swaymsg -t get_tree" (xdg_shell, pid: 4348, app_id: "Alacritty")

@euglevi
Copy link

euglevi commented Nov 5, 2024

For those who are interested, the workaround at the moment for me is using utilities that wrap around waybar to correctly show all icons. More specifically, I am using Sworkstyle.

@cobbles
Copy link

cobbles commented Nov 5, 2024

Thankyou @euglevi will take a look at this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants