Skip to content

Dunst doesnt work if screen number >= amount of monitors on that screen #762

@mcz

Description

@mcz

I have two X screens, :0.0 and :0.1 and I want to run dunst on the second one. When I try to run dunst, it exits with the message dunst: src/x11/screen.c:377: get_active_screen: Assertion `ret >= 0 && ret < screens_len' failed..
Running it on screen 0 works. The options "monitor" and "follow" don't change anything.

Some (maybe) useful info:

$ DISPLAY=:0 xrandr

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.02*+  60.01    59.97    59.96    59.93
   1680x1050     59.95    59.88
   1400x1050     59.98
   1600x900      59.99    59.94    59.95    59.82
   (... more resolutions...)
   432x243       59.92    59.57
   320x240       60.05
   360x202       59.51    59.13
   320x180       59.84    59.32

$ DISPLAY=:0.1 xrandr

Screen 1: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm
   1920x1080     60.00*+
   1600x1200     60.00
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x800      59.91
   1024x768      75.03    60.00
   800x600       75.00    60.32
   640x480       75.00    59.94
   720x400       70.08
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)

I think the problem is as follows:
In src/x11/screen.c:randr_update() XRRMonitorInfo is used to get the number of Monitors on the DefaultScreen(xctx.dpy). The default screen is taken from the DISPLAY environment variable, which is :0.1, so the default Screen is 1. I have one active monitor on that screen, so screens_len gets set to 1.
Later, in src/x11/screen.c:screen_info() ret gets set from DefaultScreen() once again to determine what monitor to use (This is wrong, since screens != monitors). And because my screen's index isn't less than the number of active monitors on that screen, assert aborts.

Installation info

  • Version: Dunst - A customizable and lightweight notification-daemon 1.5.0 (2020-07-23)
  • Install type: package
  • Distro and version: Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions