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

Strategy for supporting _NET_WM_WINDOW_TYPE_DESKTOP #1474

Open
johanmalm opened this issue Jan 24, 2024 · 3 comments
Open

Strategy for supporting _NET_WM_WINDOW_TYPE_DESKTOP #1474

johanmalm opened this issue Jan 24, 2024 · 3 comments

Comments

@johanmalm
Copy link
Collaborator

johanmalm commented Jan 24, 2024

...and other net-wm-window-type atoms not already covered by wlroots.

Ref:

Assuming we merge #1185, how would we actually implement support for something like _NET_WM_WINDOW_TYPE_DESKTOP.

Looking at the window-rules for pcmanfm-qt --desktop running in Wayland mode, we would need to consider

  • <skipTaskbar>
  • <skipWindowSwitcher>
  • <fixedPosition>
  • <action name="ToggleAlwaysOnBottom"/>

Action like ToggleAlwaysOnBottom could be processed in xwayland.c's handle_set_window_type() (introduced by #1185), but properties like fixedPosition would have to be checked for in the same positions where we currently do window_rules_get_property(), with the exception of some things which could be taken care of in xwayland_view_wants_focus().

Considering the amount of window-rule checks (see below), I think it would be ugly to add xwayland_surface_contains_window_type() the #if HAVE_XWAYLAND guards in all those places.

git grep window_rules_get_property:

src/desktop.c:          enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
src/interactive.c:      if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE
src/view-impl-common.c: enum property ret = window_rules_get_property(view, "skipTaskbar");
src/view.c:             if (window_rules_get_property(view, "skipWindowSwitcher") == LAB_PROP_TRUE) {
src/view.c:     if (window_rules_get_property(view, "fixedPosition") == LAB_PROP_TRUE
src/xdg.c:      switch (window_rules_get_property(view, "serverDecoration")) {
src/xdg.c:      if (window_rules_get_property(view, "ignoreFocusRequest") == LAB_PROP_TRUE) {
src/xwayland.c: switch (window_rules_get_property(view, "serverDecoration")) {
src/xwayland.c: if (window_rules_get_property(view, "ignoreFocusRequest") == LAB_PROP_TRUE) {

So, how do we do it?

@Consolatis and I brainstormed a bit on IRC and thought we might be able to extend the window-rule criteria to accept a wlr_surface rather than identifier, etc. and just add window rules for properties in the set_type handler? If that works, it would potentially be quite neat and self-contained within xwayland.c We'd probably have to deal with set_type()s happening after map().

Cc: @jlindgren90 @Consolatis @grisha128

@grisha128
Copy link

@Consolatis and I brainstormed a bit on IRC and thought we might be able to extend the window-rule criteria to accept a wlr_surface rather than identifier, etc. and just add window rules for properties in the set_type handler? If that works, it would potentially be quite neat and self-contained within xwayland.c We'd probably have to deal with set_type()s happening after map().

I like the idea but removing identifier altogether can cut off potentially useful functionality. I think it'd be better to keep it.

Also the name wlr_surface for attribute in windowRule element is too technical if you ask me - I think it will be more convenient to configure it as type (e.g. <windowRule type="desktop">...</windowRule>).

@Consolatis
Copy link
Member

Consolatis commented Jan 24, 2024

@Consolatis and I brainstormed a bit on IRC and thought we might be able to extend the window-rule criteria to accept a wlr_surface rather than identifier, etc. and just add window rules for properties in the set_type handler? If that works, it would potentially be quite neat and self-contained within xwayland.c We'd probably have to deal with set_type()s happening after map().

I like the idea but removing identifier altogether can cut off potentially useful functionality. I think it'd be better to keep it.

Also the name wlr_surface for attribute in windowRule element is too technical if you ask me - I think it will be more convenient to configure it as type (e.g. <windowRule type="desktop">...</windowRule>).

Those would be internal rules that are created automatically based on the xwayland window type. So there is no change in regards to the user supplied window rules exposed via rc.xml.

@jlindgren90
Copy link
Contributor

@Consolatis and I brainstormed a bit on IRC and thought we might be able to extend the window-rule criteria to accept a wlr_surface rather than identifier, etc. and just add window rules for properties in the set_type handler?

I can't quite wrap my head around this tonight, but it sounds good anyway :) I'm looking forward to seeing this implemented, even if all I can lend is "moral support" right now.

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

No branches or pull requests

4 participants