Compare commits

..

346 Commits

Author SHA1 Message Date
6da4a0db72 Merge branch 'main' of /home/mahesh/git/furnish/dwl_20240217 2024-02-17 18:53:45 -08:00
82ff3cb6e6 Added IPC v2 patch 2024-02-17 18:47:07 -08:00
Guido Cella
8006e79200
allow toggling the layout before selecting a different one 2024-02-07 02:23:33 +00:00
Leonardo Hernández Hernández
5ae245beed
fix minimum size
continuation of 4043fc3093
2024-02-07 02:21:26 +00:00
A Frederick Christensen
089480e0b6
Update and correct patches/patches-wiki links
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2024-02-06 19:53:13 -06:00
Benjamin Chausse
3c98c4c24d Fix link to patches website
Signed-off-by: Benjamin Chausse <benjamin@chausse.xyz>
2024-02-06 00:39:01 +00:00
Guido Cella
298949bbc4
place child clients above fullscreen clients
When a child window of a fullscreen client is mapped, the fullscreen is
disabled, and if the previously fullscreen client is floating the child
window is rendered below it and cannot be seen, causing confusion,
though it is still focused and interactable.

Fix this by putting children of fullscreen clients in LyrFS instead of
LyrFloat, and by returning before the unset_fullscreen code is called
when they are mapped.

focusstack() now lets you switch focus from a fullscreen client to its
child windows, otherwise if you switch focus from the child window to
the fullscreen client you could not focus the child window again and the
fullscreen client would stay unresponsive.

Child clients are not reparented to LyrFloat after leaving fullscreen,
so you could spawn a child window, focus back the fullscreen client,
unfullscreen it, and the child window would still be drawn above other
floating clients. Avoid dealing with this edge case to keep the line
count low.

These cases can be tested by pressing Ctrl+o in applications with an
open file dialog.
2024-02-05 16:00:28 -06:00
Guido Cella
17c5cbbf7b
make XWayland clients inherit tags and monitors
Revert 3213088 because the linked bug can no longer be reproduced with
wlroots 0.17, and update client_get_parent() so it doesn't segfault with
XWayland surfaces. This also allows reusing the p variable in the next
commit.
2024-02-05 15:59:46 -06:00
Guido Cella
45e3694fc8
remove useless wlr_scene_node_reparent() calls
These don't do anything because wlr_scene_node_reparent() is immediately
called again by setfloating() through setmon(). They are also a source
of confusion because if you change the wlr_scene_node_reparent() call in
applyrules() it takes a while to understand why it doesn't work.
2024-02-05 15:59:46 -06:00
Leonardo Hernández Hernández
5c936efc42
Revert "No need to call updatemons ourselves"
Fixes: https://codeberg.org/dwl/dwl/issues/577

This reverts commit 26d7c9689f.
2024-01-30 22:54:54 -06:00
A Frederick Christensen
9830a991ff
Correct specifier-data_type mismatches 2024-01-26 23:12:35 -06:00
Guido Cella
863634a61c
configure xwayland surfaces without monitors
For wine clients often configurex11() is called before mapnotify() and
therefore c->mon is NULL. configurex11 just returns early in that case,
letting these clients stay in the wrong size. For example only the top
left part of winecfg and wine uninstaller is drawn, or confirmation
dialogs like when closing wine notepad are too big. Fix this by
configuring their surfaces like before 88d386b.
2024-01-25 19:47:34 -06:00
Guido Cella
ac6074f4fd
implement the virtual pointer protocol
This is used by programs like warpd.
2024-01-25 17:13:01 +00:00
Leonardo Hernández Hernández
433385f7f1
do not arrange monitor if it's disabled (wlroots!4520)
This causes us to send negative values to xdg-configures (e.g a bug in our end)

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4520
(cherry picked from commit 4043fc3093)
2024-01-24 13:36:46 -06:00
Devin J. Pohly
26d7c9689f
No need to call updatemons ourselves
The output manager in wlroots emits an output_layout.change event when
anything changes, so updatemons will be called anyway.

ΔSLOC: -1
2024-01-20 21:51:20 -06:00
Leonardo Hernández Hernández
6c8be38ec4
drop unused variable 2024-01-15 02:19:02 +00:00
Leonardo Hernández Hernández
417e37f988
request description before logs 2024-01-15 02:15:54 +00:00
Leonardo Hernández Hernández
a1f3e25c35
turn on -Wfloat-conversion 2024-01-15 02:09:18 +00:00
Leonardo Hernández Hernández
0151bd48dd
turn on -Wsign-compare 2024-01-15 02:09:18 +00:00
A Frederick Christensen
337d6ba3fb
acknowledgements refactoring 2024-01-14 09:01:49 -06:00
Leonardo Hernández Hernández
ec557f253b
clarify the code will be kept as small as possible 2024-01-12 22:34:09 -06:00
choc
fd263041a0 check if monitor is null before setting gamma
fixes segfault on monitor disconnect when using wlsunset
2024-01-11 17:17:57 +08:00
Leonardo Hernández Hernández
a73afc66ab
drop SLOC limit 2024-01-10 20:50:34 -06:00
Leonardo Hernández Hernández
f5b046ce9e
prefer functionality over philosophy 2024-01-10 00:20:11 -06:00
Leonardo Hernández Hernández
6340989c8e
add acknowledgment to djpohly 2024-01-10 00:17:06 -06:00
Ben Jargowsky
25e34e4d0c Destroy fullscreen node after moving clients off mon 2024-01-06 17:34:08 -08:00
Leonardo Hernández Hernández
f3c4f72314
fix posible NULL-dereference in wl_surface.commit handler 2024-01-01 00:51:01 -06:00
Leonardo Hernández Hernández
6cbf8e9b80
unset DISPLAY before setting up xwayland 2023-12-27 11:19:03 -06:00
Leonardo Hernández Hernández
d13015381b
only execute the first keybinding 2023-12-27 11:18:24 -06:00
Leonardo Hernández Hernández
e277d84c51
more style fixes
missed from the previous iteration
2023-12-27 11:17:52 -06:00
Leonardo Hernández Hernández
1f0afcfc28
create a wlr_keyboard_group for virtual keyboards
Fixes: https://codeberg.org/dwl/dwl/issues/554
2023-12-25 21:19:59 -06:00
Leonardo Hernández Hernández
23fd312409
fix typo
Fixes: 7afdc191fe
Thanks to: David Donahue <david.donahue2996@gmail.com>
2023-12-18 14:08:09 -06:00
Leonardo Hernández Hernández
e39d931430
tie xdg_toplevel_decorations to Client
a xdg_toplevel can only have one xdg_toplevel_decoration so there is no need to
have a new struct for decorations
2023-12-18 12:59:47 -06:00
Leonardo Hernández Hernández
396840cdf2
Revert "nuke CSDs, hopefully for good!"
The compositor must respond to the client requesting a change to the decoration
mode, it does not matter if the compositor chooses a different mode.

This reverts commit 9071ce6c84.
2023-12-18 12:56:20 -06:00
Leonardo Hernández Hernández
a71b368483
Revert "remove typedef Decoration"
This reverts commit d1ff1e6f75.
2023-12-18 12:56:19 -06:00
Leonardo Hernández Hernández
7afdc191fe
style fixes 2023-12-17 21:42:50 +00:00
David Donahue
023efce6eb
use wlr_keyboard_group to manage all keyboards 2023-12-17 21:41:39 +00:00
Leonardo Hernández Hernández
fa660fb61e
check toplevel resources
it's just a aesthetic change
2023-12-12 22:21:32 -06:00
Dima Krasner
9a84789ff1
restore and respect rootcolor 2023-12-11 00:30:17 -06:00
Leonardo Hernández Hernández
49bfe92703
merge X11Managed and X11Unmanaged into X11
now that client_is_unmanaged() checks the wlr struct we don't need to keep
track of it ourselves
2023-12-10 23:46:49 -06:00
Leonardo Hernández Hernández
c88960751d
check if a client is unmanaged checking the o-r flag
it may change at any moment and I don't really want to add a listener for it
2023-12-10 23:46:40 -06:00
Leonardo Hernández Hernández
9c5bdcfbe8
do not blindly try to send motion events when pointer button is pressed
we don't have to do this if the surface is the same
2023-12-10 23:27:59 -06:00
Leonardo Hernández Hernández
1884a07646
sort LISTEN calls in createnotify{,x11} 2023-12-07 22:40:59 -06:00
Leonardo Hernández Hernández
79c51a4584
use the same style for urgent() and sethints() 2023-12-07 22:37:35 -06:00
Leonardo Hernández Hernández
f5d839844d
remove an unneeded cast in createpointer() 2023-12-07 22:37:00 -06:00
Leonardo Hernández Hernández
e03896b4d6
avoid duplication of lines
the output state is copied when creating a output configuration head
2023-12-07 22:18:49 -06:00
Leonardo Hernández Hernández
e7e84b1083
add explanation about why we try to re-apply the gamma LUT on output changes 2023-12-07 22:17:48 -06:00
Leonardo Hernández Hernández
9694477b2f
relax a bit the line length limit 2023-12-07 22:16:13 -06:00
Leonardo Hernández Hernández
6a15167754
add a blank line to improve readability 2023-12-07 22:15:42 -06:00
Leonardo Hernández Hernández
e5e2d1c28f
use (struct wlr_box){0} to empty the Monitor areas 2023-12-07 22:04:24 -06:00
Leonardo Hernández Hernández
bdbfb45d66
copy layout symbol when matching a MonitorRule 2023-12-07 21:51:24 -06:00
Leonardo Hernández Hernández
50ea84c5f6
remove extra blank line 2023-12-07 21:49:26 -06:00
Leonardo Hernández Hernández
472a31b5a4
LayerSurface::link -> LayerSurface.link 2023-12-07 21:48:56 -06:00
Leonardo Hernández Hernández
a760757b82
set the correct border color when mapping a client 2023-12-07 21:44:53 -06:00
Leonardo Hernández Hernández
80c9ad12ba
reduce calls to client_get_geometry 2023-12-07 21:43:48 -06:00
Leonardo Hernández Hernández
7341d047da
add a note about not removing the default rule
Closes: https://codeberg.org/dwl/dwl/issues/527
2023-12-07 14:20:49 -06:00
fictitiousexistence
be2a1dea26
Update README.md 2023-12-07 14:19:42 -06:00
Leonardo Hernández Hernández
393078d80c
store the layersurface pointer in l->popups->node.data as well 2023-12-07 14:19:09 -06:00
Leonardo Hernández Hernández
28ec843aee
make sure popups of a layer surface are in the correct layer
previously it worked because we checked in every commit the layer
in a353eee2ca and
b100b446b8
we changed the way it's handled and now if the layer surface does not change
the layer we don't it either. meaning that if it was created in the bottom
layer and did not change the layer the popups would show behind xdg clients
2023-12-07 14:19:02 -06:00
Leonardo Hernández Hernández
2b3504e439
sort #includes 2023-12-01 21:35:50 -06:00
Leonardo Hernández Hernández
5f7d396996
don't return early if the first output commit fails 2023-11-30 22:39:03 -06:00
Leonardo Hernández Hernández
901d2e2d9d
check failure of wlr_output_init_render 2023-11-30 22:38:52 -06:00
Leonardo Hernández Hernández
00e867d536
use detached output state in createmon()
see previous commit for motivation
2023-11-30 22:38:39 -06:00
Leonardo Hernández Hernández
2e29189b92
use a detached output state in outputmgrapplyortest()
wlr_output.pending might be removed in wlroots 0.18
2023-11-30 22:38:11 -06:00
Leonardo Hernández Hernández
43f31b8f1b
improve the bug report template
Fixes: https://codeberg.org/dwl/dwl/issues/498
2023-11-28 23:03:35 -06:00
Leonardo Hernández Hernández
ff39cac355
convert issue templates to yaml
also move the templates to .gitea to reflect the migration to Codeberg
2023-11-28 21:28:51 -06:00
Leonardo Hernández Hernández
2e4fdc1664
use l instead of layersurface
`layer_surface` instead of `wlr_layer_surface`
and `scene_layer` whenever a wlr_scene_tree is related to layer surfaces
2023-11-25 19:18:19 -06:00
Leonardo Hernández Hernández
b100b446b8
return early if a layersurface didn't commit something 2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández
9cb1ece6cc
do not check if a layer surface has monitor on commit
We do not allow creating them w/o monitor and they are destroyed when
destroying their monitor
2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández
01a237bd5c
send wl_surface.enter before initial commit
It's not necessary but it'll help clients to render a perfect first frame
2023-11-25 19:17:32 -06:00
Leonardo Hernández Hernández
a5e068b20a
destroy the layer-suface's scene tree for popups 2023-11-25 19:16:33 -06:00
Leonardo Hernández Hernández
39f4ee564b
use wlr_box_equal() instead of memcmp 2023-11-25 19:08:56 -06:00
Leonardo Hernández Hernández
a353eee2ca
simplify settings popups scene tree parent 2023-11-25 19:06:17 -06:00
Leonardo Hernández Hernández
66ec028b00
simplify check for wlr_layer_surface.output 2023-11-25 19:05:27 -06:00
Leonardo Hernández Hernández
1f10e69b4c
use sizeof(*pointer) instead of sizeof(struct) 2023-11-25 19:04:57 -06:00
Leonardo Hernández Hernández
922e117fc5
add new 'unreleased' section 2023-11-25 19:04:08 -06:00
Leonardo Hernández Hernández
2783e82bf8
make sure to unlink Monitor.request_state listener 2023-11-25 18:53:18 -06:00
Squibid
66ef4ecfec
Change github links to codeberg links in README.md 2023-11-25 10:54:56 -06:00
Leonardo Hernández Hernández
d08e6a3a7e
include CHANGELOG.md in the tarball
Fixes: 24576f1fdf
2023-11-25 01:22:48 -06:00
Leonardo Hernández Hernández
f579dd8668
bump version to 0.5 2023-11-25 00:28:11 -06:00
Leonardo Hernández Hernández
24576f1fdf
add CHANGELOG.md 2023-11-25 00:21:53 -06:00
Leonardo Hernández Hernández
7ac76219df
Merge branch 'wlroots-next' 2023-11-25 00:04:19 -06:00
Leonardo Hernández Hernández
6838f909bd
try to apply gamma LUT in updatemons
this in the case the output was re-enabled
2023-11-21 20:41:36 -06:00
Leonardo Hernández Hernández
d2dd2f4986
ignore wl_surface.commit for xwayland clients
This is no longer needed
2023-11-21 20:16:26 -06:00
Leonardo Hernández Hernández
a0e79d8145
Do not send repeated xdg_toplevel.configure_bounds
Fixes: 32e66f4582
2023-11-21 20:15:46 -06:00
Leonardo Hernández Hernández
32e66f4582
resize clients on commit
Fixes: https://github.com/djpohly/dwl/issues/515
This reverts commit 4567979b16.
2023-11-21 20:15:00 -06:00
link2xt
b4da97446a createkeyboard: do not segfault if xkb_keymap_new_from_names returns NULL
Passing NULL to wlr_keyboard_set_keymap results in a segfault.
Example:

  Thread 1 "dwl" received signal SIGSEGV, Segmentation fault.
  0x00007ffff7e49b64 in xkb_keymap_ref () from /usr/lib/libxkbcommon.so.0
  (gdb) bt
  #0  0x00007ffff7e49b64 in xkb_keymap_ref () at /usr/lib/libxkbcommon.so.0
  #1  0x00007ffff7f06389 in wlr_keyboard_set_keymap () at /usr/lib/libwlroots.so.11
  #2  0x000055555555bc54 in createkeyboard ()
  #3  0x000055555555c283 in inputdevice ()
  #4  0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
  #5  0x00007ffff7e8101e in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
  #6  0x00007ffff7edb52c in  () at /usr/lib/libwlroots.so.11
  #7  0x00007ffff7ee44b6 in  () at /usr/lib/libwlroots.so.11
  #8  0x000055555555fe66 in main ()
