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

Displaying pop-ups as floating windows. #3095

Closed
fredefox opened this issue Nov 9, 2018 · 11 comments
Closed

Displaying pop-ups as floating windows. #3095

fredefox opened this issue Nov 9, 2018 · 11 comments

Comments

@fredefox
Copy link

fredefox commented Nov 9, 2018

$ lsmod | grep nvidia | wc -l
0

I hope I am welcome :S

$ swaymsg -t get_version
sway version 1.0-alpha.6-335-ga41b77ef (Oct 20 2018, branch 'master')

This is a feature request so I will forego the other formalities you asked for. In i3 some windows are opened as pop-ups. That is to say, they are openened in the "floating" mode. I am not aware how this works technically I also don't know if it works for some programs under sway. It does not work with zenity.

Minimal repro:

$ zenity --question

Desired behaviour: A small floating window is opened.

Actual behaviour: A new tiled window is displayed.

Is this something that you have support for that may be a problem with my installation? I recently build this from source, so I may have messed something up. Floating windows do work for me though.

@emersion
Copy link
Member

emersion commented Nov 9, 2018

In i3 zenity uses X11, which sets the window as a dialog window. In sway it uses Wayland which has no "window type". So we can't do anything about it.

Note that if zenity was making the window non-resizable, we would make it floating.

@emersion
Copy link
Member

emersion commented Nov 9, 2018

You could probably use criteria to make zenity windows floating by default.

@fredefox
Copy link
Author

fredefox commented Nov 9, 2018

Thanks for the clarification! So Wayland has nothing similar to "window type"? Seems like a huge design oversight to me...

@emersion
Copy link
Member

emersion commented Nov 9, 2018

Window types are essentially useless. It's pretty uncommon to have dialog windows without a parent. In this particular case I think zenity should make its dialog non-resizable.

@ddevault ddevault closed this as completed Nov 9, 2018
@fredefox
Copy link
Author

fredefox commented Nov 9, 2018

I see. Thank you!

@ascent12
Copy link
Member

ascent12 commented Nov 9, 2018

So Wayland has nothing similar to "window type"?

Wayland has shells, which is "kind-of" like a window type, but not really the same thing in an X11 sense.

@b0o
Copy link

b0o commented Oct 14, 2020

Window types are essentially useless. It's pretty uncommon to have dialog windows without a parent. In this particular case I think zenity should make its dialog non-resizable.

So, it seems nearly impossible to float a pop-up window created by Chrome or Firefox when either app is using its Wayland backend.

I came up with a super hacky workaround - a userscript that tries to detect pop-up windows based on the window.titlebar.visible or window.menubar.visible properties, and if either one is false I prepend a well-known string to the window title. I check for this string inside my Sway config and float matching windows. But, let's be honest: 🤮. Is there really no better way?

@fuzunspm
Copy link

could you find a better way?

@celebilercem
Copy link

I installed mako and it works fine with Sway and Firefox.

@jpetazzo
Copy link

Just to clarify (in case someone else stumbles upon this): after installing mako, you probably need to restart Firefox. There may or may not be other steps to do (I fiddled around with makoctl, made sure mako was running, upgraded libnotify... And it's finally when I restarted Firefox that notifications worked correctly!)

I suppose that Firefox checks if there is a notification service registered on D-BUS.

  • If there is one, it will use it (and display neat little desktop notifications).
  • If there is none, it will fallback to display notifications directly, but it does so in a hackish way (which is why we end up with these nasty windows that required ugly hacks).

I suppose (but your guess is as good as mine!) that Firefox checks once on start-up if there is a notification service available (and that it's why I had to restart Firefox for things to start working).

@icy-comet
Copy link

Sorry, to comment on such an old issue.

However, Zenity dialogues were indeed marked as non-resizable with this commit and the windows now open in floating mode by default.

Just putting this here for google :)

mazunki added a commit to mazunki/keepassxc that referenced this issue Jul 28, 2024
On Sway (and probably other Wayland compositors, at least `wlroots` ones),
windows default to being tiled. For windows which are not resizable,
they instead default to being in float mode. See
swaywm/sway#3095 for reference.

I don't think there's a good reason for having the password generator
popup be resizable (and even looks awful when stretched vertically).

- Added a size policy to marking the window with a fixed width. This
  requires having a minimum and maximum size on the widget.
- Copied the original geometry size with `fixedWidth` to automatically
  generate `minimumSize` and `maximumSize`, to avoid repeating
  the same property values reduntantly in the ui file.
droidmonkey pushed a commit to mazunki/keepassxc that referenced this issue Aug 9, 2024
On Sway (and probably other Wayland compositors, at least `wlroots` ones),
windows default to being tiled. For windows which are not resizable,
they instead default to being in float mode. See
swaywm/sway#3095 for reference.

I don't think there's a good reason for having the password generator
popup be resizable (and even looks awful when stretched vertically).

- Added a size policy to marking the window with a fixed width. This
  requires having a minimum and maximum size on the widget.
- Copied the original geometry size with `fixedWidth` to automatically
  generate `minimumSize` and `maximumSize`, to avoid repeating
  the same property values reduntantly in the ui file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants