YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
3.7k stars 109 forks source link

Floating window layer #122

Open YaLTeR opened 8 months ago

YaLTeR commented 8 months ago

I'm thinking always on top, in global coordinate space, similar to the mouse cursor.

superiums commented 8 months ago

i think this is thinkable.

we need floating window in wm , because we need to see some window always fixed, instead of scroll away or disappeared.

add one floating layer , is one solution. but i think there is another:

window who has this property, always display at the same position while scrolling.

and we could have these two type of fix/sticky:

maybe this is more simple than floating layer in coding.

using examples

YaLTeR commented 8 months ago

For sticky in workspace there's a curious suggestion in https://github.com/YaLTeR/niri/discussions/149. For globally sticky, that's how I imagine the floating layer to work in niri. Thanks for the examples, they will be good to keep in mind.

FreeFull commented 8 months ago

A global, floating layer would be really useful for Firefox's Picture in Picture video, and other similar things.

jgregoire commented 7 months ago

I'm not sure if this is possible, but I would love to see two features:

  1. New/independent floating windows default to centered in display, can be moved around. They stay in place when we pan the view left/right.
  2. Child floating windows (like dialog popups) are centered on their parent window, and move with their parent when we pan the view left/right.
YaLTeR commented 7 months ago

The 2. will only make sense for modal dialogs which block input to the parent window, however the modal state is not actually communicated in any of the stable Wayland protocols. It's in private gtk-shell and KDE, and there are MRs into wayland-protocols to make it into a public protocol.

KiaraGrouwstra commented 7 months ago

one use-case for which i would like to make a window rule to make a window float is modal dialogs of keepassxc's browser extension. when using the browser extension to select a credential, the native application will open a modal dialog asking the user to grant permission. presently, using niri this dialog is opened next to keepassxc, as a new tiled window. from a UX perspective, this is unfortunate since i do not even have any indication that such a window has opened.

i would prefer to see that addressed by allowing to make a window float from the window rules. additionally, in hyprland i used a workspaces bar plugin that could visually mark workspaces wanting attention (which they called 'urgent'). i feel this was also useful to attend me to newly opened windows wanting attention as well (in case they lack focus, i.e. when no floating window rule has been created for them).

YaLTeR commented 7 months ago

Yeah, floating would make sense for this.

when using the browser extension to select a credential, the native application will open a modal dialog asking the user to grant permission. presently, using niri this dialog is opened next to keepassxc, as a new tiled window.

That means the dialog sets keepassxc itself as its parent. So as far as niri thinks, keepassxc running in the background randomly opened a dialog, so it shouldn't steal focus.

attention

This depends on #30

nougatbyte commented 6 months ago

add one floating layer , is one solution. but i think there is another:

  • add a fix/sticky property.

I would like this as a window rule for stuff like launchers (in my case albert, which currently gets treated as just another window)

RichardFevrier commented 6 months ago

I am currently trying to use albert launcher too with niri and I am facing the same issue as @nougatbyte But maybe it should be handled by their team since fuzzel, wofi, etc actually work?

YaLTeR commented 6 months ago

It could, yeah. It's one of the purposes of layer-shell after all.

RichardFevrier commented 5 months ago

Thanks for pointing me in the right direction, I've transmitted the info to them. (I love niri btw <3)

nougatbyte commented 5 months ago

I am currently trying to use albert launcher too with niri and I am facing the same issue as @nougatbyte But maybe it should be handled by their team since fuzzel, wofi, etc actually work?

Its not an overlay but I use this in a bashscript to call albert:

#!/bin/bash
albert show
niri msg action center-column
PiotrekB416 commented 5 months ago

I'm interested in working on this issue

YaLTeR commented 5 months ago

I'm interested in working on this issue

Hey, so adding a floating layer will need larger architectural and design considerations; I can't really say how exactly it should look in the code without trying to implement it myself. In broad strokes:

In case you want to start with something less abstract, you could try to implement mouse window resizing (both per client request, i.e. dragging from a corner of a window, and with Mod+Right Click). The rule of thumb on how that should work is: the window edge that is being resized should end up at the spot where the mouse pointer is (which means that always-centered columns will resize twice as fast horizontally, since their other edge will move in unison). As a start, the view can be restricted from scrolling during a mouse resize.

garrettwp commented 3 weeks ago

Has any progress been made on this? There are some applications that I would like to be in a window mode or not be set at full height. For example using a calculator app, etc

LuNeder commented 3 weeks ago

It would be nice if the floating layer could be scrollable too (either together or separately from the normal layer)

YaLTeR commented 3 weeks ago

The interactive move PR is fairly good progress

stefonarch commented 2 weeks ago

Hoping this comes soon - some really small dialog windows shouldn't move everything to the left, example: master passwd dialog in firefox. Just some window rules will do it.

willjr commented 2 weeks ago

Just to note that Zoom screen-sharing seems to do a few tricks with windows to implement things like the screen-sharing controls at the top of the screen, and tiling seems to interfere quite a lot with this.

YaLTeR commented 2 weeks ago

Those tricks can't work reliably on Wayland in general since windows, floating or not, don't know and can't control their position on screen. An overlay like that could use layer-shell instead.

But maybe it'll happen to work somehow anyway, we'll see.

mexisme commented 2 weeks ago

Those tricks can't work reliably on Wayland in general since windows, floating or not, don't know and can't control their position on screen. An overlay like that could use layer-shell instead.

In this specific case, I think Zoom needs/expects the controls to be in a floating window, and then "sticks" them to the top/bottom of the screen. Under PaperWM, I seem to remember solving this with a Window rule that makes all Zoom windows floating — but that's a fair while ago, so I may be misremembering.

But maybe it'll happen to work somehow anyway, we'll see.

Stranger things have happened! :wink: And def. happy to wait and see.