dunst-project / dunst

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

Wayland: multiseat, new protocols and other random fixes #1250

Closed alebastr closed 8 months ago

alebastr commented 8 months ago

A bunch of fixes for Wayland backend:

Tested on Fedora 39 and FreeBSD 14. Haven't tried with older systems, but everything version-dependent should be properly guarded. Cursor-shape and ext-idle-notify could be tested with a compositor already ported to the new wlroots (Sway master or v1.9 branches).

I'm 100% unsure about the X11 impl for monitor names. It's only been tested with XWayland, and frankly I'm not familiar with the Xlib.

Fixes: #1132 Likely also addresses #1214

codecov-commenter commented 8 months ago

Codecov Report

Attention: 188 lines in your changes are missing coverage. Please review.

Comparison is base (d314806) 66.17% compared to head (728b302) 65.24%.

Files Patch % Lines
src/wayland/wl.c 0.00% 148 Missing :warning:
src/x11/screen.c 0.00% 18 Missing :warning:
.../wayland/protocols/cursor-shape-v1-client-header.h 0.00% 11 Missing :warning:
...yland/protocols/ext-idle-notify-v1-client-header.h 0.00% 11 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1250 +/- ## ========================================== - Coverage 66.17% 65.24% -0.93% ========================================== Files 46 48 +2 Lines 7696 7847 +151 ========================================== + Hits 5093 5120 +27 - Misses 2603 2727 +124 ``` | [Flag](https://app.codecov.io/gh/dunst-project/dunst/pull/1250/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dunst-project/dunst/pull/1250/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project) | `65.24% <13.36%> (-0.93%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Narrat commented 8 months ago

Tested the branch and at least the warning mentioned in #1214 seems to be gone. But didn't had the impression it was working. But I need to test that further.

alebastr commented 8 months ago

Tested the branch and at least the warning mentioned in #1214 seems to be gone. But didn't had the impression it was working. But I need to test that further.

Can you set a very short (like 10s short) idle_threshold, start dunst as WAYLAND_DEBUG=client dunst -verbosity debug and collect the output?

I've been testing various corner-cases with Sway 1.9 snapshot and everything has been working so far. labwc shouldn't have any significant differences in behavior with Sway.

Narrat commented 8 months ago

All good. Can confirm this PR does fix #1214 I hadn't noticed that I removed the setting from the config (and the default seems to be to not set a time)? Typical user error :D Thank you for the work on the wayland related side of things

fwsmit commented 8 months ago

Thanks for this much needed wayland work! With a quick look, the X11 impl seems to be fine as well, but I'm not too familiar with the xlib either. If someone is able to test it on X11, that would be great.

fwsmit commented 8 months ago

I've taken a look at all the code. I have some questions and minor things, but over all it looks good.

fwsmit commented 8 months ago

The wl.c file is getting a bit big and could use some refactoring to separate files. I'm not saying it should happen in this PR, but this PR does make it a little bit bigger as well.

fwsmit commented 8 months ago

Thanks for all the fixes and wayland features! Now dunst is up to date with the protocols again

fwsmit commented 8 months ago

I'll go and merge this PR. If you want to work on refactoring the wayaland code a bit, that would be cool. But don't feel obliged :)

alebastr commented 8 months ago

The wl.c file is getting a bit big and could use some refactoring to separate files. I'm not saying it should happen in this PR, but this PR does make it a little bit bigger as well.

I'll take a look. An obvious idea is to split seat-related code to src/wayland/seat.c, but there's a couple of things to address before I'll be able to do that.