Skip to content

dunstctl reload from #1350 stops dunst from working on native wayland #1434

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
fxzzi opened this issue Jan 20, 2025 · 8 comments · Fixed by #1458
Closed

dunstctl reload from #1350 stops dunst from working on native wayland #1434

fxzzi opened this issue Jan 20, 2025 · 8 comments · Fixed by #1458

Comments

@fxzzi
Copy link

fxzzi commented Jan 20, 2025

Hey,

As I mentioned in #1350 , the dunstctl reload mechanism does not seem to work correctly when running dunst through wayland native. It seems to reload fine if a notification is not visible on screen, but if a reload occurs whilst a notification is visible, no new notifications will show up for some reason. They still show in the verbose logs.

It does however work fine on X11 and XWayland.

As mentioned in the comments there, I tried the latest master with no change.

The logs after running dunst -verbosity debug, and triggering the bug are as follows: https://paste.rs/yrEGc.txt

If any more info is required please do not hesitate to let me know. I'll be happy to provide anything else.

@fxzzi fxzzi changed the title dunstctl reload from #1350 stops dunst from working on native waylandd dunstctl reload from #1350 stops dunst from working on native wayland Jan 20, 2025
@bynect
Copy link
Member

bynect commented Jan 21, 2025

Probably something is wrong in the wayland deinit/init process

@bynect
Copy link
Member

bynect commented Mar 8, 2025

so no window shows up if you reload with open notification? but is the notification itself closed? maybe wayland doesn't like that we close the connection with the compositor when there are pending windows?

@fxzzi
Copy link
Author

fxzzi commented Mar 8, 2025

Yeah, that's correct. If a dunst window / notification is open at the time of reloading, it then fails to create new windows. Maybe we need to make sure all the notifications are closed first before reloading? Force all notifications to close before reload?

@bynect
Copy link
Member

bynect commented Mar 8, 2025

I'm not an expert in wayland but I'll look into it. Hopefully its not some obscure protocol thing

pslldq pushed a commit to pslldq/dunst that referenced this issue Mar 17, 2025
Improve the wayland deinit and init process to fix problems after
running deinit followed by init in case of a reload. Furthermore destroy
otherwise leaked objects and clear associated pointers to prevent
potential use after free bugs.

This change fixes dunst from breaking sometimes, when a reload is
triggered while a notification is displayed. This issue happed because
of either ctx.dirty not being cleared, which causes an set_dirty to do
an early exit without scheduling a frame to the surface. Or because
the frame_callback was not being cleared, which prevented further
surface commits, as the callback would never be triggered after the
surface was destroyed by the deinit process.

Fixes dunst-project#1434
@pslldq
Copy link
Contributor

pslldq commented Mar 17, 2025

@fxzzi I've created a fix for this issue in #1458 . Feel free to check, if it also fixes the issue on your side 😏

@bynect
Copy link
Member

bynect commented Mar 17, 2025

@fxzzi I've created a fix for this issue in #1458 . Feel free to check, if it also fixes the issue on your side 😏

Thank you so much for looking into it 👍

@fxzzi
Copy link
Author

fxzzi commented Mar 20, 2025

Can confirm this fixed the issue for me and dunstctl reload is now working correctly whilst a notification is visible on screen. I tested it by applying the patch to the latest TAG (not master) like so on NixOS:

      services.dunst.package = pkgs.dunst.overrideAttrs {
        patches = [
          (pkgs.fetchpatch {
            # patch to fix `dunstctl reload` on native wayland dunst
            name = "1458.patch";
            url = "https://github.com/dunst-project/dunst/pull/1458.patch";
            sha256 = "sha256-uLY0atUjHRy7hCkAoEkWRk5kl8VvO6nygwuK5aqaG5c=";
          })
        ];
      };

Thank you for your work :)

P.S. also working with drop-in configs (i use it for theming and it reloads them perfectly too)

@bynect
Copy link
Member

bynect commented Mar 20, 2025

thanks fxzzi for the feedback, I will merge the pr shortly

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants