Skip to content

Commit

Permalink
Merge pull request #814 from fwSmit/wayland-improvements
Browse files Browse the repository at this point in the history
Wayland improvements
  • Loading branch information
tsipinakis authored Mar 8, 2021
2 parents 7e22272 + 0f58899 commit 3acffdb
Show file tree
Hide file tree
Showing 7 changed files with 1,277 additions and 66 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ service-systemd:
endif

ifneq (0,${WAYLAND})
wayland-protocols: src/wayland/protocols/wlr-layer-shell-unstable-v1.xml
wayland-protocols: src/wayland/protocols/wlr-layer-shell-unstable-v1.xml src/wayland/protocols/wlr-foreign-toplevel-management-unstable-v1.xml
# TODO: write this shorter
mkdir -p src/wayland/protocols
wayland-scanner private-code ${DATA_DIR_WAYLAND_PROTOCOLS}/stable/xdg-shell/xdg-shell.xml src/wayland/protocols/xdg-shell.h
wayland-scanner client-header ${DATA_DIR_WAYLAND_PROTOCOLS}/stable/xdg-shell/xdg-shell.xml src/wayland/protocols/xdg-shell-client-header.h
Expand All @@ -158,6 +159,8 @@ wayland-protocols: src/wayland/protocols/wlr-layer-shell-unstable-v1.xml
wayland-scanner private-code src/wayland/protocols/wlr-layer-shell-unstable-v1.xml src/wayland/protocols/wlr-layer-shell-unstable-v1.h
wayland-scanner client-header src/wayland/protocols/idle.xml src/wayland/protocols/idle-client-header.h
wayland-scanner private-code src/wayland/protocols/idle.xml src/wayland/protocols/idle.h
wayland-scanner client-header src/wayland/protocols/wlr-foreign-toplevel-management-unstable-v1.xml src/wayland/protocols/wlr-foreign-toplevel-management-unstable-v1-client-header.h
wayland-scanner private-code src/wayland/protocols/wlr-foreign-toplevel-management-unstable-v1.xml src/wayland/protocols/wlr-foreign-toplevel-management-unstable-v1.h
endif

.PHONY: clean clean-dunst clean-dunstify clean-doc clean-tests clean-coverage clean-coverage-run clean-wayland-protocols
Expand Down
30 changes: 20 additions & 10 deletions docs/dunst.5.pod
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ Place dunst notifications on the selected layer. Using overlay
will cause notifications to be displayed above fullscreen windows, though
this may also occur at top depending on your compositor.

In Wayland, Notifications won't be delayed when in fullscreen (like when
setting B<fullscreen> to pushback in X11). This is a Wayland limitation.

The bottom layer is below all windows and above the background.

Default: overlay
Expand Down Expand Up @@ -516,7 +513,8 @@ automatically lowered to half of the notification height if it exceeds it.

=item B<mouse_left/middle/right_click> (values: [none/do_action/close_current/close_all])

Defines action of mouse click.
Defines action of mouse click. A touch input in Wayland acts as a mouse left
click.

=over 4

Expand Down Expand Up @@ -647,7 +645,7 @@ but also has a lot of extra functionality. So see more see dunstctl(1).
=head1 HISTORY

Dunst saves a number of notifications (specified by B<history_length>) in memory.
These notifications can be recalled (i.e. redisplayed) by calling
These notifications can be recalled (i.e. redisplayed) by calling
B<dunstctl history> (see dunstctl(1)). Whether these notifications will time out
like if they have been just send depends on the value of the B<sticky_history>
setting.
Expand All @@ -662,9 +660,15 @@ Dunst has Wayland support since version 1.6.0. Because the Wayland protocol
is more focused on security, some things that are possible in X11 are not
possible in Wayland. Those differences are reflected in the configuration.
The main things that change are that dunst on Wayland cannot use global
hotkeys (they are deprecated anyways, use dunstctl) and it cannot detect
if an application is fullscreen. If you want to see notifications when in
fullscreen, set B<layer = overlay> in the global options.
hotkeys (they are deprecated anyways, use dunstctl).

Some dunst features on wayland might need your compositor to support a certain
protocol. Dunst will warn you if an optional feature isn't supported and will
disable the corresponding functionality.

Fullscreen detection works on wayland with some limitations (see B<fullscreen>).
If you want notifications to appear over fullscreen windows, set
B<layer = overlay> in the global options.

Note that the same limitations exist when using xwayland.
If something doesn't quite work in Wayland, please file a bug report. In the
Expand Down Expand Up @@ -791,7 +795,7 @@ Equivalent to the C<format> setting.

The frame color color of the notification. See COLORS for possible values.

=item C<fullscreen> (X11 only)
=item C<fullscreen>

One of show, delay, or pushback.

Expand All @@ -806,7 +810,13 @@ Or pushback which is equivalent to delay with the difference that already
existing notifications are paused and hidden until the focus to the fullscreen
window is lost.

See B<layer> to change fullscreen behavior in Wayland
On wayland, if B<follow> is set to mouse or keyboard, the output where the
notification is located cannot be determined. So dunst will delay or pushback if
any of the outputs is fullscreen. Since the fullscreen protocol is fairly new,
you will need a recent version of a compositor that supports it. At the time of
writing, you will need the git version of sway.
See also B<layer> to change if notifications appear above fullscreen windows in
Wayland.

Default: show

Expand Down
4 changes: 4 additions & 0 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ void input_handle_click(unsigned int button, bool button_down, int mouse_x, int
case BTN_RIGHT:
acts = settings.mouse_right_click;
break;
case BTN_TOUCH:
// TODO Add separate action for touch
acts = settings.mouse_left_click;
break;
default:
LOG_W("Unsupported mouse button: '%d'", button);
return;
Expand Down
Loading

0 comments on commit 3acffdb

Please sign in to comment.