dunst-project / dunst

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

Dunst does not update screen size when resolution changes #434

Open josswright opened 6 years ago

josswright commented 6 years ago

I use dunst on a laptop where I often present on an external screen. When I do so, I tend to reduce my internal monitor resolution to match the external. (My internal monitor goes from 1920x1080 to, for example, 1024x768).

On reducing the screen resolution, dunst seems to display notifications correctly. When, however, I retun to the larger screen size, dunst notifications now appear in the correct location for the smaller screen. (So 1024x768 pixels into my 1920x1080 screen.)

For reference, I'm running this under i3, and changing resolution using xrandr directly.

Installation info

tsipinakis commented 6 years ago

Can you run xev -event randr, reproduce it and post the output? We might be looking for the wrong screen update event.

tsipinakis commented 6 years ago

Ping @josswright

josswright commented 6 years ago

Oh, sorry. I didn't see the reply. I'll upload the data later today when I'm connected to an external projector.

josswright commented 6 years ago

Here's a dump, as requested. The steps were: 1) Connect to external projector and enable. (xrandr --output DP1 --auto) 2) Manually set internal monitor resolution to match external. (xrandr --output eDP1 --mode 1024x768) 3) Disconnect external and disable. (xrandr --output DP1 --off) 4) Reset internal resolution. (xrandr --output eDP1 --auto).

Tested, and the dunst notification appears 1024x768 pixels into my 1920x1080 internal monitor.

randr.log

wavexx commented 6 years ago

