Hacker News new | ask | show | jobs
by thesuitonym 9 days ago
Look, I'm not a Wayland booster, I still prefer X11 most of the time, but this is really the way it should work. Applications should not be allowed to dictate how windows appear. That is the job of the window manager. Chrome's PIP is a stupid workaround for Windows and Mac because they do not have robust window management.
3 comments

This is the issue with imposing semantics of the programming model on the behaviour.

User behaviour is the only _real_ thing, it happens. Everything else is in your head. If people in the real world use PiP, then it should happen. The programming model has to bend and change to support it. It simply does not matter if the window manager does something or the window does something.

Sure, there is always the security argument wayland folks fall back to. But what ever is the problem with making a one-time permission popup? "Google Chrome wants to open in PiP: allow | allow once.". Just expose the existing PiP code in the window manager as an API guarded with an `if` that apps can call. It's not even that much real work, just pure bikeshedding and architecture astronauting.

Permission prompts still only allow things that have already been thought of so we will see less innovation in the future. I don't think this kind of security model is needed at all for an open source desktop where we can enforce directly that programs respect the user instead.
Right right, and I'm not saying users shouldn't be able to have a floating window with video (or whatever) in it. I'm saying it shouldn't be Chrome making that window floating and always visible.
That expectation is really an immediate major UX defect. Most really good GUIs rely on tons and tons of subtle behaviors to work right (that is, to assist the user). That means - counterintuitively - that they need a lot of leeway in how they get to control their own windows to appear on the screen.

Ultimately, the screen is just an unbroken flat surface and windows are just a software level abstraction that has been tortured beyond hope and one that users shouldn't have to micromanage or understand deeply.

If an application needs something to appear at a specific spot in a specific way, the display manager needs to bend over backwards to make it happen or it's broken. Windows understands it. MacOS understands it. X11 understand it, but the community is working hard to throw that wisdom away.

Finally a sane answer
I don't get it, if you're on google meet, and you want to make one of many videos PiP. How can you ever do that in the window manager? It has to be done in the application! You right click or click on the menu on that particular video, and click Picture in picture.

How the heck can the window manager do it?

The application could tell the window manager it wanted an always on top window. The window manager could ask the user if it should allow or reject and remember for this application or not.
That's exactly what I said... and also not how wayland works.

I cannot comprehend the way wayland folks think... quote from the xdg-pip discussion:

> To not make PiP windows effectively "always on top" and "on every workspace" dialogs - a terrible and sadly by applications used concept on X11 - PiP windows must be input-only, i.e. not receive keyboard, pointer and touch input

Like what the heck even? That is how pip windows are expected to work? And of course you want inputs on them? e.g to mute/unmute on a video call? Like these are use cases used daily by people. And its "terrible".

I also don't get it with the wayland people. It feels like they want to revert everything to a UX design that was getting old in the 90s.
If things were designed well, it would be as easy as clicking the pin icon on the window border.
How many buttons do you want on a window frame then? The typical 4 buttons already take a lot of space in the title bar. Not everything that seems like a good idea at first glance is actually good design.
I don't know man, everybody is fine with putting tabs, and searchbars, and a bunch of other shit in the titlebar, but god forbid we put one button that's actually incredibly useful.
I've fucking had it with you people and your "design"

As many buttons as he thinks he needs, and as a compromise they can be disabled by default and enabled through settings. Instead your ilk will probably remove even those remaining buttons and replace them with some obscure movement command

That's what I have in my setup, six titlebar buttons: send to other screen, sticky among workspaces and always on top in addition to the base 3. Can't imagine ever using something that gives me less control again.
The job of the window manager is to manage windows if the user wants it to do that. However there's many situations in which users want the application to be in charge of window positioning.

Making a decision on the user's behalf doesn't sound very free to me.

>> Chrome's PIP is a stupid workaround for Windows and Mac because they do not have robust window management.

What are you talking about? It's very convenient when I watch video while I do some work or entertaining thing on other web page or app. It's fine if you don't want to use it but many people do.

Yes, it's fine, but it shouldn't be necessary. If Windows and Mac OS just had native support for always-on-top windows, you wouldn't need it.
I actually prefer macOS's PiP handling compared to other operating systems. In that it's a blessed concept that only goes to one corner of the screen and can be shunted out of the way easily.
Now imagine if that was designed properly, and you could just do that to any window, regardless of what the program thinks it should look like.
I use pinned (always above + on all workspace/desktop) quite often.

And to make it ergonomic I scripted kwin and set some shortcuts.

So yes, you can have any window PiP the way you like. But it requires you to do a long sequence of actions. Versus a single click for very specific PiP behavior.

Consider a window in a web browser tab. You could click the PiP button, which will pop out a tiny window, most likely already in a corner of the screen. This window is a mini video player. Your original browser tab stays untoucher, still at the same place in your web browser tab list, the rest of the tab still readable and scrollable etc etc.

Or, you could clone the tab. Move it to its own window. Locate the video. Put it in full screen. Un-fullscreen the window. Click on the pin button. Resize the window to the corner.

Same result, but not the same effort.

Windows has had native support for always on top windows for over 25 years