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

Wayland improvements #814

Merged
merged 4 commits into from
Mar 8, 2021
Merged

Conversation

fwsmit
Copy link
Member

@fwsmit fwsmit commented Feb 2, 2021

This PR adds fullscreen detection for compositors that support the protocol (sway master does, but there is no release version that does yet). It also adds basic touchscreen handling copied from mako, although I haven't been able to test it since I don't have a touch device with linux.
Minor fix is made, where the idle timer would be set to 0 when idle_timeout was 0, instead of disabling the timer. This resulted in lots of debug messages.

Copy pasted from mako. I could not test.
@fwsmit fwsmit force-pushed the wayland-improvements branch 3 times, most recently from eb7ecf2 to dfd0309 Compare February 4, 2021 22:40
@fwsmit fwsmit marked this pull request as ready for review February 5, 2021 23:44
@codecov-io
Copy link

Codecov Report

Merging #814 (0f58899) into master (814e620) will decrease coverage by 0.86%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #814      +/-   ##
==========================================
- Coverage   59.64%   58.77%   -0.87%     
==========================================
  Files          36       37       +1     
  Lines        5880     5963      +83     
==========================================
- Hits         3507     3505       -2     
- Misses       2373     2458      +85     
Flag Coverage Δ
unittests 58.77% <0.00%> (-0.87%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/input.c 0.00% <0.00%> (ø)
...gn-toplevel-management-unstable-v1-client-header.h 0.00% <0.00%> (ø)
src/wayland/wl.c 0.00% <0.00%> (ø)
src/rules.c 47.76% <0.00%> (-1.50%) ⬇️
src/option_parser.c 86.06% <0.00%> (-0.04%) ⬇️
src/x11/x.c 2.32% <0.00%> (+0.02%) ⬆️
src/dunst.c 10.28% <0.00%> (+0.09%) ⬆️
src/notification.c 60.37% <0.00%> (+0.31%) ⬆️
src/log.c 79.06% <0.00%> (+1.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 814e620...0f58899. Read the comment docs.

@fwsmit
Copy link
Member Author

fwsmit commented Feb 5, 2021

This code is for review ready now. You can test fullscreen detection only on the latest sway version. There is one edge case not being dealt with, namely two "toplevels" being fullscreen on the same output. It's possible according to the protocol, but I don't think it's possible in sway.

@fwsmit fwsmit mentioned this pull request Feb 8, 2021
@tsipinakis
Copy link
Member

I'm not sure about the touch support part. It's untested as you said, no-one has requested it yet.

Doesn't wayland translate touch=left click? In which case I think leaving the default behaviour would be fine.

@fwsmit
Copy link
Member Author

fwsmit commented Feb 27, 2021

Doesn't wayland translate touch=left click? In which case I think leaving the default behaviour would be fine.

I don't think wayland translates touch actions to left mouse button. That would mean it triggers twice on touch. Wouldn't make much sense in code.

I feel like it can't hurt to leave the touch code in.

@tsipinakis
Copy link
Member

I don't think wayland translates touch actions to left mouse button. That would mean it triggers twice on touch. Wouldn't make much sense in code.

My point is that my assumption for a sane default for wayland is:

If (application supports touch) {
    send touch events
} else {
    send touch events as left click
}

Is that not the case? It seems weird that for all programs to work with touch they have to be explicitly coded for touch.

@fwsmit
Copy link
Member Author

fwsmit commented Mar 3, 2021

Is that not the case? It seems weird that for all programs to work with touch they have to be explicitly coded for touch.

I've asked on the wayland irc to be sure. It's not required by the spec to translate the touch inputs to left mouse button, thus some compositors might not do it. I don't know what compositors do or don't do it though.

Most applications won't have to be explicitly coded for touch, because they are using a GUI toolkit like QT or GTK. The wayland protocol seems to be quite low level, so maybe it will eventually make sense to have libraries that do the wayland interfacing. You can't query things like mouse position, but you have to keep track of it with position change events.

@tsipinakis
Copy link
Member

Hm, in that case lets try it out. (And hope it doesn't break anything)

@tsipinakis tsipinakis merged commit 3acffdb into dunst-project:master Mar 8, 2021
@kopr12
Copy link

kopr12 commented Jun 24, 2021

Fullscreen detection works with Sway 1.6 ?

@fwsmit
Copy link
Member Author

fwsmit commented Jun 24, 2021

Fullscreen detection works with Sway 1.6 ?

Yep

@fwsmit fwsmit deleted the wayland-improvements branch June 24, 2021 14:41
@kopr12
Copy link

kopr12 commented Jun 24, 2021

Well, I'm trying not to have notifications shown when fullscreen, under X11 this line did that fullscreen = delay, doesn't seem to work under Wayland, do I need something else to configure as well ?

@fwsmit
Copy link
Member Author

fwsmit commented Jun 24, 2021

Could you open an issue about that with more info like a Dunst version included?

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

Successfully merging this pull request may close these issues.

None yet

4 participants