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

Notification Content Area Width miscalculated when frame_width is greater than 0 #1241

Open
jesusofsuburbs opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@jesusofsuburbs
Copy link

Issue description

The drawn notification is wider than the geometry size specified by width, but only if the frame_width > 0 (this is without incorporating the frame thickness into the total width).
The notification content (i.e. everything within the frame) is expanded by the width of the frame.

So if e.g. 'width' is set to 360 and 'frame_width' to 1, the effective width will be 361 pixels (unexpected), with an additional 2 pixels of width added by the border (1 on each side) around it (expected). So rather than being 362 pixels in width in total, it's 363 wide.
This seems to scale along with the frame_thickness, i.e. with 'width' set to 360 and 'frame_width' to 4 the effective notification content becomes 364 pixels in width (unexpected), with an additional 8 pixels of width added by the border (4 on each side) around it (expected). This makes the notification 372 pixels wide, rather than 360.

If I set the 'frame_width' to 0, the notification displays at its actual width (i.e. 360 pixels wide).

Installation info

  • Version: Dunst - A customizable and lightweight notification-daemon 1.9.2 (2023-04-20)
  • Install type: package
  • Window manager / Desktop environment: openbox
  • Distro: Arch Linux
Minimal dunstrc (default one suffices)
[global]
    monitor = 0
    follow = none
    width = 300
    height = 300
    origin = top-right
    offset = 10x50
    scale = 0
    notification_limit = 20
    progress_bar = true
    progress_bar_height = 10
    progress_bar_frame_width = 1
    progress_bar_min_width = 150
    progress_bar_max_width = 300
    progress_bar_corner_radius = 0
    icon_corner_radius = 0
    indicate_hidden = yes
    transparency = 0
    separator_height = 2
    padding = 8
    horizontal_padding = 8
    text_icon_padding = 0
    frame_width = 3
    frame_color = "#aaaaaa"
    gap_size = 0
    separator_color = frame
    sort = yes
    font = Monospace 8
    line_height = 0
    format = "<b>%s</b>\n%b"
    alignment = left
    vertical_alignment = center
    show_age_threshold = 60
    ellipsize = middle
    ignore_newline = no
    stack_duplicates = true
    hide_duplicate_count = false
    show_indicators = yes
    enable_recursive_icon_lookup = true
    icon_theme = Adwaita
    icon_position = left
    min_icon_size = 32
    max_icon_size = 128
    icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
    sticky_history = yes
    history_length = 20
    dmenu = /usr/bin/dmenu -p dunst:
    browser = /usr/bin/xdg-open
    always_run_script = true
    title = Dunst
    class = Dunst
    corner_radius = 0
    ignore_dbusclose = false
    force_xwayland = false
    force_xinerama = false

[experimental]
    per_monitor_dpi = false

Screenshot

Screenshot
This was taken using the default dunstrc. Its width therein is set to 300 pixels, with a frame_width of 3 pixels. The area contained within the frame has a width of 303, rather than 300 pixels.

@bynect
Copy link
Member

bynect commented Apr 6, 2024

This makes the notification 372 pixels wide, rather than 360

Did you mean 368 total?

I am trying to investigate this. Are you taking the pixel values from the dunst logging or externally with some measuring tool?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants