On 07/08/2024 14:53, Alan Mackenzie wrote:
Hello, Wol.

On Tue, Aug 06, 2024 at 23:08:42 +0100, Wol wrote:
On 06/08/2024 19:31, Alan Mackenzie wrote:
So, is it possible in Wayland to record a configuration of windows,
their sizes and positions, then restore these on starting a program
again?  If not, that would appear to be a design bug in Wayland.  What
am I missing?

That - unlike X - is because windows cannot say where they are going to
go. They can *ask* where they want to go, which isn't the same thing.

How does it differ in practice?  Under what circumstances would a
request to display a window at a particular place result in it being
displayed somewhere else?

It probably doesn't make much difference most of the time. Where it particularly makes a difference is, I believe, modal windows, and windows which demand to be placed "on top".

In Windows or X, a window which demands to be placed on top of everything else will get what it asks for. And it doesn't give a monkeys about what the user is actually doing at the time.

With Wayland, if the user says "I want this window on top", then the application can't over-ride it - Wayland will force it to pop-under.

Iirc, X behaves like Windows, which means applications can *seize*
focus, which drives me up the wall on occasion at work. I'll have an
Excel macro running, which takes maybe 3 or 4 minutes. So I go into
let's say Slack. Excel triggers something (google drive?) which grabs
focus and disappears, so all of a sudden I *think* I'm gaily typing into
Slack. But focus has been stolen and I'm typing into a vacuum -
EXTREMELY frustrating, especially as I don't actually know what's going on.

I don't understand what these issues with focus have to do with
positioning a window.  Though I can appreciate them causing problems.
There would appear to be a clash between Wayland running within a
GNU/Linux running as a Windows subsystem, and the Windows itself -
presumably Windows allows a Windows application to steal focus from a
Wayland application in this situation.

In Wayland, you can't steal focus. But as a side effect, it's Wayland
that controls the window, not the application. So Wayland is more
secure, but that comes with unavoidable side effects that you don't like...

How does Wayland controling the Window lead to an application program's
inability to position it?  I can't see the connection.

Because Wayland (or rather the user, through Wayland) DICTATES what the application is allowed to do.

In practice it may not make much difference. But the user CAN tell Wayland "this space is reserved for AppA", and if AppB comes along and says "I want to put my window over AppA", Wayland will tell it to bugger off.

It's basically Wayland's security stance - if I the user *think* I am interacting with AppA, Wayland blocks AppB from taking over and tricking me into eg leaking my password. All you need is an app with a hidden window that seizes focus when it sees a password pop-up appear, and your secrets are leaked ...

Just as a bit of context; I've not yet tried Wayland, and for most of my
work (including Emacs) use a Linux console.

I've tried to switch to Wayland, but as you can tell I haven't necessarily managed it...

Cheers,
Wol

Reply via email to