2023-11-19 01:14:35 -06:00
Leonardo Hernández Hernández
2751a6195d
do not try to enable adaptive sync 2023-11-18 11:20:56 -06:00
Leonardo Hernández Hernández
fcf324be6c
fix the position of the cursor image after turning all the monitors on 2023-11-17 19:03:23 -06:00
Leonardo Hernández Hernández
b8e933b9a9
remove unused #include 2023-11-17 11:03:33 -06:00
Leonardo Hernández Hernández
1044a21555
do not check if session is non-NULL
wlr_session_change_vt() is a no-op if session == NULL
2023-11-17 11:03:33 -06:00
Leonardo Hernández Hernández
6bcd5d8d87
do not explicitly destroy some wlroots interfaces
they are destroyed when the wayland display is destroyed
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
7611dc91d7
enable debug symbols by default
they does not affect performance and the size's increase is negligible
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
e95f14541a
fix docs
copied from tinywl
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
bca1b779aa
fix destroynotify() docs
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4421
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
7bdbab0400
check toplevel resource instead of client's xdg_shell to set bounds 2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
dd25cdb56e
use the new wlroots function to get a toplevel from a wlr_surface
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4419
2023-11-17 11:03:32 -06:00
Leonardo Hernández Hernández
caac2d664d
explicitly return -1 in the first check in toplevel_from_wlr_surface 2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
b1740056d5
do not use #ifdef -> #else -> #endif in client_is_x11
all other funcions use #ifdef -> #endif
2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
0067c76cab
delete unused functions 2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
22d21676b0
style fixes in client_is_float_type 2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
d6c102d9db
correctly check if the scene node is enabled in client_is_rendered_on_mon 2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
0e897608a1
do not use magical numbers to check edges
the interface is declared stable, which means we could just use 0 anyway
2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
6d0ec595d3
simplify client_get_clip
the clips for xwayland and xdg clients are pretty similar, after all we only
need to adjust x and y for xdg clients
2023-11-17 11:03:31 -06:00
Leonardo Hernández Hernández
4f4c540bb9
prevent a use-after-free at exit 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
8e3f5364d3
do not compute layout box twice 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
2212363225
make sure fullscreen clients have the right size 2023-11-17 11:03:30 -06:00
Leonardo Hernández Hernández
6f8a3f9374
fix screen artifacts when setting gamma
the artifacts were caused because we tried to set the gamma right after
receiving the event, this resulted in two pending page-flips, which
not always play well together.

This also seems to fix a screen freeze when turning on a monitor that has
gamma.

Additionally the current method won't work once [0] is merged

[0]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4423
2023-11-17 11:01:30 -06:00
Leonardo Hernández Hernández
e1f3983bf8
use wlr_scene_subsurface_tree_set_clip
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4131
Closes: https://github.com/djpohly/dwl/issues/411
2023-11-14 19:44:43 -06:00
Leonardo Hernández Hernández
31bf1cbaf6
Revert "respect size hints"
This reverts commit 72e0a560d9.
2023-11-14 19:44:28 -06:00
Leonardo Hernández Hernández
d6fabe3a15
add a comment about chvt keybindings
Closes: https://github.com/djpohly/dwl/issues/427
2023-11-01 12:44:16 -06:00
Leonardo Hernández Hernández
a4a83e95e6
use newer cursor naming spec
References: https://www.freedesktop.org/wiki/Specifications/cursor-spec/
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4416
2023-11-01 12:28:19 -06:00
Leonardo Hernández Hernández
e45ded7eea
ignore maximize events for clients using xdg-shell v5 and newer 2023-11-01 12:16:02 -06:00
Leonardo Hernández Hernández
e5e74acfce
send maximized if tiled isn't supported (XDG shell)
wlroots doesn't do it automatically anymore

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4409
2023-11-01 12:04:59 -06:00
Leonardo Hernández Hernández
892a4d3ec7
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-13 17:10:25 -06:00
Leonardo Hernández Hernández
ab87410023
clarify the dependencies needed by dwl
Note that previous df131cdb78 libX11 headers
were also required for building (but not for runtime)

Also, I want to apologize to the packagers for do not list *all* the required
dependencies before.
2023-10-11 20:08:44 -06:00
Leonardo Hernández Hernández
7085057f6d
update README.md
these things were changed in the code but not in the readme
2023-10-11 19:59:58 -06:00
Ben Collerson
8c79f8dc15
check client is mapped before setting border color
For some reason brave configured for as a wayland client triggers this code on startup and segfaults.

Checking if the client is mapped fixes this, like with the previous fix for urgent border colour.

References: 887fde65a3
Fixes: 72a7d78a1a
2023-10-10 10:16:11 -06:00
Leonardo Hernández Hernández
8781f4dbf5
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-09 22:37:36 -06:00
Leonardo Hernández Hernández
df131cdb78
use <xcb/xcb.h> instead of <X11/Xlib.h> 2023-10-09 22:33:37 -06:00
Leonardo Hernández Hernández
887fde65a3
only set border color for urgent *and* mapped X11 clients
this fixes a segfault when the client emits .set_hints but it's not mapped

Fixes: 72a7d78a1a
2023-10-09 22:32:15 -06:00
Leonardo Hernández Hernández
b299e01e44
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-10-09 11:45:51 -06:00
Leonardo Hernández Hernández
6d9a915fb6
Revert "just add define"
I'm going to make some changes in the config file anyway

This reverts commit e5367753bb.
2023-10-09 11:12:24 -06:00
Leonardo Hernández Hernández
935b852dc5
add [-d] flag to enable debug logging 2023-10-09 11:11:33 -06:00
Leonardo Hernández Hernández
a18c528300
simplify setting the border color of clients 2023-10-09 11:05:41 -06:00
Leonardo Hernández Hernández
72a7d78a1a
make the borders red borders for urgent clients
iirc this is the same behavior of dwm
2023-10-09 11:04:03 -06:00
Leonardo Hernández Hernández
d63f4078c5
use the same border colors as dwm 2023-10-09 11:03:06 -06:00
Leonardo Hernández Hernández
f4031590cd
add missing url about the COLOR macro 2023-10-05 22:06:30 -06:00
Leonardo Hernández Hernández
0ab1ed6530
add macro to configure colors
Closes: https://github.com/djpohly/dwl/issues/466
2023-10-05 22:03:59 -06:00
Forrest Bushstone
f695674361
Check if c is fullscreen before reparenting it to LyrFloating
Closes: https://github.com/djpohly/dwl/issues/487
2023-09-29 18:01:31 -06:00
Forrest Bushstone
aec21eca1f
make sure that fullscreen clients are on the correct screen when isfloating is true
Bug: https://github.com/djpohly/dwl/issues/487
2023-09-29 18:00:32 -06:00
Leonardo Hernández Hernández
342850487a
include dwl.desktop in the tarbal 2023-09-24 14:43:30 -06:00
Leonardo Hernández Hernández
1333f8cc6e
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-09-24 11:44:29 -06:00
Leonardo Hernández Hernández
5baf195523
allow specify DATADIR (to install desktop file) 2023-09-24 11:24:39 -06:00
Weiseguy
773bd04764 Add desktop entry file 2023-09-22 19:49:18 -06:00
Angelo Antony
755fcae2af fix typo 2023-09-10 10:42:33 -06:00
Leonardo Hernández Hernández
960c32a7d8
call setfloating in setmon
since in the previous commit we may not applying floating in clients
this is to make sure we do
2023-09-06 22:23:37 -06:00
Leonardo Hernández Hernández
aea8dd6ae1
return early if the client doesn't have monitor in setfloating
there is still a bug, but for now this prevents a segfault

Bug: https://github.com/djpohly/dwl/issues/472
2023-09-06 22:22:21 -06:00
Leonardo Hernández Hernández
c1d8b77f7f
prefer IRC over Discord
I regularly check the discord server, but it is much more likely that I will be
online on IRC, and djpohly does not seem to be active on either.
2023-08-23 00:32:15 -06:00
Ben Collerson
e5367753bb just add define 2023-08-22 22:20:39 -06:00
Ben Collerson
9be85c1117 tagcount should have been a #define 2023-08-22 22:20:39 -06:00
Leonardo Hernández Hernández
4b8c1bf31e
return nothing in xytonode()
we do not use the node
2023-08-22 14:48:29 -06:00
Devin J. Pohly
d7569870b6
Style: use early-return to clarify code
Use an early return to avoid indenting the main logic instead of
wrapping the tail of a function in an if statement.

No functional change, except for a handful of places where printstatus()
was being called spuriously (tag, toggletag, toggleview).

ΔSLOC: 0
2023-08-22 01:44:31 -06:00
Devin J. Pohly
4eb54b55f3
No need to send surface.leave/enter events
The scene graph implementation sends these for us, and it does so more
accurately than our overly-simplified approach.  Layer shell surfaces
don't appear to receive these events at all, according to my
WAYLAND_DEBUG experiments with bemenu and dtao.

ΔSLOC: -4
2023-08-22 01:44:31 -06:00
Leonardo Hernández Hernández
d4f2c6bfd6
chase wlroots!4288
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4288
2023-08-21 17:53:24 -06:00
Leonardo Hernández Hernández
4567979b16
don't resize clients on commit
It creates an infinite commit-resize loop when scale != 1
2023-08-18 21:37:22 -06:00
Leonardo Hernández Hernández
25db045392 set withdrawn state for xwayland invisible clients 2023-07-31 18:19:41 -06:00
Leonardo Hernández Hernández
78cf88670f add support for xdg-shell v6 2023-07-31 18:19:41 -06:00
Leonardo Hernández Hernández
ce997c4a21
update to xdg-shell v5 2023-07-23 21:15:06 -06:00
Leonardo Hernández Hernández
0e5405610e
add support for cursor-shape-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4106
2023-07-23 19:56:55 -06:00
Leonardo Hernández Hernández
0bb1a1cc5c
increase wl_compositor version
Now scene will handle sending the preferred buffer scale

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4269
2023-07-15 10:11:47 -06:00
Leonardo Hernández Hernández
aecff8cb26
Merge branch 'main' into wlroots-next 2023-07-13 22:36:48 -06:00
Leonardo Hernández Hernández
ca4a97b933 do not use wl_event_loop for signal handling
ΔSLOC: -4

Fixes: https://github.com/djpohly/dwl/issues/456
Fixes: https://github.com/djpohly/dwl/issues/459
2023-07-13 22:32:48 -06:00
Devin J. Pohly
76ba2cdab0 Remove now-unneeded call to motionnotify
This appears to have been here for the side effect of updating the drag
icon's position.
2023-07-13 22:17:03 -06:00
Devin J. Pohly
4b15bbeb33 Remove unused icon variable 2023-07-13 22:17:03 -06:00
Devin J. Pohly
831fc36bc9 Make drag_icon a persistent scene node
If there is no current drag icon, this node will be empty, but we now
have `drag_icon != NULL` as an invariant.  This allows us to eliminate a
conditional, since there's no harm in moving an empty node's coordinates
around with the pointer.

ΔSLOC: -1
2023-07-13 22:17:03 -06:00
Devin J. Pohly
1841527871 properly destroy scene
ΔSLOC: +1
2023-07-13 17:44:21 -06:00
Leonardo Hernández Hernández
ff7c0e9508
chase wlroots!4220
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4220
2023-07-10 11:23:19 -06:00
Devin J. Pohly
33bcd2e4ca Line saver: LISTEN_STATIC macro
This parallels the LISTEN macro for statically allocated listeners, and
it allows us to remove almost all of the global wl_listener
declarations.

This also fixes a bug with the axisnotify listener, which was declared
with a compound literal.  At block scope, these have automatic storage
duration [1], so the listener was no longer valid after setup()
returned.  (The option to declare it static explicitly was standardized
in C23, if that ever gains suckless traction.)

ΔSLOC: -27

[1]: https://en.cppreference.com/w/c/language/compound_literal#Explanation
2023-07-08 16:56:09 -06:00
Devin J. Pohly
fbd84aca4a Unify signal handling under wl_event_loop
Merge our signal handlers into a single function and let Wayland deal
with all the struct sigaction stuff.

ΔSLOC: -3
2023-07-03 22:28:27 -06:00
Devin J. Pohly
a01e402c5d Line saver: follow "local = wlr->data = obj" pattern
There were still a couple of places where we could use this handy
multiple assignment to save a line.

ΔSLOC = -3
2023-07-03 21:21:43 -06:00
Leonardo Hernández Hernández
9dd3f230c0
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-06-29 13:11:55 -06:00
Devin J. Pohly
eda0613cc4 Separate drag icon from layers array and Lyr enum
If we treat the drag icon as distinct from other layers (it doesn't have
contents that are interactive, focusable, etc.), then we can iterate
over layers meaningfully with a simple for loop.

ΔSLOC: -8
2023-06-25 17:44:00 -05:00
Leonardo Hernández Hernández
733114f0ca
schedule a frame after commmiting gamma
not doing it, may freeze the output or do not actually change the gamma until
creating a client
2023-06-24 10:09:49 -06:00
Leonardo Hernández Hernández
fdb66ccfa3
use detached output states to set gamma 2023-06-23 13:42:44 -06:00
Leonardo Hernández Hernández
6095ff84d2
Revert "use wlr_scene_output_build_state() to set gamma"
This reverts commit 65f68e7643.
2023-06-23 13:30:43 -06:00
Devin J. Pohly
68a17f962e Don't bother with ignoring SIGCHLD
It added complexity, especially with the differences in behavior between
handled and ignored signals across an exec().
2023-06-16 00:24:17 -06:00
Devin J. Pohly
9c592da01f Reset ignored signal handler in spawn() as well 2023-06-16 00:24:17 -06:00
Devin J. Pohly
df11b7a786 fix startup_cmd SIGCHLD handler
Ignored handlers are not reset by exec() calls
2023-06-16 00:24:17 -06:00
Leonardo Hernández Hernández
1e1811f953
drop KDE idle support
use ext-idle-notify-v1 instead
2023-06-15 12:32:31 -06:00
Leonardo Hernández Hernández
dfb6b97159
drop support for wlr-input-inhibitor-unstable-v1
deprecated in favor of ext-session-lock-v1

References: 4aa366e3dd
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3848
2023-06-15 12:27:34 -06:00
Leonardo Hernández Hernández
65f68e7643
use wlr_scene_output_build_state() to set gamma 2023-06-15 12:22:43 -06:00
Leonardo Hernández Hernández
96ab92cdb1
use wlr_cursor_set_xcursor()
This avoids re-upload the cursor image in each motion event

Managing the scale is done by the function itself

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4170
2023-06-15 12:12:22 -06:00
Leonardo Hernández Hernández
1eb8a82ac4
Revert "avoid setting duplicate cursor image"
This reverts commit b5776e5180.

See next commit for details
2023-06-15 12:02:30 -06:00
Leonardo Hernández Hernández
24a337e6ec
handle gamma-control-v1 set_gamma event
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
2023-06-08 23:35:46 -06:00
A Frederick Christensen
5215712cab Stray whitespace fixes 2023-06-07 17:47:36 -06:00
Leonardo Hernández Hernández
f3d017077a
use the new {a,di}ssociate events to handle xwayland commit listener 2023-06-02 22:08:17 -06:00
Leonardo Hernández Hernández
06bc65549f
chase wlroots map logic unification
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2023-06-02 22:03:41 -06:00
Leonardo Hernández Hernández
a8ccbe63f3
Merge branch 'main' into wlroots-next 2023-06-02 22:01:39 -06:00
Leonardo Hernández Hernández
9b9b79b35e
activate lock surface in updatemons
Fixes an issue when swaylock does not receive input after turn off and then
turn on the outputs
2023-06-02 21:56:09 -06:00
Leonardo Hernández Hernández
3d98907b98
send frame done even if output commit fails
Bug: https://github.com/djpohly/dwl/issues/420
Fixes: https://github.com/djpohly/dwl/issues/353
2023-06-02 21:51:47 -06:00
Nikita Ivanov
f8884ffc2b Set XCURSOR_SIZE 2023-06-01 19:11:33 -06:00
Leonardo Hernández Hernández
a5e45924ed
remove note about contact me for patch issues
I am no longer able to spend much time developing dwl let alone maintaining
other's patches :)
2023-05-28 00:20:20 -06:00
Leonardo Hernández Hernández
72adab621f destroy old client popups when focusing another client
Closes: https://github.com/djpohly/dwl/issues/408
2023-05-27 23:29:05 -06:00
Micah Gorrell
0729f18dce Prevent using a wlr_layer_surface after destroying it, due to no available outputs 2023-05-25 21:21:56 -06:00
Leonardo Hernández Hernández
2d1a40caf2
pass version to wlr_compositor_create()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3696
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2023-04-14 12:25:05 -06:00
Leonardo Hernández Hernández
733754bb06
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-04-14 12:24:19 -06:00
Leonardo Hernández Hernández
797e0c74b2
correctly check if a scene node is enabled
checking only wlr_scene_node.enabled may result in a false positive because it
does not consider if its ancestors are enabled as well.
2023-04-13 13:12:27 -06:00
Leonardo Hernández Hernández
3c760bcd4a
remove unneeded check of m in arrange()
arrange must never be called with a NULL argument
2023-04-13 13:12:27 -06:00
Ben Collerson
da77e34ee5 Use uint32_t for ui Arg 2023-04-09 17:09:35 -06:00
Leonardo Hernández Hernández
20f61a59af
use fixed-size type for client tags
while the size of `int` in most compilers is 32-bits, the size of int and all
other integer types are implementation defined, so make sure we can use up to
32-bits
2023-04-08 11:29:18 -06:00
Ben Collerson
9d68554c59
remove tag labels from dwl
Tag labels are not used in dwl. Only the number of tags is important.
Tag labels should be defined for each tag in whatever status bar is
used.
2023-04-08 11:27:49 -06:00
Yves Zoundi
bbdf2a913b
display clients count in monocle symbol
- Replicate missing functionality from dwl to display the client count in monocle mode
  - Add ltsymbol field to Monitor struct
  - Display client count in monocle mode when greater than zero
- Tested with somebar and dwlb
2023-03-16 00:02:14 -06:00
Palanix
21930621ee Remove rootcolor 2023-03-13 09:40:40 -06:00
A Frederick Christensen
6722a89532 Missing apostrophe 2023-03-07 22:17:05 -06:00
Leonardo Hernández Hernández
eaf6dd2cd2
do not call dmabuf_create twice
it is called automatically by `wlr_renderer_init_wl_display()` but since we
need a pointer to wlr_linux_dmabuf_v1 to integrate it with scene API we need
to recreate that function.

Bug: https://github.com/emersion/xdg-desktop-portal-wlr/issues/216
Fixes: https://github.com/djpohly/dwl/issues/398
2023-03-07 22:04:32 -06:00
gan-of-culture
e4921fad28
add missing comma in "MonitorRule"
add a missing comma for the example
2023-02-25 15:59:23 -06:00
Leonardo Hernández Hernández
d1b36925c9
add support for linux-dmabuf-unstable-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3726
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
2023-02-20 21:24:18 -06:00
godalming123
c69a2bec3f Fix spacing and replace it with tabs 2023-02-18 18:47:44 -06:00
godalming123
737688a6b1 fix spelling 2023-02-18 18:47:44 -06:00
Leonardo Hernández Hernández
fefcdbed4a
Merge remote-tracking branch 'upstream/main' into wlroots-next 2023-02-13 13:46:41 -06:00
pino-desktop
f8373ccf25
Fixed 'unused variable' compiler warning. 2023-02-13 13:43:28 -06:00
Ben Collerson
7f9a212476
Add appid field to printstatus() output
Adds an appid field to printstatus which can be used to monitor the
currently active application.
2023-02-13 13:30:27 -06:00
Leonardo Hernández Hernández
ab8334bd8a
implement repeatable keybindings 2023-02-13 13:18:43 -06:00
Leonardo Hernández Hernández
23ede80f74
allow configure x and y of outputs 2023-02-13 13:14:29 -06:00
Leonardo Hernández Hernández
04fdf1a295
add support for wp-fractional-scale-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
2023-02-08 22:25:41 -06:00
Leonardo Hernández Hernández
fbe89a929f
chase wlroots!4000
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4000
2023-02-05 10:03:09 -06:00
Leonardo Hernández Hernández
e7f736ccc9
chase wlroots!3391
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
2023-02-02 10:30:24 -06:00
Job79
7ae5039b4f follow upstream xwayland_surface changes
wlroots removed the `wlr_surface_is_xwayland_surface` function, and renamed `wlr_xwayland_surface_from_wlr_surface` to `wlr_xwayland_surface_try_from_wlr_surface`.

related commit: fbf5982e38
2023-02-01 14:16:54 -06:00
Leonardo Hernández Hernández
f7d6a34cd9
use sigaction(2) for signal handling
References: http://git.suckless.org/dwm/commit/712d6639ff8e863560328131bbb92b248dc9cde7.html
2023-01-30 23:26:32 -06:00
Leonardo Hernández Hernández
cf9c5745e5
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-12-30 15:29:12 -06:00
Leonardo Hernández Hernández
8653b27692
bump version to 0.4 2022-12-30 14:46:52 -06:00
Leonardo Hernández Hernández
932c1d45f2
remove --long from git-describe command 2022-12-30 14:46:34 -06:00
Leonardo Hernández Hernández
dbe44e48c8
return early if selmon is not part of the output layout in dirtomon()
instead of checking twice
2022-12-30 14:31:56 -06:00
Leonardo Hernández Hernández
0b2c33248c
simplify check in urgent()
we only care if it returned a client or not
2022-12-30 14:29:19 -06:00
Leonardo Hernández Hernández
56114f700f
arrange monitor after updating fullscreen background and lock surfaces 2022-12-30 14:26:53 -06:00
Leonardo Hernández Hernández
71c7e4e1e5
also update locked_bg node position in updatemons() 2022-12-30 14:25:19 -06:00
Leonardo Hernández Hernández
72d29f1654
add blank lines to make updatemons() more readable 2022-12-30 14:21:46 -06:00
Leonardo Hernández Hernández
e523c2b82b
update comment about client_set_size() as no-op 2022-12-30 14:19:47 -06:00
Leonardo Hernández Hernández
6d0e3a5198
check if a client is resizing before checking if it's visible
It's not like it's noticeable, but theoretically this is faster
2022-12-30 14:15:21 -06:00
Leonardo Hernández Hernández
5347ed663d
only mark pending resizes as completed checking the configure serial 2022-12-30 14:14:06 -06:00
Leonardo Hernández Hernández
b39d270b9f
Merge branch 'main' into wlroots-next 2022-12-24 18:04:41 -06:00
Leonardo Hernández Hernández
05f4e23c43
bump version to 0.4-rc3 2022-12-24 17:54:19 -06:00
Leonardo Hernández Hernández
be854cab35
do not try to resize if size wouldn't change 2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández
6ca011430a
do not skip frames if a client is stopped and have a pending resize 2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández
7eaa01ac1f
Revert "Revert "fix flickering when resizing/spawning windows""
This reverts commit 4a32293548.
2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández
92e7752203
disable client's scene node after create it (only XDGShell)
will be enabled when setting up its monitor and arrange it

Bug: https://github.com/djpohly/dwl/issues/306
2022-12-24 16:44:09 -06:00
Leonardo Hernández Hernández
6682878009
call arrange() or resize() depending on c->isfloating in commitnotify 2022-12-24 16:43:31 -06:00
Leonardo Hernández Hernández
afacc9b0b5
force SSD when creating an xdg_toplevel_decoration object
Closes: https://github.com/djpohly/dwl/issues/366
Not sure why GLFW apps do not get mapped when we do not tell them the
decoration method
2022-12-20 21:53:45 -06:00
Leonardo Hernández Hernández
dd9d8d543c
remove selclient()
selclient() does not work well when dealing newly mapped
clients (specifically those mapped on invisible tags).

This fixes various bugs related to things not working because selclient() would
return NULL.

References: 94c8bd6048
2022-12-20 21:27:14 -06:00
Leonardo Hernández Hernández
686958a4cc
fix unset fullscreen for all visible clients when mapping a new one
this also changes our policy about when we unset fullscreen:

dwl will unset fullscreen for clients who share tags (and monitor) with a newly
mapped client, it does not matter if the clients are visible or not
2022-12-20 21:21:40 -06:00
Leonardo Hernández Hernández
1a3d89e5b2
call checkidleinhibitor() in arrange() and not in focusclient() 2022-12-16 18:54:33 -06:00
Leonardo Hernández Hernández
7b1fe7e5f2
fix checking idle inhibit state
checking `bypass_surface_visibility` first, could cause that even if the idle
inhibitor is being destroyed it will disable idle tracking

and if we couldn't get its scene tree, then assume that the surface is visible
2022-12-16 17:37:18 -06:00
Leonardo Hernández Hernández
803a9ba98d
Revert "Revert "Check that inhibitor scene tree is not null""
This reverts commit 035bb99d67.

Not checking `tree != NULL` result in a segfault if the surface doesn't have a
role (for example because it is a newly created surface)

Closes: https://github.com/djpohly/dwl/issues/359
2022-12-16 17:20:59 -06:00
Ben Jargowsky
a39a46c908 Check width and height are not negative in client_set_bounds() 2022-12-15 23:42:53 -06:00
Leonardo Hernández Hernández
94c8bd6048
get sel from focustop() in focusstack()
Fixes: https://github.com/djpohly/dwl/issues/354
2022-12-09 20:55:58 -06:00
Leonardo Hernández Hernández
c60f651951
Revert "force line-buffered stdout if stdout is not a tty"
This reverts commit deb48ff48b.

Fixes: https://github.com/djpohly/dwl/issues/253
2022-12-09 08:46:22 -06:00
Leonardo Hernández Hernández
98c7adfb3d
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-12-06 14:21:44 -06:00
Leonardo Hernández Hernández
79b051f242
implement ext-session-lock-v1 2022-12-06 14:11:41 -06:00
Leonardo Hernández Hernández
d42a977b5b
Revert "remove unneeded changes in commitnotify()"
This reverts commit 30c24a53ad.

Bug: https://github.com/djpohly/dwl/issues/349
2022-12-06 13:59:14 -06:00
Leonardo Hernández Hernández
4a32293548
Revert "fix flickering when resizing/spawning windows"
This reverts commit 017bb7d752.

Bug: https://github.com/djpohly/dwl/issues/349
2022-12-06 13:58:56 -06:00
Leonardo Hernández Hernández
9136b6247d
return early if couldn't find the popup's parent 2022-12-06 13:34:35 -06:00
Leonardo Hernández Hernández
19b5d47a9e
fix popups appearing outside the monitor
and a potentially crash
2022-12-06 13:31:48 -06:00
Leonardo Hernández Hernández
b5229636a3
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-12-05 23:43:47 -06:00
Leonardo Hernández Hernández
c9a0a8bf6d
bump version to 0.4-rc2 2022-12-05 23:21:21 -06:00
Leonardo Hernández Hernández
22336612ae
improve type safety of toplevel_from_wlr_surface() 2022-12-05 23:18:02 -06:00
Leonardo Hernández Hernández
38bd00351a
merge toplevel_from_{wlr_layer_surface,popup} into client_from_wlr_surface
now it is a big function called toplevel_from_wlr_surface
2022-12-05 23:18:01 -06:00
Leonardo Hernández Hernández
c56bc42eb5
sort client_get_parent() 2022-12-05 23:18:01 -06:00
Leonardo Hernández Hernández
13b929d7d7
remove unneeded call to wlr_scene_rect_set_color()
wlr_scene_rect_create() requires a color as parameter
2022-12-05 23:06:53 -06:00
Leonardo Hernández Hernández
b6d6127733
add option for set button map 2022-12-05 22:22:49 -06:00
Leonardo Hernández Hernández
02c257e0b1
update for wlroots!3627
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3627
2022-12-05 20:21:38 -06:00
Dima Krasner
16a49e9955 fix null deref in sigchld() if Xwayland is disabled 2022-12-03 13:30:30 -06:00
Palanix
30c24a53ad
remove unneeded changes in commitnotify() 2022-12-03 13:14:10 -06:00
Palanix
017bb7d752
fix flickering when resizing/spawning windows
Fixes: https://github.com/djpohly/dwl/issues/306
2022-12-03 13:14:10 -06:00
Leonardo Hernández Hernández
fac3b6f2cf
use root surfaces to check idle inhibitors
References: https://github.com/djpohly/dwl/pull/343
2022-12-02 23:25:46 -06:00
Leonardo Hernández Hernández
035bb99d67
Revert "Check that inhibitor scene tree is not null"
This reverts commit 9c155eefdc.

This commit was applied just a workaround, the proper fix is the next commit
2022-12-02 23:25:04 -06:00
Leonardo Hernández Hernández
27ab9cf1b1
call updatemons() in requestmonstate()
This way we make sure that the Monitor's boxes are updated correctly
2022-12-02 23:17:05 -06:00
Ben Jargowsky
9c155eefdc Check that inhibitor scene tree is not null 2022-12-02 15:10:25 -06:00
Jan Beich
df34fdd483 chase default terminal in manpage after 7710cf050d 2022-12-02 10:52:34 -06:00
Leonardo Hernández Hernández
1b39bbf316
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-12-02 10:39:06 -06:00
Leonardo Hernández Hernández
4c6050331e
bump version to 0.4-rc1 2022-12-02 10:12:16 -06:00
Leonardo Hernández Hernández
eaf8a21603
unset fullscreen when mapping a client in the same monitor
Fixes: https://github.com/djpohly/dwl/issues/327
2022-12-02 10:09:50 -06:00
Leonardo Hernández Hernández
f929eaef1e
ask for version instead of commit in bug reports 2022-12-02 10:08:18 -06:00
Leonardo Hernández Hernández
ce1d040586
Merge branch 'main' of github.com:djpohly/dwl 2022-12-02 10:06:40 -06:00
Leonardo Hernández Hernández
b4fb1f77c7
fix xwayland clients being floating by default
Fix 3213088aa2
References: https://github.com/djpohly/dwl/pull/334#issuecomment-1333147730
2022-12-01 20:51:00 -06:00
Leonardo Hernández Hernández
6df6781b43
simplify check for surface's node state
all `struct wlr_surface` should have a `wlr_scene_tree *` as data
2022-11-30 18:54:54 -06:00
Leonardo Hernández Hernández
10c56d6348
add option to allow invisible surfaces to disable idle tracking 2022-11-30 18:51:35 -06:00
Leonardo Hernández Hernández
c91d21b68f
do not move/resize if grabbed client is fullscreen 2022-11-30 17:54:47 -06:00
Leonardo Hernández Hernández
3213088aa2
do not try to set the parent's same tags and monitor for xwayland clients
References: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324
2022-11-30 17:42:58 -06:00
Leonardo Hernández Hernández
ea1b2dda63
Merge branch 'main' into wlroots-next 2022-11-21 20:51:30 -06:00
Leonardo Hernández Hernández
087373698a
Revert "Add a configuration option for fullscreen locking"
now all fullcreen clients are rendered above tiled and floating clients

This partially reverts commit 326eee1444.
2022-11-21 20:50:39 -06:00
Leonardo Hernández Hernández
caec566286
create a dedicated layer for fullscreen clients
Bug: https://github.com/djpohly/dwl/issues/327
2022-11-21 20:50:26 -06:00
Leonardo Hernández Hernández
05eca0e2d9
rename xwayland_surface to xsurface
this save us 2 lines
2022-11-21 14:28:05 -06:00
Leonardo Hernández Hernández
7eebe67787
set x and y of the layersurface's geometry box 2022-11-21 14:28:05 -06:00
Leonardo Hernández Hernández
63d6de5866
fix set of layersurface->popups and surface->data 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández
60a98b87f3
inhibit idle if surface's node is enabled 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández
93a911d6e9
simplify if expression in checkidleinhibitor() 2022-11-21 14:28:04 -06:00
Leonardo Hernández Hernández
88d386bfdc
configurex11: resize floating clients and arrange tiled clients' monitor 2022-11-21 14:27:57 -06:00
Leonardo Hernández Hernández
972e3f3050
Merge branch 'wlroots-next' into main 2022-11-21 14:16:55 -06:00
Leonardo Hernández Hernández
21ef004886
listen to the output request_state event;
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2693
2022-11-15 23:52:21 -06:00
Leonardo Hernández Hernández
dae00caadd
update for wlroots!3861
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3861
2022-11-15 23:07:45 -06:00
Leonardo Hernández Hernández
5eb3529275
use the new scene helper for drag icons 2022-11-15 23:07:21 -06:00
Leonardo Hernández Hernández
359e7edc52
update for wlroots!3814
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3814
2022-11-15 23:04:39 -06:00
Leonardo Hernández Hernández
25dfdcc433
specify layer shell version 2022-11-15 23:04:02 -06:00
Leonardo Hernández Hernández
fcb3fa4e90
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-11-10 23:25:48 -06:00
Leonardo Hernández Hernández
448a96de13
remove now unneeded workaround in outputmgrapplyortest() 2022-10-30 01:03:44 -05:00
Leonardo Hernández Hernández
99f062273e
only destroy monitor's layer surfaces at destroy 2022-10-29 19:02:44 -05:00
Leonardo Hernández Hernández
8298f20a71
allow change adaptive sync in outputmgrapplyortest() 2022-10-29 18:30:09 -05:00
Leonardo Hernández Hernández
6a0ec2a8c3
Merge remote-tracking branch 'upstream/main' into wlroots-next 2022-10-29 18:11:28 -05:00
Leonardo Hernández Hernández
1eeb3689d3
add support for the ext-idle-notify-v1 protocol
for now we use macros to support both KDE idle and ext-idle, wlroots will
likely drop support for KDE idle in 0.17
2022-10-23 14:41:28 -05:00
Leonardo Hernández Hernández
434ed119f3
wlroots check map state of layersurfaces this for us 2022-10-01 23:33:17 -05:00
Leonardo Hernández Hernández
ae3d435717
Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-10-01 23:30:47 -05:00
Leonardo Hernández Hernández
d11358762d
add missing library (xcb-icccm)
this library is also used by wlroots, so nothing new
2022-09-18 15:49:30 -05:00
Leonardo Hernández Hernández
dc59f7733d
enable adaptive sync if supported
but don't cause monitors to be ignored if it fails
2022-09-06 00:35:20 -05:00
Leonardo Hernández Hernández
83e37820d7
add support for the single pixel buffer protocol 2022-08-28 22:15:57 -05:00
Leonardo Hernández Hernández
e0cc5b046c
Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-08-26 18:26:36 -05:00
Leonardo Hernández Hernández
058c699ac2
only set bounds for clients that support it 2022-07-15 00:27:31 -05:00
Leonardo Hernández Hernández
461d02d3e0
chase wlroots input_device changes 2022-06-21 16:25:18 -05:00
Leonardo Hernández Hernández
a32db11f16
set client bounds at resize 2022-06-09 12:45:42 -05:00
Leonardo Hernández Hernández
948fdcf709
use xdg-shell v4 2022-06-09 12:45:02 -05:00
Leonardo Hernández Hernández
4b890336e2
use xdg-shell v3 2022-06-07 00:55:41 -05:00
Leonardo Hernández Hernández
c7007b4811
chase wlroots scene-tree changes 2022-06-07 00:31:58 -05:00
Leonardo Hernández Hernández
283c043b5c
chase wlroots scene-surface refactor 2022-05-21 20:44:08 -05:00
Leonardo Hernández Hernández
88a8b784d0
Merge remote-tracking branch 'djpohly/main' into wlroots-next
chase wlroots X11 hints update
2022-05-17 15:31:31 -05:00
Leonardo Hernández Hernández
79a148224f
specify version in wlr_xdg_shell_create() 2022-05-15 17:17:58 -05:00
Leonardo Hernández Hernández
dca68f9aa1
Merge remote-tracking branch 'djpohly/main' into wlroots-next 2022-05-10 20:08:41 -05:00
Leonardo Hernández Hernández
31fa6600a1
replace wlr_xwayland_surface_size_hints with xcb_size_hints_t 2022-05-08 17:51:42 -05:00
Leonardo Hernández Hernández
dc7709a00e
schedule a configure on maximize request
see maximizenotify() for more info
2022-04-16 15:51:13 -05:00
Leonardo Hernández Hernández
4a2e761914
replace deleted EBARF() with die() 2022-04-12 23:52:05 -05:00
Leonardo Hernández Hernández
29a2b647b2
Merge remote-tracking branch 'djpohly/main' into HEAD 2022-04-08 21:12:32 -05:00
Devin J. Pohly
dd0b8e4c37
Merge pull request #212 from djpohly/xwaitland
make sure to leave XWayland process waitable
2022-03-29 16:22:44 -05:00
Devin J. Pohly
0ddde0c85a move sigchld() into XWayland section 2022-03-29 16:09:29 -05:00
Devin J. Pohly
e08bd12922 make sure to leave XWayland process waitable
On SIGCHLD, check to make sure the terminated process is not the
XWayland process before reaping it, allowing wlroots to waitpid() for it
successfully.

Fixes #177.
2022-03-29 15:55:06 -05:00
Leonardo Hernández Hernández
7018ed9218
createpointer now takes wlr_pointer 2022-03-25 15:27:36 -06:00
Leonardo Hernández Hernández
f75e426222
createkeyboard now takes wlr_keyboard 2022-03-25 15:27:36 -06:00
Leonardo Hernández Hernández
faaee90cbd
destroy scene_output in cleanupmon() 2022-03-23 18:22:41 -06:00
Leonardo Hernández Hernández
3e79a9a5d7
fix drag icon's surface returned by xytonode 2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández
c2899bc00b
set position of the drag icon in startdrag() 2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández
f353a0e759
Revert "clients now works as expected in drag motion"
This reverts commit 9aec6049ec.

this problem is caused because xytonode() returns the surface of the
drag icon
2022-03-23 18:22:40 -06:00
Guido Cella
281c947e5f
inline the presentation variable
This variable can be removed since with scene-graph
wlr_presentation_surface_sampled_on_output no longer needs to be called.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández
855e6c1898
add note about how to change MODKEY for windows key 2022-03-23 18:22:40 -06:00
Palanix
a41d6cb00f
Fix dwl freezing when resizing 2022-03-23 18:22:40 -06:00
Quentin Rameau
b42abeac69
Add a configuration option for fullscreen locking
Some people are annoyed to have this new behaviour forced for some
application which use fake fullscreen.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández
5a1debb5f0
add sway LICENSE file
part of the code in dwl is taken from sway, so credit it.
dwm and sway are both licensed under the MIT license
2022-03-23 18:22:40 -06:00
Guido Cella
1a5b7e068b
update IRC channel 2022-03-23 18:22:40 -06:00
Humm
0db6f3c5b5
add dwl(1)
Documentation is good.  Man pages are documentation.  A program without
a man page is worthless.
2022-03-23 18:22:40 -06:00
Leonardo Hernández Hernández
d8ab893dab
clients now works as expected in drag motion 2022-03-23 18:22:40 -06:00
Guido Cella
f2be10fd43
implement drag and drop
For brevity, only a single drag icon at a time is supported.

Co-authored-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-23 18:22:39 -06:00
Sevz
23af627d80
Update issue templates 2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández
a7f7777907
only skip frames if there are visible clients that have a resize 2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández
40db9c88ea
remove a useless resize in mapnotify()
applyrules() calls setmon() which calls resize()
2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández
4276410a3d
improve floating detection
mostly copied from sway
2022-03-23 18:22:39 -06:00
Leonardo Hernández Hernández
0662bc5a69
wlr_seat_set_keyboard() now takes wlr_keyboard as parameter 2022-03-23 09:01:01 -06:00
Leonardo Hernández Hernández
a66210ebbc
Merge branch 'main' into wlroots-next 2022-03-20 16:02:18 -06:00
Leonardo Hernández Hernández
c8290f8c55
Merge branch 'wlroots-next' into scenegraph-wlroots-next 2022-03-18 17:21:41 -06:00
Leonardo Hernández Hernández
98f33cd01d
follow up wlroots input device events renaming 2022-03-18 17:20:31 -06:00
Leonardo Hernandez Hernandez
a7c4f6100a
use scene layer shell helper 2022-03-11 16:03:58 -06:00
Leonardo Hernández Hernández
3577802541
Merge branch 'wlroots-next' into scenegraph-wlroots-next 2022-03-11 16:02:00 -06:00
Leonardo Hernández Hernández
230d3432e9
wlr_virtual_keyboard_v1 now has its own wlr_keyboard
which has its own wlr_input_device

Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-10 10:37:18 -06:00
Leonardo Hernández Hernández
432c15fb09
Merge branch 'main' into wlroots-next 2022-03-10 10:34:43 -06:00
Sevz
2630664fef
Merge pull request #193 from fauxmight/chasing-wlroots
Chasing wlroots
2022-03-10 10:11:17 -06:00
A Frederick Christensen
76b3756d11 Merge remote-tracking branch 'origin/wlroots-xdg-shell-refactor' into chasing-wlroots 2022-02-03 23:23:53 -06:00
A Frederick Christensen
97881c88c7 Merge remote-tracking branch 'origin/output-layout-get-box-update' into chasing-wlroots 2022-02-03 23:22:19 -06:00
A Frederick Christensen
b8ce8d0fbb Account for changes expecting wlr_xdg_toplevel rather than wlr_xdg_surface 2022-02-03 21:54:44 -06:00
A Frederick Christensen
ed44bc0c90 update wlr-output-layout-get-box 2022-02-02 23:18:58 -06:00
A Frederick Christensen
3300f6c911 Upgrade for wlroots surface refactoring
See [1] for details.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3412
2022-01-18 11:33:56 -06:00
15 changed files with 2643 additions and 1316 deletions

View File

@ -0,0 +1,62 @@
name: Bug Report
about: Something in dwl isn't working correctly
title:
labels:
- 'Kind/Bug'
body:
- type: markdown
attributes:
value: |
- Only report bugs that can be reproduced on the main (or wlroots-next) branch without patches.
- Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use dwl.
- Report patch issues to their respective authors.
- type: input
id: dwl_version
attributes:
label: 'dwl version:'
placeholder: '`dwl -v`'
validations:
required: true
- type: input
id: wlroots_version
attributes:
label: 'wlroots version:'
validations:
required: true
- type: input
id: distro
attributes:
label: What distro (and version) are you using?
validations:
required: false
- type: textarea
attributes:
label: Description
value: |
The steps you took to reproduce the problem.
validations:
required: false
- type: textarea
id: debug_log
attributes:
label: Debug Log
value: |
Run `dwl -d 2> ~/dwl.log` from a TTY and attach the **full** (do not truncate it) file here, or upload it to a pastebin.
Please try to keep the reproduction as brief as possible and exit dwl.
validations:
required: false
- type: textarea
id: backtrace
attributes:
label: Stack Trace
value: |
- Only required if dwl crashes.
- If the lines mentioning dwl or wlroots have `??`. Please compile both dwl and wlroots from source (enabling debug symbols) and try to reproduce.
validations:
required: false

View File

@ -0,0 +1,9 @@
name: Enhancement idea
about: Suggest a feature or improvement
title:
labels:
- 'Kind/Feature'
body:
- type: textarea
attributes:
label: Description

View File

@ -1,22 +0,0 @@
---
name: Bug report
about: Something in dwl isn't working correctly
title: ''
labels: 'A: bug'
assignees: ''
---
## Info
dwl's commit:
wlroots version:
## Description
<!--
Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors
If the patch author doesn't respond within a reasonable time, email me:
Leonardo Hernández Hernández <leohdz172@protonmail.com>
but note that I'm NOT making any promises
-->

View File

@ -1,10 +0,0 @@
---
name: Enhancement idea
about: Suggest a feature or improvement
title: ''
labels: 'A: enhancement'
assignees: ''
---

110
CHANGELOG.md Normal file
View File

