dunst icon indicating copy to clipboard operation
dunst copied to clipboard

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

Open Monirzadeh opened this issue 2 years ago • 6 comments

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

  • Version: 1.9.2
  • Install type: package
  • Window manager: dwl
  • Distro: Arch
Minimal dunstrc
# Dunstrc here

Monirzadeh avatar May 30 '23 15:05 Monirzadeh

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

ShellCode33 avatar Jul 23 '23 15:07 ShellCode33

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?

fwsmit avatar Jan 01 '24 17:01 fwsmit

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.

Monirzadeh avatar Jan 01 '24 17:01 Monirzadeh

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

fwsmit avatar Jan 02 '24 09:01 fwsmit

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.

Monirzadeh avatar Jan 02 '24 10:01 Monirzadeh

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

fwsmit avatar Jan 02 '24 14:01 fwsmit