dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.52k stars 338 forks source link

dunst `-r` flag not respect `follow = keyboard` #1179

Open Monirzadeh opened 1 year ago

Monirzadeh commented 1 year ago

Issue description

dunst not respect to follow config if you use -r flag you can update specific notification with -r for example

dunstify -r 4 "first" ; sleep 2 ; dunstify -r 4 "second"

Update notification from one to secend but it is not commitment to follow config. Steps to reproduce:

  1. set follow = keyboard in config file
  2. run dunstify -r 4 "first" ; sleep 2 ; dunstify -r 4 "second"
  3. you see one in monitor 1
  4. Change keyboard focus to monitor 2
  5. second not show in monitor 2.

What I expected: update notification should show in active monitor

Installation info

Minimal dunstrc ```ini # Dunstrc here ```
ShellCode33 commented 1 year ago

If I'm not mistaken this is due to wlroots (Wayland) limitations. Fixing this would be incredibly hackish and therefore probably not worth implementing (I could be wrong, I'm not a wlroots guru). A nice workaround for this would be to send notifications to all monitors at once, unfortunately this is not yet supported (see #45).

Relevant code:

https://github.com/dunst-project/dunst/blob/91f3b9c206d7b1aac6d503cb7bd50f7495454741/src/wayland/wl.c#L388-L400

fwsmit commented 8 months ago

Currently there is no difference between follow mouse and keyboard on wayland. Dunst lets the compositor decide where to put the window. This is at the time of creating the notification.

Does closing the old notification before opening the second one open it on the right monitor?

Monirzadeh commented 8 months ago

Currently there is no difference between follow mouse and keyboard on wayland. Dunst lets the compositor decide where to put the window. This is at the time of creating the notification.

Does closing the old notification before opening the second one open it on the right monitor?

No. It is not shown on the right monitor when we have notification.

  1. focus keyboard and mouse on monitor 1
  2. run the script above
  3. see notification first as notification on monitor 1
  4. change focus of keyboard and mouse to monitor 2
  5. notification second still appears on monitor 1 When you click to end the notification, the next notification appears on the currently active monitor.
fwsmit commented 8 months ago

Okay, so in theory Dunst could close the window and reopen it to make the notification appear on the new monitor. Only with the way that dunst currently shows notifications, in one window, it would move the other notifications as well. But only after sending a new notification. This makes the behavior in this specific case better, but in general you would want the notification to follow immediately. So a better solution is needed. But I don't know if one currently

Monirzadeh commented 8 months ago

I think first step is better to create new notification in focus monitor because users are actively working on that monitor. Maybe later we can find a solution to follow immediately.

fwsmit commented 8 months ago

To do that dunst would have to close the window and create a new window. All notifications would be moved over (until multiple windows are supported). But yeah that's possible