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

Dunst dynamic geometry #816

Closed
Iss-in opened this issue Feb 7, 2021 · 21 comments
Closed

Dunst dynamic geometry #816

Iss-in opened this issue Feb 7, 2021 · 21 comments

Comments

@Iss-in
Copy link

Iss-in commented Feb 7, 2021

Is it possible for dunst to consider the bar height as a start for geometry purposes ? As in it should detect the bar and add the necessary margin itself. It could also consider full-screen state as bar with zero height

@fwsmit
Copy link
Member

fwsmit commented Feb 7, 2021

Do you mean status bar?
I'm not sure if it's possible on X11. On wayland I'm pretty sure it's not possible, although there the notifications will refuse to go on top of your status bar. So an offset of 0 will make the notification appear right above your status bar.
For consistency I don't think we should implement this.
I do, however want to allow dynamic configuration in the future, so if that's flexible enough you could implement it yourself by changing the geometry on going fullscreen.

@Iss-in
Copy link
Author

Iss-in commented Feb 8, 2021

So what will be the correct approach to implement this on wayland ? Toggling the status bar while going fullscreen seems like bad practise. reading fullscreen status and adjust the geometry everytime ?

I really want to implement this myself, until a proper fix is done

@fwsmit
Copy link
Member

fwsmit commented Feb 8, 2021

If you want to implement it in wayland, you have two options:

  • A compositor specific method using some version of ipc (for example sway-ipc).
  • Easier would be to use my PR Wayland improvements #814 that implements fullscreen detection on wayland. Keep in mind that it doesn't work on the latest release of sway. This protocol was only implemented recently, so use sway-git. This solution also works on X11.

Then if you can adjust geometry based on whether or not fullscreen is active. Again, there's no way to move the notification on top of where the old status bar was as far as I know. That's the most proper fix I can think of. We might accept this feature into dunst if there is enough demand

@Iss-in
Copy link
Author

Iss-in commented Feb 9, 2021

Thanks for the solution, given that it doesn't work unless you trigger the sway full screen window manually, are these two events recorded differently in sway per this new protocol?

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

Thanks for the solution, given that it doesn't work unless you trigger the sway full screen window manually, are these two events recorded differently in sway per this new protocol?

No there's no way to distinguish the reason why it's been fullscreened. Why would you want to know?

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

because it dosn't work if application has a full screen toggle mode, like fullscreen mode in Firefox or any other media player Generally Toggled by F or F11 keys So I thought they are triggered differently in sway

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

No they should be working the same. Are you using the latest sway master?
This may also be a bug in xwayland if you're using the default version of firefox (you have to set an environment variable to get the wayland version of firefox).

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

Yeah, I'm on latest sway-version. On Firefox Support tabWindow-Protol is Wayland and MOZ_ENABLE_WAYLAND is enabled.
It is same behaviour in every app, be it Firefox ( on pressing F11 or F while playing a video ) ,VSCode, VLC etc. Can you confirm it on your end ?

For me, it works only if I toggle fullscreen manually

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

It works for me just fine. I tested sway version 1.5-b1b10415 (Feb 10 2021, branch 'master'). Youtube on firefox and mpv fullscreen are detected when I press f. What does your dunst debug log say?

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

yeah, something is wrong here, logs for both manual toggle, and app toggle are same ( both are detecting fullscreen switch )

Here are the debug logs for vlc, where a notification is already being displayed on screen

on entering and exiting vlc using F

DEBUG: Set output 39 fullscreen state 1
DEBUG: Waking up
DEBUG: RUN
DEBUG: Fullscreen queried: 1
INFO: Idle status queried: 0
DEBUG: Sleeping for 53954 ms
DEBUG: Set output 39 fullscreen state 0
DEBUG: Waking up
DEBUG: RUN
DEBUG: Fullscreen queried: 0
INFO: Idle status queried: 0
DEBUG: Sleeping for 53295 ms

on entering and exiting vlc using mod+F ( sway bind )

DEBUG: Set output 39 fullscreen state 1
DEBUG: Waking up
DEBUG: RUN
DEBUG: Fullscreen queried: 1
INFO: Idle status queried: 0
DEBUG: Sleeping for 55207 ms
DEBUG: Set output 39 fullscreen state 0
DEBUG: Waking up
DEBUG: RUN
DEBUG: Fullscreen queried: 0
INFO: Idle status queried: 0
DEBUG: Sleeping for 54580 ms

but dunst is readjusting only in 2nd one on same sway version 1.5-b1b10415 (Feb 10 2021, branch 'master'). Same for MPV player too

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

How are you detecting that dunst is readjusting?
I use

dunstrc

[fs]
    summary = "*"
    fullscreen = pushback

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

On pressing mod+f, notification is shifted up by height of status bar , while on pressing f in vlc, it remains at its original position

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

That's very weird there should be no difference at all

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

just to confirm it, this dynamic geometry is from your wayland-improvements branch v1.5.0-91-g0f58899 , right ?

I guess I could try to debug on my end, any advise on where to look for ?

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

No I didn't touch any geometry stuff in wayland-improvements. It only implements fullscreen detection (and some other smaller things).

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

So how are you getting the notification to move when you fullscreen?

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

lol nothing, It shifts on its own whenver I toggle full screen using mod+f.

I just checked, its actually because of waybar, whenver I toggle full screen or hide/kill the bar from terminal, notification is shifted up automatically. Its llikely sway default behaviour I guess

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

Oh that must be some waybar feature. Swaybar doesn't do that. Come to think of it, do you want the notification to move when your status bar disappears or not?

@Iss-in
Copy link
Author

Iss-in commented Feb 10, 2021

do you want the notification to move when your status bar disappears

yes, that's exactly what I want, when I toggle fullscreen using F key

@fwsmit
Copy link
Member

fwsmit commented Feb 10, 2021

Okay I would suggest reporting an issue with waybar then, since dunst didn't implement that functionality

@Iss-in
Copy link
Author

Iss-in commented Feb 14, 2021

yeah, this seems like a sway bug given protocol is detecting fullscreen in both cases.

@Iss-in Iss-in closed this as completed Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants