6

I know Wayland protocol doesn't provide option to control shell surface position on the screen. I would like to find a way for controlling window/surface placement. I have tried tools like xdotool and wmctrl, but they only recognize XWayland windows. I am using Gnome Shell so the window manager is Mutter. Why is surface location not part of Wayland protocol? What would be the suggested way or ways for controlling Wayland surface placement programmatically?

Edit:

Wayland client-protocol provides interface for sub-surfaces and it is sufficient for my purposes at the moment. However window I would hope protocol to include top-level window position option. I could make gnome-shell extension with, javascript? But not really an option in this case.

3
  • I need the same information. For example, I cannot get title of nautilus, system monitor, video player, etc while they are active on the screen. If somebody knows or you have found the solution please share it here. Thanks in advance. Commented Oct 14, 2017 at 21:11
  • @Martin are you working with compositor-side or with client-side. At the moment I am working only the client-side. Commented Oct 20, 2017 at 18:45
  • I'm working on client-side. FYI, I want to record my activities and I was successful but some applications are not recorded using xdotool. I don't know if the xlib can do it for me to use it. I doubt it. Commented Oct 21, 2017 at 19:21

1 Answer 1

0

Why is surface location not part of Wayland protocol?

Individual clients don't have permissions to become window managers and arbitrarily position windows on-screen. Positioning of windows is compositor policy, and (frequently) up to the user.

The main rationale here is that arbitrary programs shouldn't be able to control the layout of the entire desktop session.

What would be the suggested way or ways for controlling Wayland surface placement programmatically?

Different solutions are being discussed for different use cases, but it's hard to provide an exact solution without knowing what you're trying to do.

If you're writing a program that arranges the position of windows on-screen, then the wlr_foreign_toplevel_management_unstable_v1 protocol extension might be what you're looking for. At this time, it is mostly supported by wlroots compositors, it is not fully standardised and not supported by GNOME.

If you're writing a program with multiple windows where you want them in specific relative positions to one another, then the ext-zones-v1 protocol extension will be of interest to you. I say "will be" because it's not standardised yet, so you can't really use it.

If you're writing a statusbar that must be positioned on the left border, or want a bar on the right hand side with some custom content, you want to use the wlr-layer-shell-unstable-v1 protocol. At this time, it is only supported by wlroots and KDE compositors. It is in the process of being standardised as ext-layer-shell.

Some compositors provide a custom API to implement custom window managers and similar program which control window positions and desktop layout.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.