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

xwayland: populate window_properties in json for views #2933

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

Snaipe
Copy link
Contributor

@Snaipe Snaipe commented Oct 22, 2018

window_properties is documented to contain a subset of the X11 properties
of a window (its title, class, instance, role, and transient ID). This
commit adds the missing json object from the get_tree output for
xwayland windows only.

This is a follow-up of #2911.

Signed-off-by: Franklin "Snaipe" Mathieu me@snai.pe

@Snaipe Snaipe changed the title rxwayland: populate window_properties in json for views xwayland: populate window_properties in json for views Oct 22, 2018
@Snaipe
Copy link
Contributor Author

Snaipe commented Oct 22, 2018

(paging interested parties from the other PR: @ianyfan @RyanDwyer @progandy)

@RyanDwyer
Copy link
Member

Does this match i3's output? It's weird for the title to be in the window properties, as it's probably also in the outer element.

Maybe you could have window_properties regardless of whether it's Xwayland or not, and for Wayland list the app id, and for Xwayland keep it as you currently have it.

@Snaipe
Copy link
Contributor Author

Snaipe commented Oct 22, 2018

Does this match i3's output? It's weird for the title to be in the window properties, as it's probably also in the outer element.

Yes. It's a bit weird, but I looked at both the output from an i3 session I ran from my laptop, and the current bleeding ipc docs, and they seem to document that now. I'm guessing they wanted to bundle a subset of x11 window properties at the same place?

Out of that lot, the only element I didn't provide the definitions for is transient_for, which seems to be the ID of a window transient to the current view, but I'm both unsure if this is right, and looking through the wlroots codebase there doesn't seem to be an easy way to find that information right now.

Maybe you could have window_properties regardless of whether it's Xwayland or not, and for Wayland list the app id, and for Xwayland keep it as you currently have it.

That would be a bit weird, wouldn't it? It really looks like that map was made for X11 properties, so it does seem to be somewhat not relevant for native wayland windows. I don't see a real benefit in duplicating app_id in there, considering it's a sway-specific field.

@RyanDwyer
Copy link
Member

Okay, I didn't realise the app ID was already included. I'm happy to leave that as is and keep window_properties for Xwayland windows only.

You should be able to get the transient ID using c->view->wlr_xwayland_surface->parent->window_id, keeping in mind that parent may be NULL.

window_properties is documented to contain a subset of the X11 properties
of a window (its title, class, instance, role, and transient ID). This
commit adds the missing json object from the get_tree output for
xwayland windows only.

This is a follow-up of swaywm#2911.

Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
@Snaipe
Copy link
Contributor Author

Snaipe commented Oct 23, 2018

Thanks for the pointer. I checked on i3 and I can confirm that transient_for is the ID of the parent window. I updated the commit with the transient_for key, and the output matches i3's.

@ddevault ddevault merged commit bdb1768 into swaywm:master Oct 23, 2018
@ddevault
Copy link
Contributor

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants