Compare commits
562 Commits
v0.1
...
MMA_GOOD_2
Author | SHA1 | Date | |
---|---|---|---|
548fac74e1 | |||
|
569f554016 | ||
|
b59c7f6a2e | ||
|
f1639ba9d5 | ||
|
8bd3442575 | ||
|
3cc22de712 | ||
|
846ce52b92 | ||
|
a9e2ebaf41 | ||
|
9b5f0f0fc5 | ||
|
cb01ce9bcf | ||
|
9588b46b5c | ||
|
2f7834b130 | ||
|
f494891a9a | ||
|
fd2c47cb70 | ||
|
e9826de295 | ||
|
110cde8f67 | ||
|
2d9d758c8d | ||
|
332ceb7136 | ||
|
9e912cf790 | ||
|
4eabf6f7eb | ||
|
765656902f | ||
|
1438dfc150 | ||
|
3902fba769 | ||
|
7f3c9fa0ae | ||
|
952fde68a3 | ||
|
0d1ca4663c | ||
|
f6820a6c29 | ||
|
87c4c1f629 | ||
|
8559141b30 | ||
|
b8bc54b65d | ||
|
b5776e5180 | ||
|
c13d948ea9 | ||
|
fc8b2a8335 | ||
|
c00faae263 | ||
|
e46238b95e | ||
|
2385d82612 | ||
|
31106eff64 | ||
|
1fdc65ff93 | ||
|
fbaeb85363 | ||
|
570e6e2c27 | ||
|
a1b33826cf | ||
|
7710cf050d | ||
|
d14ee99661 | ||
|
cd96f889b8 | ||
|
bc72af6e24 | ||
|
bcc8ce7a40 | ||
|
ba7dcb2dea | ||
|
c8a9f63451 | ||
|
fd67087a82 | ||
|
77ba8e5127 | ||
|
c509046663 | ||
|
93de6e82a2 | ||
|
f8f94c97f5 | ||
|
1bb9c4583a | ||
|
9bcef3d040 | ||
|
ae42e4390b | ||
|
303fc72b12 | ||
|
871463c327 | ||
|
d1496a2a9b | ||
|
80084839a9 | ||
|
1aacfada29 | ||
|
14c010a0d6 | ||
|
14a1e3e2a2 | ||
|
a94d089c40 | ||
|
e91f71e8d6 | ||
|
68576799b9 | ||
|
19a8a095eb | ||
|
1f59b76d77 | ||
|
40b1c0b849 | ||
|
c017916d35 | ||
|
2260519740 | ||
|
0e993b5fb1 | ||
|
d738573e22 | ||
|
b9295e8cee | ||
|
406aebcbd2 | ||
|
dfcd142ce4 | ||
|
07bf1832bf | ||
|
174919ec53 | ||
|
a7f77160d1 | ||
|
7a343b98cf | ||
|
8d2516e83c | ||
|
f173c56c32 | ||
|
28af37cd1f | ||
|
48396a1bf8 | ||
|
b6e3fc1645 | ||
|
3431ac165d | ||
|
6ce035303e | ||
|
620fd9dc56 | ||
|
662e06e68e | ||
|
9d2eb8483b | ||
|
7eee0a8229 | ||
|
b04c73be3d | ||
|
8cdb997126 | ||
|
90a12c90a0 | ||
|
e082292606 | ||
|
deb48ff48b | ||
|
c70db2d06a | ||
|
e98719f552 | ||
|
af12e777f2 | ||
|
8e03bce621 | ||
|
87fc3a58ab | ||
|
0eff78d6c2 | ||
|
c6d97f1db7 | ||
|
829dec6598 | ||
|
ff70337c16 | ||
|
7cc6c640e2 | ||
|
72e0a560d9 | ||
|
2aa391361c | ||
|
549335ae54 | ||
|
097b4a30f5 | ||
|
c1578bc14d | ||
|
9b84940e37 | ||
|
79ad72413d | ||
|
74fce9d918 | ||
|
553ba5b7c8 | ||
|
4ae6d0f387 | ||
|
2ef5abfb72 | ||
|
8076b47cc6 | ||
|
3a77f02919 | ||
|
d26ddfc7fd | ||
|
671a9b450b | ||
|
583f471cfe | ||
|
8bce3b1583 | ||
|
c008bf2a7d | ||
|
c990dbd441 | ||
|
d969289baf | ||
|
50b6630f3d | ||
|
14641560b0 | ||
|
7b42232ad1 | ||
|
a5a0674f6a | ||
|
4dfa45659a | ||
|
b91017e713 | ||
|
70da04a714 | ||
|
2623a96ebf | ||
|
52e0d00942 | ||
|
7018b9b65c | ||
|
48ec914f43 | ||
|
40449fa64f | ||
|
ecbc2c61db | ||
|
8870ba0bb8 | ||
|
5de68ba713 | ||
|
2f8736b986 | ||
|
3c11ad9aa6 | ||
|
06d9230a96 | ||
|
22bd75226b | ||
|
063736f898 | ||
|
d5a741c9b4 | ||
|
5d8084daa7 | ||
|
07d56c6d7b | ||
|
e0d310fd84 | ||
|
3a4b7d104f | ||
|
d071a899f3 | ||
|
a48ce99e6a | ||
|
b86fcf6504 | ||
|
c00697e643 | ||
|
af741e586b | ||
|
02ac9378c4 | ||
|
437aea8662 | ||
|
6901743b0c | ||
|
720f56161e | ||
|
4d3adea683 | ||
|
79b7e755b0 | ||
|
b424602ebc | ||
|
ae31391115 | ||
|
2d6f932ecf | ||
|
aab397c30b | ||
|
cb4265ac8c | ||
|
a95338ca43 | ||
|
ae614ee512 | ||
|
feb972acd0 | ||
|
bf8cc526de | ||
|
7a2e0eef74 | ||
|
3bace9ce6b | ||
|
4ef8999624 | ||
|
7d724dc7f3 | ||
|
326eee1444 | ||
|
d8f430accf | ||
|
6aed9dc1ac | ||
|
358562e2df | ||
|
9aec6049ec | ||
|
330792b1fc | ||
|
86fe15f76c | ||
|
ee1a72211d | ||
|
2bc01debdc | ||
|
c50f187c1f | ||
|
0dea553428 | ||
|
44932053ba | ||
|
dd463b25c7 | ||
|
19c14b058c | ||
|
e645ea8301 | ||
|
e4bf83e26d | ||
|
d50bb97f56 | ||
|
475c134144 | ||
|
467123dc99 | ||
|
254f799fde | ||
|
0815626d4c | ||
|
1b22ef1616 | ||
|
f1c92b05fb | ||
|
1dfd867d9c | ||
|
294fb324d8 | ||
|
79f85bde99 | ||
|
2768af5a9b | ||
|
863eedd05e | ||
|
b92c0ff57f | ||
|
1087bc5db9 | ||
|
88f241d1cf | ||
|
43228bd493 | ||
|
ebff6e38a0 | ||
|
2cd0b3173d | ||
|
0c4740b277 | ||
|
08020d61b7 | ||
|
4d26d30220 | ||
|
0e5d7124de | ||
|
c49a42ee58 | ||
|
4465dcb6da | ||
|
b97d9e1ce1 | ||
|
2b2f72d7c2 | ||
|
05a473335e | ||
|
5d9c9a9a68 | ||
|
f673305e86 | ||
|
8cace19218 | ||
|
3e6d584de1 | ||
|
ebed67596d | ||
|
f83f1049db | ||
|
d1ff1e6f75 | ||
|
b0098d9d09 | ||
|
2d2c21664c | ||
|
52a33a2f1e | ||
|
9090106334 | ||
|
a15cb1e20e | ||
|
b860932cda | ||
|
22a6f6661a | ||
|
bda7b31174 | ||
|
ac896a7df4 | ||
|
f587b2fd2c | ||
|
317175da08 | ||
|
f4ae4c1a0b | ||
|
f85d8e79d0 | ||
|
09413da6e3 | ||
|
27514b9593 | ||
|
27f66c8715 | ||
|
52dbc97ed6 | ||
|
852fe819c4 | ||
|
2315462f96 | ||
|
c71a3ac594 | ||
|
03e167dbb7 | ||
|
894f2a3152 | ||
|
05ac420342 | ||
|
ebfefa84ba | ||
|
2d9740c2fc | ||
|
2c9423d1b7 | ||
|
df332de9d2 | ||
|
96ce40cfe9 | ||
|
99fbebcae3 | ||
|
d3efb0b29b | ||
|
1e1482adcb | ||
|
7de6920bd7 | ||
|
c8bf457c0f | ||
|
0146a9954b | ||
|
be6f573b4e | ||
|
1b38801eef | ||
|
929d3d9569 | ||
|
40e45a336a | ||
|
0c1e621b82 | ||
|
417e958a15 | ||
|
2e9c4d8ea9 | ||
|
79dcc0d327 | ||
|
55bbbc3dcb | ||
|
d4e08c0762 | ||
|
772c0fe1bd | ||
|
3273f749ea | ||
|
1183a319a0 | ||
|
3f70bbb5c4 | ||
|
8aa50dfdf1 | ||
|
d175a58d73 | ||
|
52e6bf4735 | ||
|
3b05eadeaf | ||
|
f9f3f3432b | ||
|
d4ce92a7b5 | ||
|
34521ea43b | ||
|
c6f96d5391 | ||
|
bd2f7fbb40 | ||
|
823cefd292 | ||
|
60c40c0989 | ||
|
5dfd7cf180 | ||
|
06ca860092 | ||
|
56d93898ea | ||
|
9ab5e01d5b | ||
|
ce9f264919 | ||
|
d8cf65c74f | ||
|
93a58abf29 | ||
|
1b139a860d | ||
|
41bb7a7679 | ||
|
2f39fb84ac | ||
|
d57db4cac9 | ||
|
3f86336bad | ||
|
3727f4a7b3 | ||
|
4170a90fbc | ||
|
6a0dec69ec | ||
|
b372d4b55e | ||
|
77e75cf554 | ||
|
9071ce6c84 | ||
|
84b26ef1ba | ||
|
3a72cd924c | ||
|
2a9404ac2a | ||
|
3c83e0cfb8 | ||
|
e73ea679f4 | ||
|
db647f2df6 | ||
|
cd3d0a102f | ||
|
38ba6d2277 | ||
|
c2b53c2d8d | ||
|
ecc60878b3 | ||
|
43b6e804cf | ||
|
fba820d5f6 | ||
|
1fa72b0772 | ||
|
7cee5060bc | ||
|
2144546192 | ||
|
15f5d31f98 | ||
|
5b51bb82e2 | ||
|
f5e7caac00 | ||
|
593b7eec3c | ||
|
b063dd89c3 | ||
|
fd498e1910 | ||
|
02eed717ca | ||
|
2d71c9b9ff | ||
|
87b16e6095 | ||
|
9f90011ea2 | ||
|
c1eb2b49cd | ||
|
e8192b4fc9 | ||
|
4798450944 | ||
|
ed8e80d961 | ||
|
a11f2bbc7a | ||
|
8ed88822ca | ||
|
3e82fad9c4 | ||
|
a1e24075d8 | ||
|
27598bd04a | ||
|
3868217466 | ||
|
a4c0b914f0 | ||
|
9c1943ade5 | ||
|
a9e1cd4201 | ||
|
ab03282295 | ||
|
3747b3162e | ||
|
5eefb51fea | ||
|
43f1076833 | ||
|
c63d4c41ab | ||
|
81d35aaccf | ||
|
a5210f7d77 | ||
|
48ef5e8bd2 | ||
|
264be4ebba | ||
|
1d7c756107 | ||
|
7fe7be5fb8 | ||
|
a58adbb7b9 | ||
|
3d696dfb7d | ||
|
6267593cc2 | ||
|
e8ca8a8ac7 | ||
|
4bf2923f4e | ||
|
0ff13cf216 | ||
|
d7601cd48a | ||
|
1f97655d5b | ||
|
1ab3dac5cc | ||
|
9677f99dc3 | ||
|
fa782896f8 | ||
|
33c36be2fc | ||
|
313d1f7ecc | ||
|
a2a20cca42 | ||
|
0090b6bed6 | ||
|
7b1b5c75e9 | ||
|
7b320a195c | ||
|
7ed4956b23 | ||
|
167dc03004 | ||
|
df610157e5 | ||
|
dfc347af2f | ||
|
2230f92ef0 | ||
|
e0a48accc5 | ||
|
848d89b7f3 | ||
|
ef76c921ed | ||
|
388c5580cb | ||
|
bac3221a03 | ||
|
efe2a97bcf | ||
|
5ba09b56f3 | ||
|
1678b05905 | ||
|
57d0760635 | ||
|
206427537a | ||
|
cfe7815903 | ||
|
7803022d33 | ||
|
128c2926e1 | ||
|
c5087d413f | ||
|
d94266df91 | ||
|
5f3a7887f3 | ||
|
62529e251d | ||
|
41d7fdbd60 | ||
|
8dd99d2a10 | ||
|
e0f11abd13 | ||
|
b6a3891ce6 | ||
|
a42613db9d | ||
|
d21d5ee262 | ||
|
707c1710b7 | ||
|
86ba4c8526 | ||
|
3695ac643f | ||
|
572ccd92c4 | ||
|
bcf9d8fb9a | ||
|
33e8a3f1f3 | ||
|
5668c61616 | ||
|
cf7c5eae21 | ||
|
c9964016b8 | ||
|
499cb2c2b6 | ||
|
5ed227384b | ||
|
b161b5d8f4 | ||
|
13c7e039bb | ||
|
a571ea465c | ||
|
39946e07f2 | ||
|
f80f08848b | ||
|
444a5f9dec | ||
|
6b47e2bb62 | ||
|
0b2f4f213d | ||
|
ba1540c3d0 | ||
|
2eaa8c6de3 | ||
|
ee7e8688a7 | ||
|
05883b7b2f | ||
|
feeacc88c4 | ||
|
aa679c4f29 | ||
|
4f1e557d3d | ||
|
bfbfe9f2b2 | ||
|
679f6493c9 | ||
|
9c2524b06a | ||
|
c89de53de3 | ||
|
14ce016213 | ||
|
1e134fde97 | ||
|
32612c90b6 | ||
|
5a16649e79 | ||
|
02a09cb854 | ||
|
cb9269df41 | ||
|
36b9831ffd | ||
|
5bd9be3a75 | ||
|
f125e1b9a4 | ||
|
d41cc60ec1 | ||
|
2abfd475de | ||
|
af68b71094 | ||
|
64113a682f | ||
|
573535c89c | ||
|
60a732ceb8 | ||
|
de6db97401 | ||
|
dd3920e75d | ||
|
0f04c76387 | ||
|
0f48c9552e | ||
|
0016a209e4 | ||
|
90cc3b1e2c | ||
|
41cc23e1cf | ||
|
1024928c15 | ||
|
64faad7cb6 | ||
|
ee5bd9a643 | ||
|
67896e9d8b | ||
|
9578816487 | ||
|
d9ab75721a | ||
|
80a685ee51 | ||
|
5221a329e2 | ||
|
934ce085b6 | ||
|
38606a1d23 | ||
|
9f0b16868a | ||
|
9f3f15b467 | ||
|
25671d7905 | ||
|
60a63b637c | ||
|
5622dbdaf3 | ||
|
0a0e61e58d | ||
|
fab42e7c41 | ||
|
dbd665c862 | ||
|
a4d42ea798 | ||
|
62fb4c086e | ||
|
388ab9df2f | ||
|
806ebffe7d | ||
|
fbbc1fd656 | ||
|
d4178b9d2a | ||
|
4deeddceff | ||
|
874a4df389 | ||
|
618972696d | ||
|
7d67b77a96 | ||
|
e64259abf5 | ||
|
42aea0b17d | ||
|
3c3714aac0 | ||
|
4c0d59c1a7 | ||
|
927352865c | ||
|
ef7043e4d1 | ||
|
db95024211 | ||
|
fcc869ed84 | ||
|
7017a0c64d | ||
|
96d9f010de | ||
|
f21d3796b8 | ||
|
b30e18fa20 | ||
|
7ad14a9660 | ||
|
598516d808 | ||
|
c98686cf16 | ||
|
0ad8473a57 | ||
|
a2ed3d45bb | ||
|
172bcfd3ff | ||
|
2b286ffeed | ||
|
405280fd09 | ||
|
d8f752c9b4 | ||
|
bece225934 | ||
|
a2e5c25e26 | ||
|
537ad7e3fd | ||
|
0bb25a73ec | ||
|
e4d58c39e0 | ||
|
fbd905155a | ||
|
8d8d24db09 | ||
|
8f0ce672d3 | ||
|
143dce094c | ||
|
4915214e47 | ||
|
62250661cf | ||
|
68412d8957 | ||
|
69847872bb | ||
|
79f3bbaf38 | ||
|
d8570d5ceb | ||
|
52a4d3a1e5 | ||
|
9743778d09 | ||
|
621d4c9173 | ||
|
d9cf3e064c | ||
|
73d717a924 | ||
|
bd222cb75d | ||
|
dd2adb38ae | ||
|
aeae3dadbb | ||
|
6b25e7ef27 | ||
|
8ee0200877 | ||
|
ae798c694a | ||
|
8de18f9bb4 | ||
|
71572521e9 | ||
|
9308a90d11 | ||
|
8e81c90f31 | ||
|
2d84c74657 | ||
|
068352e888 | ||
|
43bd806291 | ||
|
4b1ab7804b | ||
|
4341deae8f | ||
|
5dc9460044 | ||
|
35b93669f1 | ||
|
06982a56b5 | ||
|
60f0b667b1 | ||
|
d98ca07a64 | ||
|
b26ede4727 | ||
|
4017a27b67 | ||
|
b4d9a8662f | ||
|
d74d404026 | ||
|
5d4eadeb8e | ||
|
3203d1bafd | ||
|
ddd3c2ad7e | ||
|
b237ea0e45 | ||
|
2c08d0b421 | ||
|
03c020f058 | ||
|
1473d03293 | ||
|
c9f92bdd0e | ||
|
b8a6d3e86a | ||
|
d61658bdd7 | ||
|
45a2e25d6d | ||
|
e13d193346 | ||
|
ce7bc8125d | ||
|
e69c3d7336 | ||
|
b35182f519 | ||
|
1e2dde6674 | ||
|
05df9201b3 | ||
|
a683ec501e | ||
|
2616812a7a | ||
|
e7318f7623 | ||
|
f593820ede |
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,9 +2,21 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
about: Something in dwl isn't working correctly
|
about: Something in dwl isn't working correctly
|
||||||
title: ''
|
title: ''
|
||||||
labels: 'Type: bug'
|
labels: 'A: bug'
|
||||||
assignees: ''
|
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
|
||||||
|
-->
|
||||||
|
2
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
2
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
name: Enhancement idea
|
name: Enhancement idea
|
||||||
about: Suggest a feature or improvement
|
about: Suggest a feature or improvement
|
||||||
title: ''
|
title: ''
|
||||||
labels: 'Type: enhancement'
|
labels: 'A: enhancement'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ dwl
|
|||||||
*-protocol.c
|
*-protocol.c
|
||||||
*-protocol.h
|
*-protocol.h
|
||||||
.ccls-cache
|
.ccls-cache
|
||||||
|
config.h
|
||||||
|
4
LICENSE
4
LICENSE
@@ -1,8 +1,8 @@
|
|||||||
dwl - dwm for Wayland
|
dwl - dwm for Wayland
|
||||||
|
|
||||||
Copyright © 2020 Devin J. Pohly
|
Copyright © 2020 dwl team
|
||||||
|
|
||||||
See also the files LICENSE.tinywl and LICENSE.dwm.
|
See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
19
LICENSE.sway
Normal file
19
LICENSE.sway
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2016-2017 Drew DeVault
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
72
Makefile
72
Makefile
@@ -1,37 +1,69 @@
|
|||||||
|
.POSIX:
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -Werror=declaration-after-statement
|
# 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
|
||||||
|
|
||||||
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
# CFLAGS / LDFLAGS
|
||||||
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
|
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
|
||||||
|
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||||
PKGS = wlroots wayland-server xcb xkbcommon
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
||||||
CFLAGS += $(foreach p,$(PKGS),$(shell pkg-config --cflags $(p)))
|
|
||||||
LDLIBS += $(foreach p,$(PKGS),$(shell pkg-config --libs $(p)))
|
|
||||||
|
|
||||||
|
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
|
||||||
|
util.o: util.c util.h
|
||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# 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
|
# protocols, which are specified in XML. wlroots requires you to rig these up
|
||||||
# to your build system yourself and provide them in the include path.
|
# to your build system yourself and provide them in the include path.
|
||||||
|
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
||||||
|
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
||||||
|
|
||||||
xdg-shell-protocol.h:
|
xdg-shell-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||||
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||||
|
|
||||||
xdg-shell-protocol.c:
|
# install rules
|
||||||
|
net-tapesoftware-dwl-wm-unstable-v1-protocol.h: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
|
||||||
|
$(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_SCANNER) private-code \
|
$(WAYLAND_SCANNER) private-code \
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@
|
||||||
|
net-tapesoftware-dwl-wm-unstable-v1-protocol.o: net-tapesoftware-dwl-wm-unstable-v1-protocol.h
|
||||||
|
|
||||||
xdg-shell-protocol.o: xdg-shell-protocol.h
|
config.h:
|
||||||
|
|
||||||
config.h: | config.def.h
|
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
|
|
||||||
dwl.o: config.h xdg-shell-protocol.h
|
|
||||||
|
|
||||||
dwl: xdg-shell-protocol.o
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f dwl *.o xdg-shell-protocol.h xdg-shell-protocol.c
|
rm -f dwl *.o *-protocol.h
|
||||||
|
|
||||||
.DEFAULT_GOAL=dwl
|
dist: clean
|
||||||
.PHONY: 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\
|
||||||
|
dwl-$(VERSION)
|
||||||
|
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||||
|
rm -rf dwl-$(VERSION)
|
||||||
|
|
||||||
|
install: dwl
|
||||||
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
cp -f dwl $(DESTDIR)$(PREFIX)/bin
|
||||||
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
|
||||||
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||||
|
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
|
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||||
|
|
||||||
|
.SUFFIXES: .c .o
|
||||||
|
.c.o:
|
||||||
|
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
|
||||||
|
154
README.md
154
README.md
@@ -1,79 +1,157 @@
|
|||||||
# dwl - dwm for Wayland
|
# dwl - dwm for Wayland
|
||||||
|
|
||||||
dwl is a compact, hackable compositor for Wayland based on [wlroots](https://github.com/swaywm/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. Like dwm, dwl is:
|
Join us on our [Discord server] or at [#dwl] on irc.libera.chat.
|
||||||
|
|
||||||
|
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.
|
||||||
|
Like dwm, dwl is:
|
||||||
|
|
||||||
- Easy to understand, hack on, and extend with patches
|
- Easy to understand, hack on, and extend with patches
|
||||||
- One C source file (or a very small number) configurable via `config.h`
|
- One C source file (or a very small number) configurable via `config.h`
|
||||||
- Limited to a maximum number of SLOC (to be determined)
|
- Limited to 2200 SLOC to promote hackability
|
||||||
- Tied to as few external dependencies as possible
|
- Tied to as few external dependencies as possible
|
||||||
|
|
||||||
|
dwl is not meant to provide every feature under the sun. Instead, like dwm, it
|
||||||
|
sticks to features which are necessary, simple, and straightforward to implement
|
||||||
|
given the base on which it is built. Implemented default features are:
|
||||||
|
|
||||||
dwl is not meant to provide every feature under the sun. Instead, like dwm, it sticks to features which are necessary, simple, and straightforward to implement given the base on which it is built. Since wlroots provides a number of features that are more complicated to accomplish with Xlib and select extensions, dwl can be in some ways more featureful than dwm *while remaining just as simple.* Intended default features are:
|
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings,
|
||||||
|
client rules, mouse move/resize. Providing a built-in status bar is an
|
||||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize (see below for why the built-in status bar is a possible exception)
|
exception to this goal, to avoid dependencies on font rendering and/or
|
||||||
|
drawing libraries when an external bar could work well.
|
||||||
- Configurable multi-monitor layout support, including position and rotation
|
- Configurable multi-monitor layout support, including position and rotation
|
||||||
- Configurable HiDPI/multi-DPI support
|
- Configurable HiDPI/multi-DPI support
|
||||||
- Wayland protocols needed for daily life in the tiling world: at a minimum, xdg-shell and layer-shell (for bars/menus). Protocols trivially provided by wlroots may also be added.
|
- Idle-inhibit protocol which lets applications such as mpv disable idle
|
||||||
- XWayland support as provided by wlroots
|
monitoring
|
||||||
|
- Provide information to external status bars via stdout/stdin
|
||||||
|
- Urgency hints via xdg-activate protocol
|
||||||
|
- Support screen lockers via input-inhibitor 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"
|
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
||||||
- Basic yes/no damage tracking to avoid needless redraws (if it can be done simply and has an impact on power consumption)
|
- Layer shell popups (used by Waybar)
|
||||||
|
- Damage tracking provided by scenegraph API
|
||||||
|
|
||||||
|
Features under consideration (possibly as patches) are:
|
||||||
|
|
||||||
Other features under consideration 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)
|
||||||
|
|
||||||
- Additional Wayland compositor protocols which are trivially provided by wlroots or can be conditionally included via `config.h` settings (e.g. screen capture)
|
Feature *non-goals* for the main codebase include:
|
||||||
- External bar support instead of a built-in status bar, to avoid taking a dependency on FreeType or Pango
|
|
||||||
- Buffering of input when spawning a client so you don't have to wait for the window (use `wl_client_get_credentials` to get the PID) - would this require passing through something like dmenu? Extension protocol?
|
|
||||||
- More in-depth damage region tracking
|
|
||||||
|
|
||||||
|
|
||||||
Feature *non-goals* include:
|
|
||||||
|
|
||||||
- Client-side decoration (any more than is necessary to tell the clients not to)
|
- Client-side decoration (any more than is necessary to tell the clients not to)
|
||||||
- Client-initiated window management, such as move, resize, and close, which can be done through the compositor
|
- Client-initiated window management, such as move, resize, and close, which can
|
||||||
|
be done through the compositor
|
||||||
|
- Animations and visual effects
|
||||||
|
|
||||||
## Building dwl
|
## Building dwl
|
||||||
|
|
||||||
dwl has only two dependencies: wlroots (git version currently required) and wayland-protocols. Simply install these and run `make`.
|
dwl has only two dependencies: `wlroots` and `wayland-protocols`.
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
All configuration is done by editing `config.h` and recompiling, in the same manner as dwm. There is no way to separately restart the window manager in Wayland without restarting the entire display server, so any changes will take effect the next time dwl is executed.
|
All configuration is done by editing `config.h` and recompiling, in the same
|
||||||
|
manner as dwm. There is no way to separately restart the window manager in
|
||||||
|
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]!
|
||||||
|
|
||||||
## Running dwl
|
## Running dwl
|
||||||
|
|
||||||
dwl can be run as-is, with no arguments. In an existing Wayland or X11 session, this will open a window to act as a virtual display. When run from a TTY, the Wayland server will take over the entire virtual terminal. Clients started by dwl will have `WAYLAND_DISPLAY` set in their environment, and other clients can be started from outside the session by setting this variable accordingly.
|
dwl can be run on any of the backends supported by wlroots. This means you can
|
||||||
|
run it as a separate window inside either an X11 or Wayland session, as well
|
||||||
|
as directly from a VT console. Depending on your distro's setup, you may need
|
||||||
|
to add your user to the `video` and `input` groups before you can run dwl on
|
||||||
|
a VT. If you are using `elogind` or `systemd-logind` you need to install
|
||||||
|
polkit; otherwise you need to add yourself in the `seat` group and
|
||||||
|
enable/start the seatd daemon.
|
||||||
|
|
||||||
You can also specify a startup program using the `-s` option. The argument to this option will be run at startup as a shell command (using `sh -c`) and can serve a similar function to `.xinitrc`: starting a service manager or other startup applications. Unlike `.xinitrc`, the display server will not shut down when this process terminates. Instead, as dwl is shutting down, it will send this process a SIGTERM and wait for it to terminate (if it hasn't already). This makes it ideal not only for initialization but also for execing into a user-level service manager like s6 or `systemd --user`.
|
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.
|
||||||
|
|
||||||
More/less verbose output can be requested with flags as well:
|
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
|
||||||
|
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`].
|
||||||
|
|
||||||
* `-q`: quiet (log level WLR_SILENT)
|
Note: The `-s` command is run as a *child process* of dwl, which means that it
|
||||||
* `-v`: verbose (log level WLR_INFO)
|
does not have the ability to affect the environment of dwl or of any processes
|
||||||
* `-d`: debug (log level WLR_DEBUG)
|
that it spawns. If you need to set environment variables that affect the entire
|
||||||
|
dwl session, these must be set prior to running dwl. For example, Wayland
|
||||||
Note: Wayland requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager such as `elogind` or `systemd-logind`. If your system doesn't do this automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
requires a valid `XDG_RUNTIME_DIR`, which is usually set up by a session manager
|
||||||
|
such as `elogind` or `systemd-logind`. If your system doesn't do this
|
||||||
|
automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
||||||
|
|
||||||
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
|
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u)
|
||||||
mkdir -p $XDG_RUNTIME_DIR
|
mkdir -p $XDG_RUNTIME_DIR
|
||||||
|
dwl
|
||||||
|
|
||||||
|
### Status information
|
||||||
|
|
||||||
## Known limitations and issues
|
Information about selected layouts, current window title, 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.
|
||||||
|
Failing to read this information will cause dwl to block, so if you do want to
|
||||||
|
run a startup command that does not consume the status information, you can
|
||||||
|
close standard input with the `<&-` shell redirection, for example:
|
||||||
|
|
||||||
dwl is a work in progress, and it has not yet reached its feature goals in a number of ways:
|
dwl -s 'foot --server <&-'
|
||||||
|
|
||||||
- A window's texture is scaled for its "home" monitor only (noticeable when window sits across a monitor boundary)
|
If your startup command is a shell script, you can achieve the same inside the
|
||||||
- XWayland support is new and could use testing
|
script with the line
|
||||||
- Urgent/attention/focus-request ([not yet supported](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/9) by xdg-shell protocol)
|
|
||||||
- Statusbar support (built-in or external)
|
|
||||||
- layer-shell
|
|
||||||
- Damage tracking
|
|
||||||
- Fullscreen/fixed windows (or whatever the Wayland analogues are)
|
|
||||||
|
|
||||||
|
exec <&-
|
||||||
|
|
||||||
|
To get a list of status bars that work with dwl consult our [wiki].
|
||||||
|
|
||||||
|
## Replacements for X applications
|
||||||
|
|
||||||
|
You can find a [list of useful resources on our wiki].
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots developers. This was made possible in many cases by looking at how sway accomplished something, then trying to do the same in as suckless a way as possible. Speaking of which, many thanks to suckless.org and the dwm developers and community for the inspiration.
|
dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots
|
||||||
|
developers. This was made possible in many cases by looking at how sway
|
||||||
|
accomplished something, then trying to do the same in as suckless a way as
|
||||||
|
possible.
|
||||||
|
|
||||||
|
Many thanks to suckless.org and the dwm developers and community for the
|
||||||
|
inspiration, and to the various contributors to the project, including:
|
||||||
|
|
||||||
|
- Alexander Courtis for the XWayland implementation
|
||||||
|
- Guido Cella for the layer-shell protocol implementation, patch maintenance,
|
||||||
|
and for helping to keep the project running
|
||||||
|
- Stivvo for output management and fullscreen support, and patch maintenance
|
||||||
|
|
||||||
|
|
||||||
|
[Discord server]: https://discord.gg/jJxZnrGPWN
|
||||||
|
[#dwl]: 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
|
||||||
|
[s6]: https://skarnet.org/software/s6/
|
||||||
|
[anopa]: https://jjacky.com/anopa/
|
||||||
|
[runit]: http://smarden.org/runit/faq.html#userservices
|
||||||
|
[`systemd --user`]: https://wiki.archlinux.org/title/Systemd/User
|
||||||
|
[wiki]: https://github.com/djpohly/dwl/wiki#compatible-status-bars
|
||||||
|
[list of useful resources on our wiki]:
|
||||||
|
https://github.com/djpohly/dwl/wiki#migrating-from-x
|
||||||
|
337
client.h
Normal file
337
client.h
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
/*
|
||||||
|
* Attempt to consolidate unavoidable suck into one file, away from dwl.c. This
|
||||||
|
* file is not meant to be pretty. We use a .h file with static inline
|
||||||
|
* functions instead of a separate .c module, or function pointers like sway, so
|
||||||
|
* that they will simply compile out if the chosen #defines leave them unused.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Leave these functions first; they're used in the others */
|
||||||
|
static inline int
|
||||||
|
client_is_x11(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
return c->type == X11Managed || c->type == X11Unmanaged;
|
||||||
|
#else
|
||||||
|
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 *
|
||||||
|
client_surface(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->surface;
|
||||||
|
#endif
|
||||||
|
return c->surface.xdg->surface;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The others */
|
||||||
|
static inline void
|
||||||
|
client_activate_surface(struct wlr_surface *s, int activated)
|
||||||
|
{
|
||||||
|
struct wlr_xdg_surface *surface;
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
struct wlr_xwayland_surface *xsurface;
|
||||||
|
if (wlr_surface_is_xwayland_surface(s)
|
||||||
|
&& (xsurface = wlr_xwayland_surface_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_for_each_surface(Client *c, wlr_surface_iterator_func_t fn, void *data)
|
||||||
|
{
|
||||||
|
wlr_surface_for_each_surface(client_surface(c), fn, data);
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
wlr_xdg_surface_for_each_popup_surface(c->surface.xdg, fn, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline const char *
|
||||||
|
client_get_appid(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->class;
|
||||||
|
#endif
|
||||||
|
return c->surface.xdg->toplevel->app_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_get_geometry(Client *c, struct wlr_box *geom)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
geom->x = c->surface.xwayland->x;
|
||||||
|
geom->y = c->surface.xwayland->y;
|
||||||
|
geom->width = c->surface.xwayland->width;
|
||||||
|
geom->height = c->surface.xwayland->height;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline const char *
|
||||||
|
client_get_title(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->title;
|
||||||
|
#endif
|
||||||
|
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);
|
||||||
|
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||||
|
if (surface->modal)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
for (size_t 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;
|
||||||
|
}
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
client_is_mapped(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->mapped;
|
||||||
|
#endif
|
||||||
|
return c->surface.xdg->mapped;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
client_is_unmanaged(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
return c->type == X11Unmanaged;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
|
||||||
|
{
|
||||||
|
if (kb)
|
||||||
|
wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
|
||||||
|
kb->num_keycodes, &kb->modifiers);
|
||||||
|
else
|
||||||
|
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_restack_surface(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
|
||||||
|
XCB_STACK_MODE_ABOVE);
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_send_close(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
wlr_xwayland_surface_close(c->surface.xwayland);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
wlr_xdg_toplevel_send_close(c->surface.xdg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_set_fullscreen(Client *c, int fullscreen)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline uint32_t
|
||||||
|
client_set_size(Client *c, uint32_t width, uint32_t height)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c)) {
|
||||||
|
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||||
|
c->geom.x, c->geom.y, width, height);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
client_set_tiled(Client *c, uint32_t edges)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
wlr_xdg_toplevel_set_tiled(c->surface.xdg, edges);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct wlr_surface *
|
||||||
|
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return wlr_surface_surface_at(c->surface.xwayland->surface,
|
||||||
|
cx, cy, sx, sy);
|
||||||
|
#endif
|
||||||
|
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
client_wants_focus(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
return client_is_unmanaged(c)
|
||||||
|
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
|
||||||
|
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
client_wants_fullscreen(Client *c)
|
||||||
|
{
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->fullscreen;
|
||||||
|
#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;
|
||||||
|
}
|
63
config.def.h
63
config.def.h
@@ -1,9 +1,12 @@
|
|||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
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 rootcolor[] = {0.3, 0.3, 0.3, 1.0};
|
||||||
static const float bordercolor[] = {0.5, 0.5, 0.5, 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 float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
|
||||||
|
/* 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};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
@@ -12,8 +15,8 @@ static const Rule rules[] = {
|
|||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
/* examples:
|
/* examples:
|
||||||
{ "Gimp", NULL, 0, 1, -1 },
|
{ "Gimp", NULL, 0, 1, -1 },
|
||||||
{ "firefox", NULL, 1 << 8, 0, -1 },
|
|
||||||
*/
|
*/
|
||||||
|
{ "firefox", NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -40,11 +43,52 @@ static const struct xkb_rule_names xkb_rules = {
|
|||||||
/* example:
|
/* example:
|
||||||
.options = "ctrl:nocaps",
|
.options = "ctrl:nocaps",
|
||||||
*/
|
*/
|
||||||
|
.options = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int repeat_rate = 25;
|
static const int repeat_rate = 25;
|
||||||
static const int repeat_delay = 600;
|
static const int repeat_delay = 600;
|
||||||
|
|
||||||
|
/* Trackpad */
|
||||||
|
static const int tap_to_click = 1;
|
||||||
|
static const int tap_and_drag = 1;
|
||||||
|
static const int drag_lock = 1;
|
||||||
|
static const int natural_scrolling = 0;
|
||||||
|
static const int disable_while_typing = 1;
|
||||||
|
static const int left_handed = 0;
|
||||||
|
static const int middle_button_emulation = 0;
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
|
||||||
|
LIBINPUT_CONFIG_SCROLL_2FG
|
||||||
|
LIBINPUT_CONFIG_SCROLL_EDGE
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||||
|
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
|
||||||
|
*/
|
||||||
|
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
|
||||||
|
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
|
||||||
|
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;
|
||||||
|
|
||||||
|
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||||
#define MODKEY WLR_MODIFIER_ALT
|
#define MODKEY WLR_MODIFIER_ALT
|
||||||
|
|
||||||
#define TAGKEYS(KEY,SKEY,TAG) \
|
#define TAGKEYS(KEY,SKEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
@@ -55,11 +99,13 @@ static const int repeat_delay = 600;
|
|||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static const char *termcmd[] = { "alacritty", NULL };
|
static const char *termcmd[] = { "foot", NULL };
|
||||||
|
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||||
|
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
@@ -75,22 +121,25 @@ static const Key keys[] = {
|
|||||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
|
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
|
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
||||||
{ MODKEY, XKB_KEY_comma, focusmon, {.i = -1} },
|
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
{ MODKEY, XKB_KEY_period, focusmon, {.i = +1} },
|
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = -1} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = +1} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
||||||
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
||||||
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
||||||
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
||||||
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
||||||
TAGKEYS( XKB_KEY_6, XKB_KEY_caret, 5),
|
TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
||||||
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
||||||
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
||||||
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
||||||
|
|
||||||
|
/* 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} },
|
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
|
||||||
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
|
#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(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
|
||||||
|
15
config.mk
15
config.mk
@@ -1,5 +1,14 @@
|
|||||||
# Default compile flags (overridable by environment)
|
_VERSION = 0.3.1-dev
|
||||||
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-error=unused-function
|
VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||||
|
|
||||||
|
PKG_CONFIG = pkg-config
|
||||||
|
|
||||||
|
# paths
|
||||||
|
PREFIX = /usr/local
|
||||||
|
MANDIR = $(PREFIX)/share/man
|
||||||
|
|
||||||
|
XWAYLAND =
|
||||||
|
XLIBS =
|
||||||
# Uncomment to build XWayland support
|
# Uncomment to build XWayland support
|
||||||
#CFLAGS += -DXWAYLAND
|
#XWAYLAND = -DXWAYLAND
|
||||||
|
#XLIBS = xcb
|
||||||
|
151
dwl.1
Normal file
151
dwl.1
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
.Dd January 8, 2021
|
||||||
|
.Dt DWL 1
|
||||||
|
.Os
|
||||||
|
.Sh NAME
|
||||||
|
.Nm dwl
|
||||||
|
.Nd dwm for Wayland
|
||||||
|
.Sh SYNOPSIS
|
||||||
|
.Nm
|
||||||
|
.Op Fl v
|
||||||
|
.Op Fl s Ar startup command
|
||||||
|
.Sh DESCRIPTION
|
||||||
|
.Nm
|
||||||
|
is a Wayland compositor based on wlroots.
|
||||||
|
It is intended to fill the same space in the Wayland world that
|
||||||
|
.Nm dwm
|
||||||
|
does for X11.
|
||||||
|
.Pp
|
||||||
|
When given the
|
||||||
|
.Fl v
|
||||||
|
option,
|
||||||
|
.Nm
|
||||||
|
writes its name and version to standard error and exits unsuccessfully.
|
||||||
|
.Pp
|
||||||
|
When given the
|
||||||
|
.Fl s
|
||||||
|
option,
|
||||||
|
.Nm
|
||||||
|
starts a shell process running
|
||||||
|
.Ar command
|
||||||
|
when starting.
|
||||||
|
When stopping, it sends
|
||||||
|
.Dv SIGTERM
|
||||||
|
to the child process and waits for it to exit.
|
||||||
|
.Pp
|
||||||
|
Users are encouraged to customize
|
||||||
|
.Nm
|
||||||
|
by editing the sources, in particular
|
||||||
|
.Pa config.h .
|
||||||
|
The default key bindings are as follows:
|
||||||
|
.Bl -tag -width 20n -offset indent -compact
|
||||||
|
.It Mod-[1-9]
|
||||||
|
Show only all windows with a tag.
|
||||||
|
.It Mod-Ctrl-[1-9]
|
||||||
|
Show all windows with a tag.
|
||||||
|
.It Mod-Shift-[1-9]
|
||||||
|
Move window to a single tag.
|
||||||
|
.It Mod-Ctrl-Shift-[1-9]
|
||||||
|
Toggle tag for window.
|
||||||
|
.It Mod-p
|
||||||
|
Spawn
|
||||||
|
.Nm bemenu-run .
|
||||||
|
.It Mod-Shift-Return
|
||||||
|
Spawn
|
||||||
|
.Nm alacritty .
|
||||||
|
.It Mod-[jk]
|
||||||
|
Move focus down/up the stack.
|
||||||
|
.It Mod-[id]
|
||||||
|
Increase/decrease number of windows in master area.
|
||||||
|
.It Mod-[hl]
|
||||||
|
Decrease/increase master area.
|
||||||
|
.It Mod-Return
|
||||||
|
Move window on top of stack or switch top of stack with second window.
|
||||||
|
.It Mod-Tab
|
||||||
|
Show only all windows with previous tag.
|
||||||
|
.It Mod-Shift-c
|
||||||
|
Close window.
|
||||||
|
.It Mod-t
|
||||||
|
Switch to tabbed layout.
|
||||||
|
.It Mod-f
|
||||||
|
Switch to floating layout.
|
||||||
|
.It Mod-m
|
||||||
|
Switch to monocle layout.
|
||||||
|
.It Mod-Space
|
||||||
|
Switch to previous layout.
|
||||||
|
.It Mod-Shift-Space
|
||||||
|
Toggle floating state of window.
|
||||||
|
.It Mod-e
|
||||||
|
Toggle fullscreen state of window.
|
||||||
|
.It Mod-0
|
||||||
|
Show all windows.
|
||||||
|
.It Mod-Shift-0
|
||||||
|
Set all tags for window.
|
||||||
|
.It Mod-,
|
||||||
|
Move focus to previous monitor.
|
||||||
|
.It Mod-.
|
||||||
|
Move focus to next monitor.
|
||||||
|
.It Mod-Shift-,
|
||||||
|
Move window to previous monitor.
|
||||||
|
.It Mod-Shift-.
|
||||||
|
Move window to next monitor.
|
||||||
|
.It Mod-Shift-q
|
||||||
|
Quit
|
||||||
|
.Nm .
|
||||||
|
.El
|
||||||
|
These might differ depending on your keyboard layout.
|
||||||
|
.Sh ENVIRONMENT
|
||||||
|
These environment variables are used by
|
||||||
|
.Nm :
|
||||||
|
.Bl -tag -width XDG_RUNTIME_DIR
|
||||||
|
.It Ev XDG_RUNTIME_DIR
|
||||||
|
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
|
||||||
|
libraries, including libxkbcommon.
|
||||||
|
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
|
||||||
|
Tell how to connect to an underlying X11 or Wayland server.
|
||||||
|
.It Ev WLR_*
|
||||||
|
Various variables specific to wlroots.
|
||||||
|
.It Ev XKB_* , XLOCALEDIR , XCOMPOSEFILE
|
||||||
|
Various variables specific to libxkbcommon.
|
||||||
|
.It Ev XCURSOR_PATH
|
||||||
|
List of directories to search for XCursor themes in.
|
||||||
|
.It Ev HOME
|
||||||
|
A directory where there are always dear files there for you.
|
||||||
|
Waiting for you to clean them up.
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
These are set by
|
||||||
|
.Nm :
|
||||||
|
.Bl -tag -width WAYLAND_DISPLAY
|
||||||
|
.It Ev WAYLAND_DISPLAY
|
||||||
|
Tell how to connect to
|
||||||
|
.Nm .
|
||||||
|
.It Ev DISPLAY
|
||||||
|
If using
|
||||||
|
.Nm Xwayland ,
|
||||||
|
tell how to connect to the
|
||||||
|
.Nm Xwayland
|
||||||
|
server.
|
||||||
|
.El
|
||||||
|
.Sh EXAMPLES
|
||||||
|
Start
|
||||||
|
.Nm
|
||||||
|
with s6 in the background:
|
||||||
|
.Dl dwl -s 's6-svscan <&-'
|
||||||
|
.Sh SEE ALSO
|
||||||
|
.Xr alacritty 1 ,
|
||||||
|
.Xr bemenu 1 ,
|
||||||
|
.Xr dwm 1 ,
|
||||||
|
.Xr xkeyboard-config 7
|
||||||
|
.Sh CAVEATS
|
||||||
|
The child process's standard input is connected with a pipe to
|
||||||
|
.Nm .
|
||||||
|
If the child process neither reads from the pipe nor closes its
|
||||||
|
standard input,
|
||||||
|
.Nm
|
||||||
|
will freeze after a while due to it blocking when writing to the full
|
||||||
|
pipe buffer.
|
||||||
|
.Sh BUGS
|
||||||
|
All of them.
|
164
protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
Normal file
164
protocols/net-tapesoftware-dwl-wm-unstable-v1.xml
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<protocol name="net_tapesoftware_dwl_wm_unstable_v1">
|
||||||
|
<copyright>
|
||||||
|
Copyright (c) 2021 Raphael Robatsch
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice (including the
|
||||||
|
next paragraph) shall be included in all copies or substantial portions
|
||||||
|
of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<interface name="znet_tapesoftware_dwl_wm_v1" version="1">
|
||||||
|
<description summary="control the dwl state">
|
||||||
|
This interface is exposed as a global in the wl_registry.
|
||||||
|
|
||||||
|
Clients can use this protocol to receive updates of the window manager
|
||||||
|
state (active tags, active layout, and focused window).
|
||||||
|
Clients can also control this state.
|
||||||
|
|
||||||
|
After binding, the client will receive the available tags and layouts
|
||||||
|
with the 'tag' and 'layout' events. These can be used in subsequent
|
||||||
|
dwl_wm_monitor_v1.set_tags/set_layout requests, and to interpret the
|
||||||
|
dwl_wm_monitor_v1.layout/tag events.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<request name="release" type="destructor">
|
||||||
|
<description summary="release dwl_wm">
|
||||||
|
This request indicates that the client will not use the dwl_wm
|
||||||
|
object any more. Objects that have been created through this instance
|
||||||
|
are not affected.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="get_monitor">
|
||||||
|
<description summary="gets a dwl monitor from an output">
|
||||||
|
Gets a dwl monitor for the specified output. The window manager
|
||||||
|
state on the output can be controlled using the monitor.
|
||||||
|
</description>
|
||||||
|
<arg name="id" type="new_id" interface="znet_tapesoftware_dwl_wm_monitor_v1" />
|
||||||
|
<arg name="output" type="object" interface="wl_output" />
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<event name="tag">
|
||||||
|
<description summary="announces the presence of a tag">
|
||||||
|
This event is sent immediately after binding.
|
||||||
|
A roundtrip after binding guarantees that the client has received all tags.
|
||||||
|
</description>
|
||||||
|
<arg name="name" type="string"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="layout">
|
||||||
|
<description summary="announces the presence of a layout">
|
||||||
|
This event is sent immediately after binding.
|
||||||
|
A roundtrip after binding guarantees that the client has received all layouts.
|
||||||
|
</description>
|
||||||
|
<arg name="name" type="string"/>
|
||||||
|
</event>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<interface name="znet_tapesoftware_dwl_wm_monitor_v1" version="1">
|
||||||
|
<description summary="control one monitor">
|
||||||
|
Observes and controls one monitor.
|
||||||
|
|
||||||
|
Events are double-buffered: Clients should cache all events and only
|
||||||
|
redraw themselves once the 'frame' event is sent.
|
||||||
|
|
||||||
|
Requests are not double-buffered: The compositor will update itself
|
||||||
|
immediately.
|
||||||
|
</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_monitor">
|
||||||
|
This request indicates that the client is done with this dwl_monitor.
|
||||||
|
All further requests are ignored.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<event name="selected">
|
||||||
|
<description summary="updates the selected state of the monitor">
|
||||||
|
If 'selected' is nonzero, this monitor is the currently selected one.
|
||||||
|
</description>
|
||||||
|
<arg name="selected" type="uint"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="tag">
|
||||||
|
<description summary="updates the state of one tag">
|
||||||
|
Announces the update of a tag. num_clients and focused_client can be
|
||||||
|
used to draw client indicators.
|
||||||
|
</description>
|
||||||
|
<arg name="tag" type="uint" summary="index of a tag received by the dwl_wm_v1.tag event." />
|
||||||
|
<arg name="state" type="uint" enum="tag_state"/>
|
||||||
|
<arg name="num_clients" type="uint" summary="number of clients on this tag"/>
|
||||||
|
<arg name="focused_client" type="int" summary="out of num_clients. -1 if there is no focused client"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="layout">
|
||||||
|
<description summary="updates the selected layout">
|
||||||
|
Announces the update of the selected layout.
|
||||||
|
</description>
|
||||||
|
<arg name="layout" type="uint" summary="index of a layout received by the dwl_wm_v1.layout event."/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="title">
|
||||||
|
<description summary="updates the focused client">
|
||||||
|
Announces the update of the selected client.
|
||||||
|
</description>
|
||||||
|
<arg name="title" type="string"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="frame">
|
||||||
|
<description summary="end of status update sequence">
|
||||||
|
Sent after all other events belonging to the status update has been sent.
|
||||||
|
Clients should redraw themselves now.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<request name="set_tags">
|
||||||
|
<description summary="sets the active tags on this monitor.">
|
||||||
|
Changes are applied immediately.
|
||||||
|
</description>
|
||||||
|
<arg name="tagmask" type="uint" summary="bitmask of the tags that should be set."/>
|
||||||
|
<arg name="toggle_tagset" type="uint"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="set_client_tags">
|
||||||
|
<description summary="updates the tags of the focused client.">
|
||||||
|
tags are updated as follows:
|
||||||
|
new_tags = (current_tags AND and_tags) XOR xor_tags
|
||||||
|
|
||||||
|
Changes are applied immediately.
|
||||||
|
</description>
|
||||||
|
<arg name="and_tags" type="uint"/>
|
||||||
|
<arg name="xor_tags" type="uint"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="set_layout">
|
||||||
|
<description summary="sets the active layout on this monitor.">
|
||||||
|
Changes are applied immediately.
|
||||||
|
</description>
|
||||||
|
<arg name="layout" type="uint" summary="index of a layout received by the dwl_wm_v1.layout event."/>
|
||||||
|
</request>
|
||||||
|
</interface>
|
||||||
|
</protocol>
|
390
protocols/wlr-layer-shell-unstable-v1.xml
Normal file
390
protocols/wlr-layer-shell-unstable-v1.xml
Normal file
@@ -0,0 +1,390 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<protocol name="wlr_layer_shell_unstable_v1">
|
||||||
|
<copyright>
|
||||||
|
Copyright © 2017 Drew DeVault
|
||||||
|
|
||||||
|
Permission to use, copy, modify, distribute, and sell this
|
||||||
|
software and its documentation for any purpose is hereby granted
|
||||||
|
without fee, provided that the above copyright notice appear in
|
||||||
|
all copies and that both that copyright notice and this permission
|
||||||
|
notice appear in supporting documentation, and that the name of
|
||||||
|
the copyright holders not be used in advertising or publicity
|
||||||
|
pertaining to distribution of the software without specific,
|
||||||
|
written prior permission. The copyright holders make no
|
||||||
|
representations about the suitability of this software for any
|
||||||
|
purpose. It is provided "as is" without express or implied
|
||||||
|
warranty.
|
||||||
|
|
||||||
|
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||||
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||||
|
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||||
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||||
|
THIS SOFTWARE.
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<interface name="zwlr_layer_shell_v1" version="4">
|
||||||
|
<description summary="create surfaces that are layers of the desktop">
|
||||||
|
Clients can use this interface to assign the surface_layer role to
|
||||||
|
wl_surfaces. Such surfaces are assigned to a "layer" of the output and
|
||||||
|
rendered with a defined z-depth respective to each other. They may also be
|
||||||
|
anchored to the edges and corners of a screen and specify input handling
|
||||||
|
semantics. This interface should be suitable for the implementation of
|
||||||
|
many desktop shell components, and a broad number of other applications
|
||||||
|
that interact with the desktop.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<request name="get_layer_surface">
|
||||||
|
<description summary="create a layer_surface from a surface">
|
||||||
|
Create a layer surface for an existing surface. This assigns the role of
|
||||||
|
layer_surface, or raises a protocol error if another role is already
|
||||||
|
assigned.
|
||||||
|
|
||||||
|
Creating a layer surface from a wl_surface which has a buffer attached
|
||||||
|
or committed is a client error, and any attempts by a client to attach
|
||||||
|
or manipulate a buffer prior to the first layer_surface.configure call
|
||||||
|
must also be treated as errors.
|
||||||
|
|
||||||
|
After creating a layer_surface object and setting it up, the client
|
||||||
|
must perform an initial commit without any buffer attached.
|
||||||
|
The compositor will reply with a layer_surface.configure event.
|
||||||
|
The client must acknowledge it and is then allowed to attach a buffer
|
||||||
|
to map the surface.
|
||||||
|
|
||||||
|
You may pass NULL for output to allow the compositor to decide which
|
||||||
|
output to use. Generally this will be the one that the user most
|
||||||
|
recently interacted with.
|
||||||
|
|
||||||
|
Clients can specify a namespace that defines the purpose of the layer
|
||||||
|
surface.
|
||||||
|
</description>
|
||||||
|
<arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
|
||||||
|
<arg name="surface" type="object" interface="wl_surface"/>
|
||||||
|
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
|
||||||
|
<arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
|
||||||
|
<arg name="namespace" type="string" summary="namespace for the layer surface"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<enum name="error">
|
||||||
|
<entry name="role" value="0" summary="wl_surface has another role"/>
|
||||||
|
<entry name="invalid_layer" value="1" summary="layer value is invalid"/>
|
||||||
|
<entry name="already_constructed" value="2" summary="wl_surface has a buffer attached or committed"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<enum name="layer">
|
||||||
|
<description summary="available layers for surfaces">
|
||||||
|
These values indicate which layers a surface can be rendered in. They
|
||||||
|
are ordered by z depth, bottom-most first. Traditional shell surfaces
|
||||||
|
will typically be rendered between the bottom and top layers.
|
||||||
|
Fullscreen shell surfaces are typically rendered at the top layer.
|
||||||
|
Multiple surfaces can share a single layer, and ordering within a
|
||||||
|
single layer is undefined.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<entry name="background" value="0"/>
|
||||||
|
<entry name="bottom" value="1"/>
|
||||||
|
<entry name="top" value="2"/>
|
||||||
|
<entry name="overlay" value="3"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<!-- Version 3 additions -->
|
||||||
|
|
||||||
|
<request name="destroy" type="destructor" since="3">
|
||||||
|
<description summary="destroy the layer_shell object">
|
||||||
|
This request indicates that the client will not use the layer_shell
|
||||||
|
object any more. Objects that have been created through this instance
|
||||||
|
are not affected.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
</interface>
|
||||||
|
|
||||||
|
<interface name="zwlr_layer_surface_v1" version="4">
|
||||||
|
<description summary="layer metadata interface">
|
||||||
|
An interface that may be implemented by a wl_surface, for surfaces that
|
||||||
|
are designed to be rendered as a layer of a stacked desktop-like
|
||||||
|
environment.
|
||||||
|
|
||||||
|
Layer surface state (layer, size, anchor, exclusive zone,
|
||||||
|
margin, interactivity) is double-buffered, and will be applied at the
|
||||||
|
time wl_surface.commit of the corresponding wl_surface is called.
|
||||||
|
|
||||||
|
Attaching a null buffer to a layer surface unmaps it.
|
||||||
|
|
||||||
|
Unmapping a layer_surface means that the surface cannot be shown by the
|
||||||
|
compositor until it is explicitly mapped again. The layer_surface
|
||||||
|
returns to the state it had right after layer_shell.get_layer_surface.
|
||||||
|
The client can re-map the surface by performing a commit without any
|
||||||
|
buffer attached, waiting for a configure event and handling it as usual.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<request name="set_size">
|
||||||
|
<description summary="sets the size of the surface">
|
||||||
|
Sets the size of the surface in surface-local coordinates. The
|
||||||
|
compositor will display the surface centered with respect to its
|
||||||
|
anchors.
|
||||||
|
|
||||||
|
If you pass 0 for either value, the compositor will assign it and
|
||||||
|
inform you of the assignment in the configure event. You must set your
|
||||||
|
anchor to opposite edges in the dimensions you omit; not doing so is a
|
||||||
|
protocol error. Both values are 0 by default.
|
||||||
|
|
||||||
|
Size is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="width" type="uint"/>
|
||||||
|
<arg name="height" type="uint"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="set_anchor">
|
||||||
|
<description summary="configures the anchor point of the surface">
|
||||||
|
Requests that the compositor anchor the surface to the specified edges
|
||||||
|
and corners. If two orthogonal edges are specified (e.g. 'top' and
|
||||||
|
'left'), then the anchor point will be the intersection of the edges
|
||||||
|
(e.g. the top left corner of the output); otherwise the anchor point
|
||||||
|
will be centered on that edge, or in the center if none is specified.
|
||||||
|
|
||||||
|
Anchor is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="anchor" type="uint" enum="anchor"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="set_exclusive_zone">
|
||||||
|
<description summary="configures the exclusive geometry of this surface">
|
||||||
|
Requests that the compositor avoids occluding an area with other
|
||||||
|
surfaces. The compositor's use of this information is
|
||||||
|
implementation-dependent - do not assume that this region will not
|
||||||
|
actually be occluded.
|
||||||
|
|
||||||
|
A positive value is only meaningful if the surface is anchored to one
|
||||||
|
edge or an edge and both perpendicular edges. If the surface is not
|
||||||
|
anchored, anchored to only two perpendicular edges (a corner), anchored
|
||||||
|
to only two parallel edges or anchored to all edges, a positive value
|
||||||
|
will be treated the same as zero.
|
||||||
|
|
||||||
|
A positive zone is the distance from the edge in surface-local
|
||||||
|
coordinates to consider exclusive.
|
||||||
|
|
||||||
|
Surfaces that do not wish to have an exclusive zone may instead specify
|
||||||
|
how they should interact with surfaces that do. If set to zero, the
|
||||||
|
surface indicates that it would like to be moved to avoid occluding
|
||||||
|
surfaces with a positive exclusive zone. If set to -1, the surface
|
||||||
|
indicates that it would not like to be moved to accommodate for other
|
||||||
|
surfaces, and the compositor should extend it all the way to the edges
|
||||||
|
it is anchored to.
|
||||||
|
|
||||||
|
For example, a panel might set its exclusive zone to 10, so that
|
||||||
|
maximized shell surfaces are not shown on top of it. A notification
|
||||||
|
might set its exclusive zone to 0, so that it is moved to avoid
|
||||||
|
occluding the panel, but shell surfaces are shown underneath it. A
|
||||||
|
wallpaper or lock screen might set their exclusive zone to -1, so that
|
||||||
|
they stretch below or over the panel.
|
||||||
|
|
||||||
|
The default value is 0.
|
||||||
|
|
||||||
|
Exclusive zone is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="zone" type="int"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="set_margin">
|
||||||
|
<description summary="sets a margin from the anchor point">
|
||||||
|
Requests that the surface be placed some distance away from the anchor
|
||||||
|
point on the output, in surface-local coordinates. Setting this value
|
||||||
|
for edges you are not anchored to has no effect.
|
||||||
|
|
||||||
|
The exclusive zone includes the margin.
|
||||||
|
|
||||||
|
Margin is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="top" type="int"/>
|
||||||
|
<arg name="right" type="int"/>
|
||||||
|
<arg name="bottom" type="int"/>
|
||||||
|
<arg name="left" type="int"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<enum name="keyboard_interactivity">
|
||||||
|
<description summary="types of keyboard interaction possible for a layer shell surface">
|
||||||
|
Types of keyboard interaction possible for layer shell surfaces. The
|
||||||
|
rationale for this is twofold: (1) some applications are not interested
|
||||||
|
in keyboard events and not allowing them to be focused can improve the
|
||||||
|
desktop experience; (2) some applications will want to take exclusive
|
||||||
|
keyboard focus.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<entry name="none" value="0">
|
||||||
|
<description summary="no keyboard focus is possible">
|
||||||
|
This value indicates that this surface is not interested in keyboard
|
||||||
|
events and the compositor should never assign it the keyboard focus.
|
||||||
|
|
||||||
|
This is the default value, set for newly created layer shell surfaces.
|
||||||
|
|
||||||
|
This is useful for e.g. desktop widgets that display information or
|
||||||
|
only have interaction with non-keyboard input devices.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
<entry name="exclusive" value="1">
|
||||||
|
<description summary="request exclusive keyboard focus">
|
||||||
|
Request exclusive keyboard focus if this surface is above the shell surface layer.
|
||||||
|
|
||||||
|
For the top and overlay layers, the seat will always give
|
||||||
|
exclusive keyboard focus to the top-most layer which has keyboard
|
||||||
|
interactivity set to exclusive. If this layer contains multiple
|
||||||
|
surfaces with keyboard interactivity set to exclusive, the compositor
|
||||||
|
determines the one receiving keyboard events in an implementation-
|
||||||
|
defined manner. In this case, no guarantee is made when this surface
|
||||||
|
will receive keyboard focus (if ever).
|
||||||
|
|
||||||
|
For the bottom and background layers, the compositor is allowed to use
|
||||||
|
normal focus semantics.
|
||||||
|
|
||||||
|
This setting is mainly intended for applications that need to ensure
|
||||||
|
they receive all keyboard events, such as a lock screen or a password
|
||||||
|
prompt.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
<entry name="on_demand" value="2" since="4">
|
||||||
|
<description summary="request regular keyboard focus semantics">
|
||||||
|
This requests the compositor to allow this surface to be focused and
|
||||||
|
unfocused by the user in an implementation-defined manner. The user
|
||||||
|
should be able to unfocus this surface even regardless of the layer
|
||||||
|
it is on.
|
||||||
|
|
||||||
|
Typically, the compositor will want to use its normal mechanism to
|
||||||
|
manage keyboard focus between layer shell surfaces with this setting
|
||||||
|
and regular toplevels on the desktop layer (e.g. click to focus).
|
||||||
|
Nevertheless, it is possible for a compositor to require a special
|
||||||
|
interaction to focus or unfocus layer shell surfaces (e.g. requiring
|
||||||
|
a click even if focus follows the mouse normally, or providing a
|
||||||
|
keybinding to switch focus between layers).
|
||||||
|
|
||||||
|
This setting is mainly intended for desktop shell components (e.g.
|
||||||
|
panels) that allow keyboard interaction. Using this option can allow
|
||||||
|
implementing a desktop shell that can be fully usable without the
|
||||||
|
mouse.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<request name="set_keyboard_interactivity">
|
||||||
|
<description summary="requests keyboard events">
|
||||||
|
Set how keyboard events are delivered to this surface. By default,
|
||||||
|
layer shell surfaces do not receive keyboard events; this request can
|
||||||
|
be used to change this.
|
||||||
|
|
||||||
|
This setting is inherited by child surfaces set by the get_popup
|
||||||
|
request.
|
||||||
|
|
||||||
|
Layer surfaces receive pointer, touch, and tablet events normally. If
|
||||||
|
you do not want to receive them, set the input region on your surface
|
||||||
|
to an empty region.
|
||||||
|
|
||||||
|
Keyboard interactivity is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="get_popup">
|
||||||
|
<description summary="assign this layer_surface as an xdg_popup parent">
|
||||||
|
This assigns an xdg_popup's parent to this layer_surface. This popup
|
||||||
|
should have been created via xdg_surface::get_popup with the parent set
|
||||||
|
to NULL, and this request must be invoked before committing the popup's
|
||||||
|
initial state.
|
||||||
|
|
||||||
|
See the documentation of xdg_popup for more details about what an
|
||||||
|
xdg_popup is and how it is used.
|
||||||
|
</description>
|
||||||
|
<arg name="popup" type="object" interface="xdg_popup"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="ack_configure">
|
||||||
|
<description summary="ack a configure event">
|
||||||
|
When a configure event is received, if a client commits the
|
||||||
|
surface in response to the configure event, then the client
|
||||||
|
must make an ack_configure request sometime before the commit
|
||||||
|
request, passing along the serial of the configure event.
|
||||||
|
|
||||||
|
If the client receives multiple configure events before it
|
||||||
|
can respond to one, it only has to ack the last configure event.
|
||||||
|
|
||||||
|
A client is not required to commit immediately after sending
|
||||||
|
an ack_configure request - it may even ack_configure several times
|
||||||
|
before its next surface commit.
|
||||||
|
|
||||||
|
A client may send multiple ack_configure requests before committing, but
|
||||||
|
only the last request sent before a commit indicates which configure
|
||||||
|
event the client really is responding to.
|
||||||
|
</description>
|
||||||
|
<arg name="serial" type="uint" summary="the serial from the configure event"/>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<request name="destroy" type="destructor">
|
||||||
|
<description summary="destroy the layer_surface">
|
||||||
|
This request destroys the layer surface.
|
||||||
|
</description>
|
||||||
|
</request>
|
||||||
|
|
||||||
|
<event name="configure">
|
||||||
|
<description summary="suggest a surface change">
|
||||||
|
The configure event asks the client to resize its surface.
|
||||||
|
|
||||||
|
Clients should arrange their surface for the new states, and then send
|
||||||
|
an ack_configure request with the serial sent in this configure event at
|
||||||
|
some point before committing the new surface.
|
||||||
|
|
||||||
|
The client is free to dismiss all but the last configure event it
|
||||||
|
received.
|
||||||
|
|
||||||
|
The width and height arguments specify the size of the window in
|
||||||
|
surface-local coordinates.
|
||||||
|
|
||||||
|
The size is a hint, in the sense that the client is free to ignore it if
|
||||||
|
it doesn't resize, pick a smaller size (to satisfy aspect ratio or
|
||||||
|
resize in steps of NxM pixels). If the client picks a smaller size and
|
||||||
|
is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
|
||||||
|
surface will be centered on this axis.
|
||||||
|
|
||||||
|
If the width or height arguments are zero, it means the client should
|
||||||
|
decide its own window dimension.
|
||||||
|
</description>
|
||||||
|
<arg name="serial" type="uint"/>
|
||||||
|
<arg name="width" type="uint"/>
|
||||||
|
<arg name="height" type="uint"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event name="closed">
|
||||||
|
<description summary="surface should be closed">
|
||||||
|
The closed event is sent by the compositor when the surface will no
|
||||||
|
longer be shown. The output may have been destroyed or the user may
|
||||||
|
have asked for it to be removed. Further changes to the surface will be
|
||||||
|
ignored. The client should destroy the resource after receiving this
|
||||||
|
event, and create a new surface if they so choose.
|
||||||
|
</description>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<enum name="error">
|
||||||
|
<entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
|
||||||
|
<entry name="invalid_size" value="1" summary="size is invalid"/>
|
||||||
|
<entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
|
||||||
|
<entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<enum name="anchor" bitfield="true">
|
||||||
|
<entry name="top" value="1" summary="the top edge of the anchor rectangle"/>
|
||||||
|
<entry name="bottom" value="2" summary="the bottom edge of the anchor rectangle"/>
|
||||||
|
<entry name="left" value="4" summary="the left edge of the anchor rectangle"/>
|
||||||
|
<entry name="right" value="8" summary="the right edge of the anchor rectangle"/>
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<!-- Version 2 additions -->
|
||||||
|
|
||||||
|
<request name="set_layer" since="2">
|
||||||
|
<description summary="change the layer of the surface">
|
||||||
|
Change the layer that the surface is rendered on.
|
||||||
|
|
||||||
|
Layer is double-buffered, see wl_surface.commit.
|
||||||
|
</description>
|
||||||
|
<arg name="layer" type="uint" enum="zwlr_layer_shell_v1.layer" summary="layer to move this surface to"/>
|
||||||
|
</request>
|
||||||
|
</interface>
|
||||||
|
</protocol>
|
35
util.c
Normal file
35
util.c
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/* See LICENSE.dwm file for copyright and license details. */
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
die(const char *fmt, ...) {
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||||
|
fputc(' ', stderr);
|
||||||
|
perror(NULL);
|
||||||
|
} else {
|
||||||
|
fputc('\n', stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
ecalloc(size_t nmemb, size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
if (!(p = calloc(nmemb, size)))
|
||||||
|
die("calloc:");
|
||||||
|
return p;
|
||||||
|
}
|
Reference in New Issue
Block a user