Compare commits
164 Commits
07e03e9f5f
...
2b3504e439
Author | SHA1 | Date | |
---|---|---|---|
|
2b3504e439 | ||
|
5f7d396996 | ||
|
901d2e2d9d | ||
|
00e867d536 | ||
|
2e29189b92 | ||
|
43f31b8f1b | ||
|
ff39cac355 | ||
|
2e4fdc1664 | ||
|
b100b446b8 | ||
|
9cb1ece6cc | ||
|
01a237bd5c | ||
|
a5e068b20a | ||
|
39f4ee564b | ||
|
a353eee2ca | ||
|
66ec028b00 | ||
|
1f10e69b4c | ||
|
922e117fc5 | ||
|
2783e82bf8 | ||
|
66ef4ecfec | ||
|
d08e6a3a7e | ||
|
f579dd8668 | ||
|
24576f1fdf | ||
|
7ac76219df | ||
|
6838f909bd | ||
|
d2dd2f4986 | ||
|
a0e79d8145 | ||
|
32e66f4582 | ||
|
b4da97446a | ||
|
2751a6195d | ||
|
fcf324be6c | ||
|
b8e933b9a9 | ||
|
1044a21555 | ||
|
6bcd5d8d87 | ||
|
7611dc91d7 | ||
|
e95f14541a | ||
|
bca1b779aa | ||
|
7bdbab0400 | ||
|
dd25cdb56e | ||
|
caac2d664d | ||
|
b1740056d5 | ||
|
0067c76cab | ||
|
22d21676b0 | ||
|
d6c102d9db | ||
|
0e897608a1 | ||
|
6d0ec595d3 | ||
|
4f4c540bb9 | ||
|
8e3f5364d3 | ||
|
2212363225 | ||
|
6f8a3f9374 | ||
|
e1f3983bf8 | ||
|
31bf1cbaf6 | ||
|
d6fabe3a15 | ||
|
a4a83e95e6 | ||
|
e45ded7eea | ||
|
e5e74acfce | ||
|
892a4d3ec7 | ||
|
ab87410023 | ||
|
7085057f6d | ||
|
8c79f8dc15 | ||
|
8781f4dbf5 | ||
|
df131cdb78 | ||
|
887fde65a3 | ||
|
b299e01e44 | ||
|
6d9a915fb6 | ||
|
935b852dc5 | ||
|
a18c528300 | ||
|
72a7d78a1a | ||
|
d63f4078c5 | ||
|
f4031590cd | ||
|
0ab1ed6530 | ||
|
f695674361 | ||
|
aec21eca1f | ||
|
342850487a | ||
|
1333f8cc6e | ||
|
5baf195523 | ||
|
773bd04764 | ||
|
755fcae2af | ||
|
960c32a7d8 | ||
|
aea8dd6ae1 | ||
|
c1d8b77f7f | ||
|
e5367753bb | ||
|
9be85c1117 | ||
|
4b8c1bf31e | ||
|
d7569870b6 | ||
|
4eb54b55f3 | ||
|
d4f2c6bfd6 | ||
|
4567979b16 | ||
|
25db045392 | ||
|
78cf88670f | ||
|
ce997c4a21 | ||
|
0e5405610e | ||
|
0bb1a1cc5c | ||
|
aecff8cb26 | ||
|
ca4a97b933 | ||
|
76ba2cdab0 | ||
|
4b15bbeb33 | ||
|
831fc36bc9 | ||
|
1841527871 | ||
|
ff7c0e9508 | ||
|
33bcd2e4ca | ||
|
fbd84aca4a | ||
|
a01e402c5d | ||
|
9dd3f230c0 | ||
|
eda0613cc4 | ||
|
733114f0ca | ||
|
fdb66ccfa3 | ||
|
6095ff84d2 | ||
|
68a17f962e | ||
|
9c592da01f | ||
|
df11b7a786 | ||
|
1e1811f953 | ||
|
dfb6b97159 | ||
|
65f68e7643 | ||
|
96ab92cdb1 | ||
|
1eb8a82ac4 | ||
|
24a337e6ec | ||
|
5215712cab | ||
|
f3d017077a | ||
|
06bc65549f | ||
|
a8ccbe63f3 | ||
|
9b9b79b35e | ||
|
3d98907b98 | ||
|
f8884ffc2b | ||
|
a5e45924ed | ||
|
72adab621f | ||
|
0729f18dce | ||
|
2d1a40caf2 | ||
|
733754bb06 | ||
|
797e0c74b2 | ||
|
3c760bcd4a | ||
|
da77e34ee5 | ||
|
20f61a59af | ||
|
9d68554c59 | ||
|
bbdf2a913b | ||
|
21930621ee | ||
|
6722a89532 | ||
|
eaf6dd2cd2 | ||
|
e4921fad28 | ||
|
d1b36925c9 | ||
|
c69a2bec3f | ||
|
737688a6b1 | ||
|
fefcdbed4a | ||
|
f8373ccf25 | ||
|
7f9a212476 | ||
|
ab8334bd8a | ||
|
23ede80f74 | ||
|
04fdf1a295 | ||
|
fbe89a929f | ||
|
e7f736ccc9 | ||
|
7ae5039b4f | ||
|
f7d6a34cd9 | ||
|
cf9c5745e5 | ||
|
b39d270b9f | ||
|
98c7adfb3d | ||
|
b5229636a3 | ||
|
02c257e0b1 | ||
|
27ab9cf1b1 | ||
|
1b39bbf316 | ||
|
ea1b2dda63 | ||
|
21ef004886 | ||
|
dae00caadd | ||
|
5eb3529275 | ||
|
359e7edc52 | ||
|
25dfdcc433 |
62
.gitea/issue_template/bug_report.yml
Normal file
62
.gitea/issue_template/bug_report.yml
Normal 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
|
||||
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
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
value: |
|
||||
The steps you took to reproduce the problem.
|
||||
validations:
|
||||
required: false
|
9
.gitea/issue_template/enhancement-idea.yml
Normal file
9
.gitea/issue_template/enhancement-idea.yml
Normal file
@ -0,0 +1,9 @@
|
||||
name: Enhancement idea
|
||||
about: Suggest a feature or improvement
|
||||
title:
|
||||
labels:
|
||||
- 'Kind/Feature'
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,22 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Something in dwl isn't working correctly
|
||||
title: ''
|
||||
labels: 'A: bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Info
|
||||
dwl version:
|
||||
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
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
10
.github/ISSUE_TEMPLATE/enhancement-idea.md
vendored
@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Enhancement idea
|
||||
about: Suggest a feature or improvement
|
||||
title: ''
|
||||
labels: 'A: enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
110
CHANGELOG.md
Normal file
110
CHANGELOG.md
Normal 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
|
16
Makefile
16
Makefile
@ -5,7 +5,7 @@ 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\
|
||||
DWLDEVCFLAGS = -g -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
|
||||
|
||||
# CFLAGS / LDFLAGS
|
||||
@ -16,7 +16,7 @@ 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.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
|
||||
util.o: util.c util.h
|
||||
|
||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||
@ -31,6 +31,9 @@ xdg-shell-protocol.h:
|
||||
wlr-layer-shell-unstable-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||
cursor-shape-v1-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
||||
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
@ -39,8 +42,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)
|
||||
@ -52,8 +55,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:
|
||||
|
40
README.md
40
README.md
@ -1,6 +1,7 @@
|
||||
# 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,
|
||||
@ -26,7 +27,7 @@ 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"
|
||||
@ -38,7 +39,7 @@ 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 +50,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
|
||||
|
||||
@ -82,6 +97,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
|
||||
@ -105,7 +121,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.
|
||||
@ -143,15 +159,15 @@ 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 page on our wiki]: https://codeberg.org/dwl/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
|
||||
[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
|
||||
|
164
client.h
164
client.h
@ -11,34 +11,8 @@ client_is_x11(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
return c->type == X11Managed || c->type == X11Unmanaged;
|
||||
#else
|
||||
#endif
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
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)) {
|
||||
xcb_size_hints_t *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 *
|
||||
@ -54,7 +28,7 @@ client_surface(Client *c)
|
||||
static inline int
|
||||
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||
{
|
||||
struct wlr_xdg_surface *xdg_surface;
|
||||
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
|
||||
struct wlr_surface *root_surface;
|
||||
struct wlr_layer_surface_v1 *layer_surface;
|
||||
Client *c = NULL;
|
||||
@ -65,36 +39,37 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||
#endif
|
||||
|
||||
if (!s)
|
||||
return type;
|
||||
return -1;
|
||||
root_surface = wlr_surface_get_root_surface(s);
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (wlr_surface_is_xwayland_surface(root_surface)
|
||||
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(root_surface))) {
|
||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
|
||||
c = xsurface->data;
|
||||
type = c->type;
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (wlr_surface_is_layer_surface(root_surface)
|
||||
&& (layer_surface = wlr_layer_surface_v1_from_wlr_surface(root_surface))) {
|
||||
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
|
||||
l = layer_surface->data;
|
||||
type = LayerShell;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (wlr_surface_is_xdg_surface(root_surface)
|
||||
&& (xdg_surface = wlr_xdg_surface_from_wlr_surface(root_surface))) {
|
||||
while (1) {
|
||||
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->parent)
|
||||
if (!xdg_surface->popup || !xdg_surface->popup->parent)
|
||||
return -1;
|
||||
else if (!wlr_surface_is_xdg_surface(xdg_surface->popup->parent))
|
||||
|
||||
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 = wlr_xdg_surface_from_wlr_surface(xdg_surface->popup->parent);
|
||||
xdg_surface = tmp_xdg_surface;
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||
c = xdg_surface->data;
|
||||
@ -104,7 +79,6 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
if (pl)
|
||||
@ -118,19 +92,16 @@ end:
|
||||
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->toplevel, activated);
|
||||
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s)))
|
||||
wlr_xdg_toplevel_set_activated(toplevel, activated);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
@ -140,23 +111,16 @@ client_set_bounds(Client *c, int32_t width, int32_t height)
|
||||
if (client_is_x11(c))
|
||||
return 0;
|
||||
#endif
|
||||
if (c->surface.xdg->client->shell->version >=
|
||||
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0)
|
||||
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 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)
|
||||
{
|
||||
@ -167,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)
|
||||
{
|
||||
@ -192,7 +177,6 @@ client_get_parent(Client *c)
|
||||
#endif
|
||||
if (c->surface.xdg->toplevel->parent)
|
||||
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -209,35 +193,35 @@ client_get_title(Client *c)
|
||||
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));
|
||||
}
|
||||
|
||||
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;
|
||||
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
|
||||
@ -247,7 +231,8 @@ client_is_rendered_on_mon(Client *c, Monitor *m)
|
||||
* but rather actual displaying of the pixels.
|
||||
* Usually VISIBLEON suffices and is also faster. */
|
||||
struct wlr_surface_output *s;
|
||||
if (!c->scene->node.enabled)
|
||||
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)
|
||||
@ -323,6 +308,14 @@ client_send_close(Client *c)
|
||||
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
|
||||
client_set_fullscreen(Client *c, int fullscreen)
|
||||
{
|
||||
@ -358,18 +351,25 @@ client_set_tiled(Client *c, uint32_t edges)
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
if (wl_resource_get_version(c->surface.xdg->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
|
||||
|
29
config.def.h
29
config.def.h
@ -1,15 +1,23 @@
|
||||
/* 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 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[] = {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 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.1, 0.1, 0.1, 1.0}; /* 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 */
|
||||
@ -29,12 +37,12 @@ static const Layout layouts[] = {
|
||||
|
||||
/* monitors */
|
||||
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.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||
*/
|
||||
/* defaults */
|
||||
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||
};
|
||||
|
||||
/* keyboard */
|
||||
@ -146,6 +154,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),
|
||||
|
@ -1,4 +1,4 @@
|
||||
_VERSION = 0.4
|
||||
_VERSION = 0.5
|
||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||
|
||||
PKG_CONFIG = pkg-config
|
||||
@ -6,6 +6,7 @@ PKG_CONFIG = pkg-config
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
DATADIR = $(PREFIX)/share
|
||||
|
||||
XWAYLAND =
|
||||
XLIBS =
|
||||
|
9
dwl.1
9
dwl.1
@ -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
|
||||
@ -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.
|
||||
|
5
dwl.desktop
Normal file
5
dwl.desktop
Normal file
@ -0,0 +1,5 @@
|
||||
[Desktop Entry]
|
||||
Name=dwl
|
||||
Comment=dwm for Wayland
|
||||
Exec=dwl
|
||||
Type=Application
|
Loading…
x
Reference in New Issue
Block a user