@ -0,0 +1,110 @@
# Changelog
* [Unreleased](#unreleased)
* [0.5](#0.5)
## Unreleased
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
### Contributors
## 0.5
### Added
* Allow configure x and y position of outputs ([#301][301])
* Implement repeatable keybindings ([#368][368])
* Print app id in printstatus() output ([#381][381])
* Display client count in monocle symbol ([#387][387])
* Export XCURSOR_SIZE to fix apps using an older version of Qt ([#425][425])
* Support for wp-fractional-scale-v1 (through wlr_scene: [wlroots!3511][wlroots!3511])
* dwl now sends `wl_surface.preferred_buffer_scale` (through wlr_scene: [wlroots!4269][wlroots!4269])
* Add support for xdg-shell v6 ([#465][465])
* Add support for wp-cursor-shape-v1 ([#444][444])
* Add desktop file ([#484][484])
* Add macro to easily configure colors ([#466][466])
* Color of urgent clients are now red ([#494][494])
* New flag `-d` and option `log_level` to change the wlroots debug level
* Add CHANGELOG.md ([#501][501])
[301]: https://github.com/djpohly/dwl/pull/301
[368]: https://github.com/djpohly/dwl/pull/368
[381]: https://github.com/djpohly/dwl/pull/381
[387]: https://github.com/djpohly/dwl/issues/387
[425]: https://github.com/djpohly/dwl/pull/425
[wlroots!4269]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4269
[wlroots!3511]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
[465]: https://github.com/djpohly/dwl/pull/465
[444]: https://github.com/djpohly/dwl/pull/444
[484]: https://github.com/djpohly/dwl/pull/484
[466]: https://github.com/djpohly/dwl/issues/466
[494]: https://github.com/djpohly/dwl/pull/494
[501]: https://github.com/djpohly/dwl/pull/501
### Changed
* Replace `tags` with `TAGCOUNT` in config.def.h ([#403][403])
* Pop ups are now destroyed when focusing another client ([#408][408])
* dwl does not longer respect size hints, instead clip windows if they are
larger than they should be ([#455][455])
* The version of wlr-layer-shell-unstable-v1 was lowered to 3 (from 4)
* Use the same border color as dwm ([#494][494])
[403]: https://github.com/djpohly/dwl/pull/403
[408]: https://github.com/djpohly/dwl/pull/409
[455]: https://github.com/djpohly/dwl/pull/455
[494]: https://github.com/djpohly/dwl/pull/494
### Removed
* Remove unused `rootcolor` option ([#401][401])
* Remove support for wlr-input-inhibitor-unstable-v1 ([#430][430])
* Remove support for KDE idle protocol ([#431][431])
[401]: https://github.com/djpohly/dwl/pull/401
[430]: https://github.com/djpohly/dwl/pull/430
[431]: https://github.com/djpohly/dwl/pull/431
### Fixed
* Fix crash when creating a layer surface with all outputs disabled
([#421][421])
* Fix other clients being shown as focused if the focused client have pop ups
open ([#408][408])
* Resize fullscreen clients when updating monitor mode
* dwl no longer crash at exit like sometimes did
* Fullscreen background appearing above clients ([#487][487])
* Fix a segfault when user provides invalid xkb_rules ([#518][518])
[421]: https://github.com/djpohly/dwl/pull/421
[408]: https://github.com/djpohly/dwl/issues/408
[487]: https://github.com/djpohly/dwl/issues/487
[518]: https://github.com/djpohly/dwl/pull/518
### Contributors
* A Frederick Christensen
* Angelo Antony
* Ben Collerson
* Devin J. Pohly
* Forrest Bushstone
* gan-of-culture
* godalming123
* Job79
* link2xt
* Micah Gorrell
* Nikita Ivanov
* Palanix
* pino-desktop
* Weiseguy
* Yves Zoundi

View File

@ -5,8 +5,8 @@ include config.mk
# flags for compiling
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
DWLDEVCFLAGS = -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion
# CFLAGS / LDFLAGS
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
@ -14,10 +14,11 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
all: dwl
dwl: dwl.o util.o net-tapesoftware-dwl-wm-unstable-v1-protocol.o
$(CC) dwl.o util.o net-tapesoftware-dwl-wm-unstable-v1-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h net-tapesoftware-dwl-wm-unstable-v1-protocol.h
dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
$(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h dwl-ipc-unstable-v2-protocol.h
util.o: util.c util.h
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
@ -31,15 +32,15 @@ xdg-shell-protocol.h:
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
# install rules
net-tapesoftware-dwl-wm-unstable-v1-protocol.h: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
cursor-shape-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@
net-tapesoftware-dwl-wm-unstable-v1-protocol.c: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
dwl-ipc-unstable-v2-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/dwl-ipc-unstable-v2.xml $@
dwl-ipc-unstable-v2-protocol.c:
$(WAYLAND_SCANNER) private-code \
protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@
net-tapesoftware-dwl-wm-unstable-v1-protocol.o: net-tapesoftware-dwl-wm-unstable-v1-protocol.h
protocols/dwl-ipc-unstable-v2.xml $@
config.h:
cp config.def.h $@
@ -48,8 +49,8 @@ clean:
dist: clean
mkdir -p dwl-$(VERSION)
cp -R LICENSE* Makefile README.md client.h config.def.h\
config.mk protocols dwl.1 dwl.c util.c util.h\
cp -R LICENSE* Makefile CHANGELOG.md README.md client.h config.def.h\
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop\
dwl-$(VERSION)
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
rm -rf dwl-$(VERSION)
@ -61,8 +62,11 @@ install: dwl
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
.SUFFIXES: .c .o
.c.o:

View File

@ -1,15 +1,15 @@
# dwl - dwm for Wayland
Join us on our [Discord server] or at [#dwl] on irc.libera.chat.
Join us on our IRC channel: [#dwl on Libera Chat]
Or on our [Discord server].
dwl is a compact, hackable compositor for [Wayland] based on [wlroots]. It is
intended to fill the same space in the Wayland world that dwm does in X11,
primarily in terms of philosophy, and secondarily in terms of functionality.
primarily in terms of functionality, and secondarily in terms of philosophy.
Like dwm, dwl is:
- Easy to understand, hack on, and extend with patches
- One C source file (or a very small number) configurable via `config.h`
- Limited to 2200 SLOC to promote hackability
- Tied to as few external dependencies as possible
dwl is not meant to provide every feature under the sun. Instead, like dwm, it
@ -26,19 +26,25 @@ given the base on which it is built. Implemented default features are:
monitoring
- Provide information to external status bars via stdout/stdin
- Urgency hints via xdg-activate protocol
- Support screen lockers via input-inhibitor protocol
- Support screen lockers via ext-session-lock-v1 protocol
- Various Wayland protocols
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
- Layer shell popups (used by Waybar)
- Damage tracking provided by scenegraph API
Given the Wayland architecture, dwl has to implement features from dwm **and**
the xorg-server. Because of this, it is impossible to maintain the original
project goal of 2000 SLOC and have a reasonably complete compositor with
features comparable to dwm. However, this does not mean that the code will grow
indiscriminately. We will try to keep the code as small as possible.
Features under consideration (possibly as patches) are:
- Protocols made trivial by wlroots
- Implement the text-input and input-method protocols to support IME once ibus
implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and
https://github.com/djpohly/dwl/pull/235)
https://codeberg.org/dwl/dwl/pulls/235)
Feature *non-goals* for the main codebase include:
@ -49,14 +55,28 @@ Feature *non-goals* for the main codebase include:
## Building dwl
dwl has only two dependencies: `wlroots` and `wayland-protocols`.
dwl has the following dependencies:
```
libinput
wayland
wlroots (compiled with the libinput backend)
xkbcommon
wayland-protocols (compile-time only)
pkg-config (compile-time only)
```
If you enable X11 support:
```
libxcb
libxcb-wm
wlroots (compiled with X11 support)
Xwayland (runtime only)
```
Simply install these (and their `-devel` versions if your distro has separate
development packages) and run `make`. If you wish to build against a Git
version of wlroots, check out the [wlroots-next branch].
To enable XWayland, you should also install xorg-xwayland and uncomment its flag
in `config.mk`.
To enable XWayland, you should uncomment its flags in `config.mk`.
## Configuration
@ -66,7 +86,7 @@ Wayland without restarting the entire display server, so any changes will take
effect the next time dwl is executed.
As in the dwm community, we encourage users to share patches they have created.
Check out the [patches page on our wiki]!
Check out the dwl [patches repository] and [patches wiki]!
## Running dwl
@ -82,6 +102,7 @@ When dwl is run with no arguments, it will launch the server and begin handling
any shortcuts configured in `config.h`. There is no status bar or other
decoration initially; these are instead clients that can be run within
the Wayland session.
Do note that the background color is black.
If you would like to run a script or command automatically at startup, you can
specify the command using the `-s` option. This command will be executed as a
@ -89,7 +110,7 @@ shell command using `/bin/sh -c`. It serves a similar function to `.xinitrc`,
but differs in that the display server will not shut down when this process
terminates. Instead, dwl will send this process a SIGTERM at shutdown and wait
for it to terminate (if it hasn't already). This makes it ideal for execing into
a user service manager like [s6], [anopa], [runit], or [`systemd --user`].
a user service manager like [s6], [anopa], [runit], [dinit], or [`systemd --user`].
Note: The `-s` command is run as a *child process* of dwl, which means that it
does not have the ability to affect the environment of dwl or of any processes
@ -105,7 +126,7 @@ automatically, you will need to configure it prior to launching `dwl`, e.g.:
### Status information
Information about selected layouts, current window title, and
Information about selected layouts, current window title, app-id, and
selected/occupied/urgent tags is written to the stdin of the `-s` command (see
the `printstatus()` function for details). This information can be used to
populate an external status bar with a script that parses the information.
@ -136,6 +157,7 @@ possible.
Many thanks to suckless.org and the dwm developers and community for the
inspiration, and to the various contributors to the project, including:
- **Devin J. Pohly for creating and nurturing the fledgling project**
- Alexander Courtis for the XWayland implementation
- Guido Cella for the layer-shell protocol implementation, patch maintenance,
and for helping to keep the project running
@ -143,15 +165,17 @@ inspiration, and to the various contributors to the project, including:
[Discord server]: https://discord.gg/jJxZnrGPWN
[#dwl]: https://web.libera.chat/?channels=#dwl
[#dwl on Libera Chat]: https://web.libera.chat/?channels=#dwl
[Wayland]: https://wayland.freedesktop.org/
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
[wlroots-next branch]: https://github.com/djpohly/dwl/tree/wlroots-next
[patches page on our wiki]: https://github.com/djpohly/dwl/wiki/Patches
[wlroots-next branch]: https://codeberg.org/dwl/dwl/src/branch/wlroots-next
[patches repository]: https://codeberg.org/dwl/dwl-patches
[patches wiki]: https://codeberg.org/dwl/dwl-patches/wiki
[s6]: https://skarnet.org/software/s6/
[anopa]: https://jjacky.com/anopa/
[runit]: http://smarden.org/runit/faq.html#userservices
[dinit]: https://davmac.org/projects/dinit/
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
[wiki]: https://github.com/djpohly/dwl/wiki#compatible-status-bars
[wiki]: https://codeberg.org/dwl/dwl/wiki/Home#compatible-status-bars
[list of useful resources on our wiki]:
https://github.com/djpohly/dwl/wiki#migrating-from-x
https://codeberg.org/dwl/dwl/wiki/Home#migrating-from-x

345
client.h
View File

@ -10,70 +10,9 @@ static inline int
client_is_x11(Client *c)
{
#ifdef XWAYLAND
return c->type == X11Managed || c->type == X11Unmanaged;
#else
return c->type == X11;
#endif
return 0;
#endif
}
static inline Client *
client_from_wlr_surface(struct wlr_surface *s)
{
struct wlr_xdg_surface *surface;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
if (s && wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s)))
return xsurface->data;
#endif
if (s && wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return surface->data;
if (s && wlr_surface_is_subsurface(s))
return client_from_wlr_surface(wlr_surface_get_root_surface(s));
return NULL;
}
static inline Client *
client_get_parent(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c) && c->surface.xwayland->parent)
return client_from_wlr_surface(c->surface.xwayland->parent->surface);
#endif
if (c->surface.xdg->toplevel->parent)
return client_from_wlr_surface(c->surface.xdg->toplevel->parent->surface);
return NULL;
}
static inline void
client_get_size_hints(Client *c, struct wlr_box *max, struct wlr_box *min)
{
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state *state;
#ifdef XWAYLAND
if (client_is_x11(c)) {
struct wlr_xwayland_surface_size_hints *size_hints;
size_hints = c->surface.xwayland->size_hints;
if (size_hints) {
max->width = size_hints->max_width;
max->height = size_hints->max_height;
min->width = size_hints->min_width;
min->height = size_hints->min_height;
}
return;
}
#endif
toplevel = c->surface.xdg->toplevel;
state = &toplevel->current;
max->width = state->max_width;
max->height = state->max_height;
min->width = state->min_width;
min->height = state->min_height;
}
static inline struct wlr_surface *
@ -86,34 +25,100 @@ client_surface(Client *c)
return c->surface.xdg->surface;
}
static inline int
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
{
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
struct wlr_surface *root_surface;
struct wlr_layer_surface_v1 *layer_surface;
Client *c = NULL;
LayerSurface *l = NULL;
int type = -1;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
#endif
if (!s)
return -1;
root_surface = wlr_surface_get_root_surface(s);
#ifdef XWAYLAND
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
c = xsurface->data;
type = c->type;
goto end;
}
#endif
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
l = layer_surface->data;
type = LayerShell;
goto end;
}
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
while (xdg_surface) {
tmp_xdg_surface = NULL;
switch (xdg_surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
if (!xdg_surface->popup || !xdg_surface->popup->parent)
return -1;
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
if (!tmp_xdg_surface)
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
xdg_surface = tmp_xdg_surface;
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
c = xdg_surface->data;
type = c->type;
goto end;
case WLR_XDG_SURFACE_ROLE_NONE:
return -1;
}
}
end:
if (pl)
*pl = l;
if (pc)
*pc = c;
return type;
}
/* The others */
static inline void
client_activate_surface(struct wlr_surface *s, int activated)
{
struct wlr_xdg_surface *surface;
struct wlr_xdg_toplevel *toplevel;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
if (wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
wlr_xwayland_surface_activate(xsurface, activated);
return;
}
#endif
if (wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(surface, activated);
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s)))
wlr_xdg_toplevel_set_activated(toplevel, activated);
}
static inline void
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
static inline uint32_t
client_set_bounds(Client *c, int32_t width, int32_t height)
{
wlr_surface_for_each_surface(client_surface(c), fn, data);
#ifdef XWAYLAND
if (client_is_x11(c))
return;
return 0;
#endif
wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0
&& (c->bounds.width != width || c->bounds.height != height)) {
c->bounds.width = width;
c->bounds.height = height;
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
}
return 0;
}
static inline const char *
@ -126,6 +131,27 @@ client_get_appid(Client *c)
return c->surface.xdg->toplevel->app_id;
}
static inline void
client_get_clip(Client *c, struct wlr_box *clip)
{
struct wlr_box xdg_geom = {0};
*clip = (struct wlr_box){
.x = 0,
.y = 0,
.width = c->geom.width - c->bw,
.height = c->geom.height - c->bw,
};
#ifdef XWAYLAND
if (client_is_x11(c))
return;
#endif
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
clip->x = xdg_geom.x;
clip->y = xdg_geom.y;
}
static inline void
client_get_geometry(Client *c, struct wlr_box *geom)
{
@ -141,6 +167,34 @@ client_get_geometry(Client *c, struct wlr_box *geom)
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
}
static inline Client *
client_get_parent(Client *c)
{
Client *p = NULL;
#ifdef XWAYLAND
if (client_is_x11(c)) {
if (c->surface.xwayland->parent)
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
return p;
}
#endif
if (c->surface.xdg->toplevel->parent)
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
return p;
}
static inline int
client_has_children(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return !wl_list_empty(&c->surface.xwayland->children);
#endif
/* surface.xdg->link is never empty because it always contains at least the
* surface itself. */
return wl_list_length(&c->surface.xdg->link) > 1;
}
static inline const char *
client_get_title(Client *c)
{
@ -151,47 +205,88 @@ client_get_title(Client *c)
return c->surface.xdg->toplevel->title;
}
static inline int
client_is_float_type(Client *c)
{
struct wlr_box min = {0}, max = {0};
client_get_size_hints(c, &max, &min);
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state state;
#ifdef XWAYLAND
if (client_is_x11(c)) {
struct wlr_xwayland_surface *surface = c->surface.xwayland;
xcb_size_hints_t *size_hints = surface->size_hints;
size_t i;
if (surface->modal)
return 1;
for (size_t i = 0; i < surface->window_type_len; i++)
for (i = 0; i < surface->window_type_len; i++)
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
return 1;
return size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
&& (size_hints->max_width == size_hints->min_width
|| size_hints->max_height == size_hints->min_height);
}
#endif
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height))
|| client_get_parent(c);
toplevel = c->surface.xdg->toplevel;
state = toplevel->current;
return toplevel->parent || (state.min_width != 0 && state.min_height != 0
&& (state.min_width == state.max_width
|| state.min_height == state.max_height));
}
static inline int
client_is_mapped(Client *c)
client_is_rendered_on_mon(Client *c, Monitor *m)
{
/* This is needed for when you don't want to check formal assignment,
* but rather actual displaying of the pixels.
* Usually VISIBLEON suffices and is also faster. */
struct wlr_surface_output *s;
int unused_lx, unused_ly;
if (!wlr_scene_node_coords(&c->scene->node, &unused_lx, &unused_ly))
return 0;
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
if (s->output == m->wlr_output)
return 1;
return 0;
}
static inline int
client_is_stopped(Client *c)
{
int pid;
siginfo_t in = {0};
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->mapped;
return 0;
#endif
return c->surface.xdg->mapped;
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
/* This process is not our child process, while is very unluckely that
* it is stopped, in order to do not skip frames assume that it is. */
if (errno == ECHILD)
return 1;
} else if (in.si_pid) {
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
return 1;
if (in.si_code == CLD_CONTINUED)
return 0;
}
return 0;
}
static inline int
client_is_unmanaged(Client *c)
{
#ifdef XWAYLAND
return c->type == X11Unmanaged;
if (client_is_x11(c))
return c->surface.xwayland->override_redirect;
#endif
return 0;
}
@ -226,7 +321,15 @@ client_send_close(Client *c)
return;
}
#endif
wlr_xdg_toplevel_send_close(c->surface.xdg);
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
}
static inline void
client_set_border_color(Client *c, const float color[static 4])
{
int i;
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(c->border[i], color);
}
static inline void
@ -238,7 +341,7 @@ client_set_fullscreen(Client *c, int fullscreen)
return;
}
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
}
static inline uint32_t
@ -251,7 +354,10 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
return 0;
}
#endif
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
if ((int32_t)width == c->surface.xdg->toplevel->current.width
&& (int32_t)height == c->surface.xdg->toplevel->current.height)
return 0;
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
}
static inline void
@ -261,18 +367,25 @@ client_set_tiled(Client *c, uint32_t edges)
if (client_is_x11(c))
return;
#endif
wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
} else {
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE);
}
}
static inline struct wlr_surface *
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
static inline void
client_set_suspended(Client *c, int suspended)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return wlr_surface_surface_at(c->surface.xwayland->surface,
cx, cy, sx, sy);
if (client_is_x11(c)) {
wlr_xwayland_surface_set_withdrawn(c->surface.xwayland, suspended);
return;
}
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
}
static inline int
@ -295,43 +408,3 @@ client_wants_fullscreen(Client *c)
#endif
return c->surface.xdg->toplevel->requested.fullscreen;
}
static inline void *
toplevel_from_popup(struct wlr_xdg_popup *popup)
{
struct wlr_xdg_surface *surface = popup->base;
while (1) {
switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
if (!surface->popup->parent)
return NULL;
else if (wlr_surface_is_layer_surface(surface->popup->parent))
return wlr_layer_surface_v1_from_wlr_surface(surface->popup->parent)->data;
else if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL;
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
break;
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
return surface->data;
case WLR_XDG_SURFACE_ROLE_NONE:
return NULL;
}
}
}
static inline void *
toplevel_from_wlr_layer_surface(struct wlr_surface *s)
{
Client *c;
struct wlr_layer_surface_v1 *wlr_layer_surface;
if ((c = client_from_wlr_surface(s)))
return c;
else if (s && wlr_surface_is_layer_surface(s)
&& (wlr_layer_surface = wlr_layer_surface_v1_from_wlr_surface(s)))
return wlr_layer_surface->data;
return NULL;
}

View File

@ -1,15 +1,24 @@
/* Taken from https://github.com/djpohly/dwl/issues/466 */
#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
((hex >> 16) & 0xFF) / 255.0f, \
((hex >> 8) & 0xFF) / 255.0f, \
(hex & 0xFF) / 255.0f }
/* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
/* logging */
static int log_level = WLR_ERROR;
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
@ -28,13 +37,14 @@ static const Layout layouts[] = {
};
/* monitors */
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
static const MonitorRule monrules[] = {
/* name mfact nmaster scale layout rotate/reflect */
/* name mfact nmaster scale layout rotate/reflect x y */
/* example of a HiDPI laptop monitor:
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
*/
/* defaults */
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
{ NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
};
/* keyboard */
@ -66,9 +76,9 @@ LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
/* You can choose between:
LIBINPUT_CONFIG_CLICK_METHOD_NONE
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
LIBINPUT_CONFIG_CLICK_METHOD_NONE
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
*/
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
@ -85,6 +95,11 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
*/
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
static const double accel_speed = 0.0;
/* You can choose between:
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
*/
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT
@ -111,8 +126,8 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
@ -141,6 +156,9 @@ static const Key keys[] = {
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
* do not remove them.
*/
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),

View File

@ -1,14 +1,15 @@
_VERSION = 0.3.1-dev
VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)`
_VERSION = 0.5
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config
# paths
PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man
DATADIR = $(PREFIX)/share
XWAYLAND =
XLIBS =
# Uncomment to build XWayland support
#XWAYLAND = -DXWAYLAND
#XLIBS = xcb
#XLIBS = xcb xcb-icccm

13
dwl.1
View File

@ -7,6 +7,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl d
.Op Fl s Ar startup command
.Sh DESCRIPTION
.Nm
@ -22,6 +23,12 @@ option,
writes its name and version to standard error and exits unsuccessfully.
.Pp
When given the
.Fl d
option,
.Nm
enables full wlroots logging, including debug information.
.Pp
When given the
.Fl s
option,
.Nm
@ -51,7 +58,7 @@ Spawn
.Nm bemenu-run .
.It Mod-Shift-Return
Spawn
.Nm alacritty .
.Nm foot .
.It Mod-[jk]
Move focus down/up the stack.
.It Mod-[id]
@ -101,7 +108,7 @@ These environment variables are used by
A directory where temporary user files, such as the Wayland socket,
are stored.
.It Ev XDG_CONFIG_DIR
A directory containung configuration of various programs and
A directory containing configuration of various programs and
libraries, including libxkbcommon.
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
Tell how to connect to an underlying X11 or Wayland server.
@ -135,7 +142,7 @@ Start
with s6 in the background:
.Dl dwl -s 's6-svscan <&-'
.Sh SEE ALSO
.Xr alacritty 1 ,
.Xr foot 1 ,
.Xr bemenu 1 ,
.Xr dwm 1 ,
.Xr xkeyboard-config 7

2478
dwl.c

File diff suppressed because it is too large Load Diff

5
dwl.desktop Normal file
View File

@ -0,0 +1,5 @@
[Desktop Entry]
Name=dwl
Comment=dwm for Wayland
Exec=dwl
Type=Application

575
ipc-v2-fixed.patch Normal file
View File

@ -0,0 +1,575 @@
diff --git a/Makefile b/Makefile
index 5320e42..c13557c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,11 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
all: dwl
-dwl: dwl.o util.o
- $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
-dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
+dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
+ $(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
+dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h dwl-ipc-unstable-v2-protocol.h
util.o: util.c util.h
+dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
@@ -31,6 +32,12 @@ xdg-shell-protocol.h:
wlr-layer-shell-unstable-v1-protocol.h:
$(WAYLAND_SCANNER) server-header \
protocols/wlr-layer-shell-unstable-v1.xml $@
+dwl-ipc-unstable-v2-protocol.h:
+ $(WAYLAND_SCANNER) server-header \
+ protocols/dwl-ipc-unstable-v2.xml $@
+dwl-ipc-unstable-v2-protocol.c:
+ $(WAYLAND_SCANNER) private-code \
+ protocols/dwl-ipc-unstable-v2.xml $@
config.h:
cp config.def.h $@
diff --git a/config.def.h b/config.def.h
index 4e30885..f285840 100644
--- a/config.def.h
+++ b/config.def.h
@@ -120,6 +120,7 @@ static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY, XKB_KEY_b, togglebar, {0}},
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
diff --git a/dwl.c b/dwl.c
index a7d41b0..e507e31 100644
--- a/dwl.c
+++ b/dwl.c
@@ -58,6 +58,7 @@
#include <xcb/xcb_icccm.h>
#endif
+#include "dwl-ipc-unstable-v2-protocol.h"
#include "util.h"
/* macros */
@@ -128,6 +129,12 @@ typedef struct {
uint32_t resize; /* configure serial of a pending resize */
} Client;
+typedef struct {
+ struct wl_list link;
+ struct wl_resource *resource;
+ Monitor *mon;
+} DwlIpcOutput;
+
typedef struct {
uint32_t mod;
xkb_keysym_t keysym;
@@ -174,6 +181,7 @@ typedef struct {
struct Monitor {
struct wl_list link;
+ struct wl_list dwl_ipc_outputs;
struct wlr_output *wlr_output;
struct wlr_scene_output *scene_output;
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
@@ -255,6 +263,17 @@ static void destroynotify(struct wl_listener *listener, void *data);
static void destroysessionlock(struct wl_listener *listener, void *data);
static void destroysessionmgr(struct wl_listener *listener, void *data);
static Monitor *dirtomon(enum wlr_direction dir);
+static void dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id);
+static void dwl_ipc_manager_destroy(struct wl_resource *resource);
+static void dwl_ipc_manager_get_output(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *output);
+static void dwl_ipc_manager_release(struct wl_client *client, struct wl_resource *resource);
+static void dwl_ipc_output_destroy(struct wl_resource *resource);
+static void dwl_ipc_output_printstatus(Monitor *monitor);
+static void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output);
+static void dwl_ipc_output_set_client_tags(struct wl_client *client, struct wl_resource *resource, uint32_t and_tags, uint32_t xor_tags);
+static void dwl_ipc_output_set_layout(struct wl_client *client, struct wl_resource *resource, uint32_t index);
+static void dwl_ipc_output_set_tags(struct wl_client *client, struct wl_resource *resource, uint32_t tagmask, uint32_t toggle_tagset);
+static void dwl_ipc_output_release(struct wl_client *client, struct wl_resource *resource);
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
@@ -302,6 +321,7 @@ static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
+static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
@@ -374,6 +394,8 @@ static struct wl_listener cursor_frame = {.notify = cursorframe};
static struct wl_listener cursor_motion = {.notify = motionrelative};
static struct wl_listener cursor_motion_absolute = {.notify = motionabsolute};
static struct wl_listener drag_icon_destroy = {.notify = destroydragicon};
+static struct zdwl_ipc_manager_v2_interface dwl_manager_implementation = {.release = dwl_ipc_manager_release, .get_output = dwl_ipc_manager_get_output};
+static struct zdwl_ipc_output_v2_interface dwl_output_implementation = {.release = dwl_ipc_output_release, .set_tags = dwl_ipc_output_set_tags, .set_layout = dwl_ipc_output_set_layout, .set_client_tags = dwl_ipc_output_set_client_tags};
static struct wl_listener idle_inhibitor_create = {.notify = createidleinhibitor};
static struct wl_listener idle_inhibitor_destroy = {.notify = destroyidleinhibitor};
static struct wl_listener layout_change = {.notify = updatemons};
@@ -691,6 +713,9 @@ cleanupmon(struct wl_listener *listener, void *data)
LayerSurface *l, *tmp;
int i;
+ DwlIpcOutput *ipc_output, *ipc_output_tmp;
+ wl_list_for_each_safe(ipc_output, ipc_output_tmp, &m->dwl_ipc_outputs, link)
+ wl_resource_destroy(ipc_output->resource);
for (i = 0; i <= ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; i++)
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
wlr_layer_surface_v1_destroy(l->layer_surface);
@@ -902,6 +927,7 @@ createmon(struct wl_listener *listener, void *data)
Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m));
m->wlr_output = wlr_output;
+ wl_list_init(&m->dwl_ipc_outputs);
wlr_output_init_render(wlr_output, alloc, drw);
/* Initialize monitor state using configured rules */
@@ -1195,6 +1221,190 @@ dirtomon(enum wlr_direction dir)
return selmon;
}
+void
+dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+{
+ struct wl_resource *manager_resource = wl_resource_create(client, &zdwl_ipc_manager_v2_interface, version, id);
+ if (!manager_resource) {
+ wl_client_post_no_memory(client);
+ return;
+ }
+ wl_resource_set_implementation(manager_resource, &dwl_manager_implementation, NULL, dwl_ipc_manager_destroy);
+
+ zdwl_ipc_manager_v2_send_tags(manager_resource, TAGCOUNT);
+
+ for (int i = 0; i < LENGTH(layouts); i++)
+ zdwl_ipc_manager_v2_send_layout(manager_resource, layouts[i].symbol);
+}
+
+void
+dwl_ipc_manager_destroy(struct wl_resource *resource)
+{
+ /* No state to destroy */
+}
+
+void
+dwl_ipc_manager_get_output(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *output)
+{
+ DwlIpcOutput *ipc_output;
+ Monitor *monitor = wlr_output_from_resource(output)->data;
+ struct wl_resource *output_resource = wl_resource_create(client, &zdwl_ipc_output_v2_interface, wl_resource_get_version(resource), id);
+ if (!output_resource)
+ return;
+
+ ipc_output = ecalloc(1, sizeof(*ipc_output));
+ ipc_output->resource = output_resource;
+ ipc_output->mon = monitor;
+ wl_resource_set_implementation(output_resource, &dwl_output_implementation, ipc_output, dwl_ipc_output_destroy);
+ wl_list_insert(&monitor->dwl_ipc_outputs, &ipc_output->link);
+ dwl_ipc_output_printstatus_to(ipc_output);
+}
+
+void
+dwl_ipc_manager_release(struct wl_client *client, struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
+static void
+dwl_ipc_output_destroy(struct wl_resource *resource)
+{
+ DwlIpcOutput *ipc_output = wl_resource_get_user_data(resource);
+ wl_list_remove(&ipc_output->link);
+ free(ipc_output);
+}
+
+void
+dwl_ipc_output_printstatus(Monitor *monitor)
+{
+ DwlIpcOutput *ipc_output;
+ wl_list_for_each(ipc_output, &monitor->dwl_ipc_outputs, link)
+ dwl_ipc_output_printstatus_to(ipc_output);
+}
+
+void
+dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output)
+{
+ Monitor *monitor = ipc_output->mon;
+ Client *c, *focused;
+ int tagmask, state, numclients, focused_client, tag;
+ const char *title, *appid;
+ focused = focustop(monitor);
+ zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
+
+ for (tag = 0 ; tag < TAGCOUNT; tag++) {
+ numclients = state = focused_client = 0;
+ tagmask = 1 << tag;
+ if ((tagmask & monitor->tagset[monitor->seltags]) != 0)
+ state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE;
+
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon != monitor)
+ continue;
+ if (!(c->tags & tagmask))
+ continue;
+ if (c == focused)
+ focused_client = 1;
+ if (c->isurgent)
+ state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT;
+
+ numclients++;
+ }
+ zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client);
+ }
+ title = focused ? client_get_title(focused) : "";
+ appid = focused ? client_get_appid(focused) : "";
+
+ zdwl_ipc_output_v2_send_layout(ipc_output->resource, monitor->lt[monitor->sellt] - layouts);
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title ? title : broken);
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid ? appid : broken);
+ zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, monitor->ltsymbol);
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, focused ? focused->isfullscreen : 0);
+ }
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_floating(ipc_output->resource, focused ? focused->isfloating : 0);
+ }
+ zdwl_ipc_output_v2_send_frame(ipc_output->resource);
+}
+
+void
+dwl_ipc_output_set_client_tags(struct wl_client *client, struct wl_resource *resource, uint32_t and_tags, uint32_t xor_tags)
+{
+ DwlIpcOutput *ipc_output;
+ Monitor *monitor;
+ Client *selected_client;
+ unsigned int newtags = 0;
+
+ ipc_output = wl_resource_get_user_data(resource);
+ if (!ipc_output)
+ return;
+
+ monitor = ipc_output->mon;
+ selected_client = focustop(monitor);
+ if (!selected_client)
+ return;
+
+ newtags = (selected_client->tags & and_tags) ^ xor_tags;
+ if (!newtags)
+ return;
+
+ selected_client->tags = newtags;
+ focusclient(focustop(selmon), 1);
+ arrange(selmon);
+ printstatus();
+}
+
+void
+dwl_ipc_output_set_layout(struct wl_client *client, struct wl_resource *resource, uint32_t index)
+{
+ DwlIpcOutput *ipc_output;
+ Monitor *monitor;
+
+ ipc_output = wl_resource_get_user_data(resource);
+ if (!ipc_output)
+ return;
+
+ monitor = ipc_output->mon;
+ if (index >= LENGTH(layouts))
+ return;
+ if (index != monitor->lt[monitor->sellt] - layouts)
+ monitor->sellt ^= 1;
+
+ monitor->lt[monitor->sellt] = &layouts[index];
+ arrange(monitor);
+ printstatus();
+}
+
+void
+dwl_ipc_output_set_tags(struct wl_client *client, struct wl_resource *resource, uint32_t tagmask, uint32_t toggle_tagset)
+{
+ DwlIpcOutput *ipc_output;
+ Monitor *monitor;
+ unsigned int newtags = tagmask & TAGMASK;
+
+ ipc_output = wl_resource_get_user_data(resource);
+ if (!ipc_output)
+ return;
+ monitor = ipc_output->mon;
+
+ if (!newtags || newtags == monitor->tagset[monitor->seltags])
+ return;
+ if (toggle_tagset)
+ monitor->seltags ^= 1;
+
+ monitor->tagset[monitor->seltags] = newtags;
+ focusclient(focustop(monitor), 1);
+ arrange(monitor);
+ printstatus();
+}
+
+void
+dwl_ipc_output_release(struct wl_client *client, struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
void
focusclient(Client *c, int lift)
{
@@ -1846,41 +2056,9 @@ void
printstatus(void)
{
Monitor *m = NULL;
- Client *c;
- uint32_t occ, urg, sel;
- const char *appid, *title;
- wl_list_for_each(m, &mons, link) {
- occ = urg = 0;
- wl_list_for_each(c, &clients, link) {
- if (c->mon != m)
- continue;
- occ |= c->tags;
- if (c->isurgent)
- urg |= c->tags;
- }
- if ((c = focustop(m))) {
- title = client_get_title(c);
- appid = client_get_appid(c);
- printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
- printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
- printf("%s fullscreen %u\n", m->wlr_output->name, c->isfullscreen);
- printf("%s floating %u\n", m->wlr_output->name, c->isfloating);
- sel = c->tags;
- } else {
- printf("%s title \n", m->wlr_output->name);
- printf("%s appid \n", m->wlr_output->name);
- printf("%s fullscreen \n", m->wlr_output->name);
- printf("%s floating \n", m->wlr_output->name);
- sel = 0;
- }
-
- printf("%s selmon %u\n", m->wlr_output->name, m == selmon);
- printf("%s tags %u %u %u %u\n", m->wlr_output->name, occ, m->tagset[m->seltags],
- sel, urg);
- printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol);
- }
- fflush(stdout);
+ wl_list_for_each(m, &mons, link)
+ dwl_ipc_output_printstatus(m);
}
void
@@ -2295,6 +2473,7 @@ setup(void)
wl_signal_add(&output_mgr->events.test, &output_mgr_test);
wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
+ wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, dwl_ipc_manager_bind);
#ifdef XWAYLAND
/*
@@ -2389,6 +2568,13 @@ tile(Monitor *m)
}
}
+void
+togglebar(const Arg *arg) {
+ DwlIpcOutput *ipc_output;
+ wl_list_for_each(ipc_output, &selmon->dwl_ipc_outputs, link)
+ zdwl_ipc_output_v2_send_toggle_visibility(ipc_output->resource);
+}
+
void
togglefloating(const Arg *arg)
{
diff --git a/protocols/dwl-ipc-unstable-v2.xml b/protocols/dwl-ipc-unstable-v2.xml
new file mode 100644
index 0000000..0a6e7e5
--- /dev/null
+++ b/protocols/dwl-ipc-unstable-v2.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+This is largely ripped from somebar's ipc patchset; just with some personal modifications.
+I would probably just submit raphi's patchset but I don't think that would be polite.
+-->
+<protocol name="dwl_ipc_unstable_v2">
+ <description summary="inter-proccess-communication about dwl's state">
+ This protocol allows clients to update and get updates from dwl.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible
+ changes may be added together with the corresponding interface
+ version bump.
+ Backward incompatible changes are done by bumping the version
+ number in the protocol and interface names and resetting the
+ interface version. Once the protocol is to be declared stable,
+ the 'z' prefix and the version number in the protocol and
+ interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zdwl_ipc_manager_v2" version="2">
+ <description summary="manage dwl state">
+ This interface is exposed as a global in wl_registry.
+
+ Clients can use this interface to get a dwl_ipc_output.
+ After binding the client will recieve the dwl_ipc_manager.tags and dwl_ipc_manager.layout events.
+ The dwl_ipc_manager.tags and dwl_ipc_manager.layout events expose tags and layouts to the client.
+ </description>
+
+ <request name="release" type="destructor">
+ <description summary="release dwl_ipc_manager">
+ Indicates that the client will not the dwl_ipc_manager object anymore.
+ Objects created through this instance are not affected.
+ </description>
+ </request>
+
+ <request name="get_output">
+ <description summary="get a dwl_ipc_outout for a wl_output">
+ Get a dwl_ipc_outout for the specified wl_output.
+ </description>
+ <arg name="id" type="new_id" interface="zdwl_ipc_output_v2"/>
+ <arg name="output" type="object" interface="wl_output"/>
+ </request>
+
+ <event name="tags">
+ <description summary="Announces tag amount">
+ This event is sent after binding.
+ A roundtrip after binding guarantees the client recieved all tags.
+ </description>
+ <arg name="amount" type="uint"/>
+ </event>
+
+ <event name="layout">
+ <description summary="Announces a layout">
+ This event is sent after binding.
+ A roundtrip after binding guarantees the client recieved all layouts.
+ </description>
+ <arg name="name" type="string"/>
+ </event>
+ </interface>
+
+ <interface name="zdwl_ipc_output_v2" version="2">
+ <description summary="control dwl output">
+ Observe and control a dwl output.
+
+ Events are double-buffered:
+ Clients should cache events and redraw when a dwl_ipc_output.frame event is sent.
+
+ Request are not double-buffered:
+ The compositor will update immediately upon request.
+ </description>
+
+ <enum name="tag_state">
+ <entry name="none" value="0" summary="no state"/>
+ <entry name="active" value="1" summary="tag is active"/>
+ <entry name="urgent" value="2" summary="tag has at least one urgent client"/>
+ </enum>
+
+ <request name="release" type="destructor">
+ <description summary="release dwl_ipc_outout">
+ Indicates to that the client no longer needs this dwl_ipc_output.
+ </description>
+ </request>
+
+ <event name="toggle_visibility">
+ <description summary="Toggle client visibilty">
+ Indicates the client should hide or show themselves.
+ If the client is visible then hide, if hidden then show.
+ </description>
+ </event>
+
+ <event name="active">
+ <description summary="Update the selected output.">
+ Indicates if the output is active. Zero is invalid, nonzero is valid.
+ </description>
+ <arg name="active" type="uint"/>
+ </event>
+
+ <event name="tag">
+ <description summary="Update the state of a tag.">
+ Indicates that a tag has been updated.
+ </description>
+ <arg name="tag" type="uint" summary="Index of the tag"/>
+ <arg name="state" type="uint" enum="tag_state" summary="The state of the tag."/>
+ <arg name="clients" type="uint" summary="The number of clients in the tag."/>
+ <arg name="focused" type="uint" summary="If there is a focused client. Nonzero being valid, zero being invalid."/>
+ </event>
+
+ <event name="layout">
+ <description summary="Update the layout.">
+ Indicates a new layout is selected.
+ </description>
+ <arg name="layout" type="uint" summary="Index of the layout."/>
+ </event>
+
+ <event name="title">
+ <description summary="Update the title.">
+ Indicates the title has changed.
+ </description>
+ <arg name="title" type="string" summary="The new title name."/>
+ </event>
+
+ <event name="appid" since="1">
+ <description summary="Update the appid.">
+ Indicates the appid has changed.
+ </description>
+ <arg name="appid" type="string" summary="The new appid."/>
+ </event>
+
+ <event name="layout_symbol" since="1">
+ <description summary="Update the current layout symbol">
+ Indicates the layout has changed. Since layout symbols are dynamic.
+ As opposed to the zdwl_ipc_manager.layout event, this should take precendence when displaying.
+ You can ignore the zdwl_ipc_output.layout event.
+ </description>
+ <arg name="layout" type="string" summary="The new layout"/>
+ </event>
+
+ <event name="frame">
+ <description summary="The update sequence is done.">
+ Indicates that a sequence of status updates have finished and the client should redraw.
+ </description>
+ </event>
+
+ <request name="set_tags">
+ <description summary="Set the active tags of this output"/>
+ <arg name="tagmask" type="uint" summary="bitmask of the tags that should be set."/>
+ <arg name="toggle_tagset" type="uint" summary="toggle the selected tagset, zero for invalid, nonzero for valid."/>
+ </request>
+
+ <request name="set_client_tags">
+ <description summary="Set the tags of the focused client.">
+ The tags are updated as follows:
+ new_tags = (current_tags AND and_tags) XOR xor_tags
+ </description>
+ <arg name="and_tags" type="uint"/>
+ <arg name="xor_tags" type="uint"/>
+ </request>
+
+ <request name="set_layout">
+ <description summary="Set the layout of this output"/>
+ <arg name="index" type="uint" summary="index of a layout recieved by dwl_ipc_manager.layout"/>
+ </request>
+
+ <!-- Version 2 -->
+ <event name="fullscreen" since="2">
+ <description summary="Update fullscreen status">
+ Indicates if the selected client on this output is fullscreen.
+ </description>
+ <arg name="is_fullscreen" type="uint" summary="If the selected client is fullscreen. Nonzero is valid, zero invalid"/>
+ </event>
+
+ <event name="floating" since="2">
+ <description summary="Update the floating status">
+ Indicates if the selected client on this output is floating.
+ </description>
+ <arg name="is_floating" type="uint" summary="If the selected client is floating. Nonzero is valid, zero invalid"/>
+ </event>
+ </interface>
+</protocol>

View File

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is largely ripped from somebar's ipc patchset; just with some personal modifications.
I would probably just submit raphi's patchset but I don't think that would be polite.
-->
<protocol name="dwl_ipc_unstable_v2">
<description summary="inter-proccess-communication about dwl's state">
This protocol allows clients to update and get updates from dwl.
Warning! The protocol described in this file is experimental and
backward incompatible changes may be made. Backward compatible
changes may be added together with the corresponding interface
version bump.
Backward incompatible changes are done by bumping the version
number in the protocol and interface names and resetting the
interface version. Once the protocol is to be declared stable,
the 'z' prefix and the version number in the protocol and
interface names are removed and the interface version number is
reset.
</description>
<interface name="zdwl_ipc_manager_v2" version="2">
<description summary="manage dwl state">
This interface is exposed as a global in wl_registry.
Clients can use this interface to get a dwl_ipc_output.
After binding the client will recieve the dwl_ipc_manager.tags and dwl_ipc_manager.layout events.
The dwl_ipc_manager.tags and dwl_ipc_manager.layout events expose tags and layouts to the client.
</description>
<request name="release" type="destructor">
<description summary="release dwl_ipc_manager">
Indicates that the client will not the dwl_ipc_manager object anymore.
Objects created through this instance are not affected.
</description>
</request>
<request name="get_output">
<description summary="get a dwl_ipc_outout for a wl_output">
Get a dwl_ipc_outout for the specified wl_output.
</description>
<arg name="id" type="new_id" interface="zdwl_ipc_output_v2"/>
<arg name="output" type="object" interface="wl_output"/>
</request>
<event name="tags">
<description summary="Announces tag amount">
This event is sent after binding.
A roundtrip after binding guarantees the client recieved all tags.
</description>
<arg name="amount" type="uint"/>
</event>
<event name="layout">
<description summary="Announces a layout">
This event is sent after binding.
A roundtrip after binding guarantees the client recieved all layouts.
</description>
<arg name="name" type="string"/>
</event>
</interface>
<interface name="zdwl_ipc_output_v2" version="2">
<description summary="control dwl output">
Observe and control a dwl output.
Events are double-buffered:
Clients should cache events and redraw when a dwl_ipc_output.frame event is sent.
Request are not double-buffered:
The compositor will update immediately upon request.
</description>
<enum name="tag_state">
<entry name="none" value="0" summary="no state"/>
<entry name="active" value="1" summary="tag is active"/>
<entry name="urgent" value="2" summary="tag has at least one urgent client"/>
</enum>
<request name="release" type="destructor">
<description summary="release dwl_ipc_outout">
Indicates to that the client no longer needs this dwl_ipc_output.
</description>
</request>
<event name="toggle_visibility">
<description summary="Toggle client visibilty">
Indicates the client should hide or show themselves.
If the client is visible then hide, if hidden then show.
</description>
</event>
<event name="active">
<description summary="Update the selected output.">
Indicates if the output is active. Zero is invalid, nonzero is valid.
</description>
<arg name="active" type="uint"/>
</event>
<event name="tag">
<description summary="Update the state of a tag.">
Indicates that a tag has been updated.
</description>
<arg name="tag" type="uint" summary="Index of the tag"/>
<arg name="state" type="uint" enum="tag_state" summary="The state of the tag."/>
<arg name="clients" type="uint" summary="The number of clients in the tag."/>
<arg name="focused" type="uint" summary="If there is a focused client. Nonzero being valid, zero being invalid."/>
</event>
<event name="layout">
<description summary="Update the layout.">
Indicates a new layout is selected.
</description>
<arg name="layout" type="uint" summary="Index of the layout."/>
</event>
<event name="title">
<description summary="Update the title.">
Indicates the title has changed.
</description>
<arg name="title" type="string" summary="The new title name."/>
</event>
<event name="appid" since="1">
<description summary="Update the appid.">
Indicates the appid has changed.
</description>
<arg name="appid" type="string" summary="The new appid."/>
</event>
<event name="layout_symbol" since="1">
<description summary="Update the current layout symbol">
Indicates the layout has changed. Since layout symbols are dynamic.
As opposed to the zdwl_ipc_manager.layout event, this should take precendence when displaying.
You can ignore the zdwl_ipc_output.layout event.
</description>
<arg name="layout" type="string" summary="The new layout"/>
</event>
<event name="frame">
<description summary="The update sequence is done.">
Indicates that a sequence of status updates have finished and the client should redraw.
</description>
</event>
<request name="set_tags">
<description summary="Set the active tags of this output"/>
<arg name="tagmask" type="uint" summary="bitmask of the tags that should be set."/>
<arg name="toggle_tagset" type="uint" summary="toggle the selected tagset, zero for invalid, nonzero for valid."/>
</request>
<request name="set_client_tags">
<description summary="Set the tags of the focused client.">
The tags are updated as follows:
new_tags = (current_tags AND and_tags) XOR xor_tags
</description>
<arg name="and_tags" type="uint"/>
<arg name="xor_tags" type="uint"/>
</request>
<request name="set_layout">
<description summary="Set the layout of this output"/>
<arg name="index" type="uint" summary="index of a layout recieved by dwl_ipc_manager.layout"/>
</request>
<!-- Version 2 -->
<event name="fullscreen" since="2">
<description summary="Update fullscreen status">
Indicates if the selected client on this output is fullscreen.
</description>
<arg name="is_fullscreen" type="uint" summary="If the selected client is fullscreen. Nonzero is valid, zero invalid"/>
</event>
<event name="floating" since="2">
<description summary="Update the floating status">
Indicates if the selected client on this output is floating.
</description>
<arg name="is_floating" type="uint" summary="If the selected client is floating. Nonzero is valid, zero invalid"/>
</event>
</interface>
</protocol>