I have the same issue. When disconnecting the external screen, thus reducing the overall geometry, the notification is still shown outside of the current screen boundaries [I'm on the current master branch].

I'm using notification-screen-follows-mouse, so it might be that the notification of pointer changing screen is never emitted? I manually invoke xrandr --auto when plugging/unplugging extra monitors.

bebehei commented 6 years ago

@wavexx What does xrandr --version report? I can't reproduce it with my own system.

josswright commented 6 years ago

For me:

xrandr program version       1.5.0
Server reports RandR version 1.5
bebehei commented 6 years ago

@josswright Thanks for the answer. Could you also please paste the systemctl status --user dunst.service output after reproducing this?

wavexx commented 6 years ago

On Thu, Dec 21 2017, Benedikt Heine wrote:

@wavexx What does xrandr --version report? I can't reproduce it with my own system.

I'm on debian unstable.

$ xrandr --version xrandr program version 1.5.0 Server reports RandR version 1.5

I'm not sure the output of systemctl status --user dunst.service matters here. If I kill dunst, it gets respawned correctly and the notifications are shown correctly using the new geometry.

I tried again and narrowed the issue a bit:

The current screen is probably not updated until the pointer is moved.

Not sure this is the complete story, but since I'm a keyboard-heavy user, it would explain why I would see it so often.

josswright commented 6 years ago

I also don't run dunst through a systemd service -- I just spawn it manually. (Arch Linux.)

(Or, I should clarify, through my .xinitrc.)

bebehei commented 6 years ago

@josswright Interesting that you don't spawn dunst via dbus. But anyways, what's your setting of i3's focus_follows_mouse?

@wavexx do you run also i3? If so, could you also tell me the value of focus_follows_mouse?

josswright commented 6 years ago

@bebehei Just default: focus_follows_mouse yes

wavexx commented 6 years ago

On Thu, Dec 21 2017, Benedikt Heine wrote:

@wavexx do you run also i3? If so, could you also tell me the value of focus_follows_mouse?

follow=mouse is the dunst setting.

As a WM I'm using spectrwm (which does focus-follows-mouse anyway).

josswright commented 6 years ago

Oh, sorry, for dunst configuration I've got follow = keyboard

bebehei commented 6 years ago

This issue is getting weirder to debug by every comment 😂 I've tested all four combinations already yesterday and nothing made me able to reproduce this.

Well, I can only shoot into the dark and I'm guessing around. I'm not getting illuminated by the randr.log. I've created now a branch with Debug output of the events. Could you please build the 434-debug branch from my repository and paste the output while reproducing? If you annotate the output with the specific "I've done this/that here" that would be great.

I've also created a PKGBUILD.gz, which builds this as a package directly from there. (You have to gunzip it first, github does not allow me to push it raw.)

Thanks in advance.

wavexx commented 5 years ago

Still affected by this. When the screen configuration changes, dunst still uses the old screen.

I'm pretty sure this happens due to:

I can easily "fix" dunst by moving the mouse to another window, thus triggering a focus change event. This does update the position of the notification instantly to the current screen.

tsipinakis commented 5 years ago

@wavexx Can you build https://github.com/tsipinakis/dunst/commit/e97f22600fefdd93b3da481c95d2c9750a768d24 and tell me if that fixes it?

From a few tests I've tried I can't reproduce this locally.

wavexx commented 5 years ago

On Sat, Mar 23 2019, Nikos Tsipinakis wrote:

@wavexx Can you build tsipinakis@545db8c and tell me if that fixes it?

Ok, I've built it but testing is also going to take a while on my side. This is annoying to reproduce :/

FatBoyXPC commented 3 years ago

I am experiencing the same behavior when switching resolutions. Currently I kill and restart dunst but that doesn't seem favorable? What other steps can I take for this?

fwsmit commented 3 years ago

@FatBoyXPC could you give a bit more info? Eg: your setup, desktop environment, distribution, Dunst version, your dunstrc. Does the issue go away when you move your mouse?

Please provide as much info as possible to narrow down the problem. A reliable way to reproduce it would help a lot.

FatBoyXPC commented 3 years ago

I'm running arch with xmonad. Dunst 1.6.1.

dunstrc:

[global]
    font = "Droid Sans 8"
    markup = yes
    format = "<b>%s</b>\n%b"
    sort = yes
    indicate_hidden = yes
    alignment = center
    bounce_freq = 0
    show_age_threshold = 60
    word_wrap = yes
    ignore_newline = no
    geometry = "400x5-30+20"
    transparency = 0
    idle_threshold = 120
    monitor = 0
    follow = mouse
    sticky_history = yes
    line_height = 0
    separator_height = 2
    padding = 8
    horizontal_padding = 8
    separator_color = frame
    startup_notification = false
    frame_width = 1
    frame_color = "#464B50"
    icon_position = left
    max_icon_size = 200

[shortcuts]
    close = ctrl+space
    close_all = ctrl+shift+space
    history = ctrl+grave
    context = ctrl+shift+period

[urgency_low]
    background = "#323537"
    foreground = "#8F9D6A"
    timeout = 1

[urgency_normal]
    background = "#323537"
    foreground = "#AFC4DB"
    timeout = 5

[urgency_critical]
    background = "#323537"
    foreground = "#CF6A4C"
    timeout = 0

The issue does not go away when I move the mouse.

I have a usb c docking station with an external monitor that I use. When I am docked, I've got the laptop monitor turned off and the external monitor at 1920x1080. When I undock, the laptop resolution is 2560x1440. If I start dunst while docked, and I undock, dunst appears in the middle of my screen. When I re-dock, dunst goes back to the appropriate corner. If I start dunst while undocked, then dock, I never see the notification at all. If I re-dock, then the notification goes back to the appropriate corner.

bynect commented 4 months ago

does this still happen in the latest versions of dunst?

FatBoyXPC commented 3 months ago

This isn't an issue for me since I've changed hardware and don't normally use different resolutions anymore. That said, this seems easy enough to test by forcing the resolution to change?

bynect commented 3 months ago

This isn't an issue for me since I've changed hardware and don't normally use different resolutions anymore. That said, this seems easy enough to test by forcing the resolution to change?

Is changing resolution with xrandr enough to trigger it? You mentioned attaching an external monitor