mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-23 07:32:43 +00:00
Compare commits
117 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 733114f0ca | |||
| fdb66ccfa3 | |||
| 6095ff84d2 | |||
| 1e1811f953 | |||
| dfb6b97159 | |||
| 65f68e7643 | |||
| 96ab92cdb1 | |||
| 1eb8a82ac4 | |||
| 24a337e6ec | |||
| f3d017077a | |||
| 06bc65549f | |||
| a8ccbe63f3 | |||
| 2d1a40caf2 | |||
| 733754bb06 | |||
| eaf6dd2cd2 | |||
| d1b36925c9 | |||
| fefcdbed4a | |||
| 04fdf1a295 | |||
| fbe89a929f | |||
| e7f736ccc9 | |||
| 7ae5039b4f | |||
| cf9c5745e5 | |||
| b39d270b9f | |||
| 98c7adfb3d | |||
| b5229636a3 | |||
| 02c257e0b1 | |||
| 27ab9cf1b1 | |||
| 1b39bbf316 | |||
| ea1b2dda63 | |||
| 21ef004886 | |||
| dae00caadd | |||
| 5eb3529275 | |||
| 359e7edc52 | |||
| 25dfdcc433 |
@@ -0,0 +1,98 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
* [0.5](#0.5)
|
||||||
|
|
||||||
|
## 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
|
||||||
@@ -5,7 +5,7 @@ include config.mk
|
|||||||
|
|
||||||
# flags for compiling
|
# flags for compiling
|
||||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
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
|
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
|
||||||
|
|
||||||
# CFLAGS / LDFLAGS
|
# CFLAGS / LDFLAGS
|
||||||
@@ -16,7 +16,7 @@ LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
|||||||
all: dwl
|
all: dwl
|
||||||
dwl: dwl.o util.o
|
dwl: dwl.o util.o
|
||||||
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -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
|
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
|
||||||
@@ -31,6 +31,9 @@ xdg-shell-protocol.h:
|
|||||||
wlr-layer-shell-unstable-v1-protocol.h:
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
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:
|
config.h:
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
@@ -40,7 +43,7 @@ clean:
|
|||||||
dist: clean
|
dist: clean
|
||||||
mkdir -p dwl-$(VERSION)
|
mkdir -p dwl-$(VERSION)
|
||||||
cp -R LICENSE* Makefile README.md client.h config.def.h\
|
cp -R LICENSE* Makefile README.md client.h config.def.h\
|
||||||
config.mk protocols dwl.1 dwl.c util.c util.h\
|
config.mk protocols dwl.1 dwl.c util.c util.h dwl.desktop\
|
||||||
dwl-$(VERSION)
|
dwl-$(VERSION)
|
||||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||||
rm -rf dwl-$(VERSION)
|
rm -rf dwl-$(VERSION)
|
||||||
@@ -52,8 +55,11 @@ install: dwl
|
|||||||
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||||
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
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:
|
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
|
.SUFFIXES: .c .o
|
||||||
.c.o:
|
.c.o:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# dwl - dwm for Wayland
|
# 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
|
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,
|
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
|
monitoring
|
||||||
- Provide information to external status bars via stdout/stdin
|
- Provide information to external status bars via stdout/stdin
|
||||||
- Urgency hints via xdg-activate protocol
|
- 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
|
- Various Wayland protocols
|
||||||
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
- 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"
|
||||||
@@ -49,14 +50,28 @@ Feature *non-goals* for the main codebase include:
|
|||||||
|
|
||||||
## Building dwl
|
## 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
|
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
|
development packages) and run `make`. If you wish to build against a Git
|
||||||
version of wlroots, check out the [wlroots-next branch].
|
version of wlroots, check out the [wlroots-next branch].
|
||||||
|
|
||||||
To enable XWayland, you should also install xorg-xwayland and uncomment its flag
|
To enable XWayland, you should uncomment its flags in `config.mk`.
|
||||||
in `config.mk`.
|
|
||||||
|
|
||||||
## Configuration
|
## 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
|
any shortcuts configured in `config.h`. There is no status bar or other
|
||||||
decoration initially; these are instead clients that can be run within
|
decoration initially; these are instead clients that can be run within
|
||||||
the Wayland session.
|
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
|
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
|
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
|
### 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
|
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
|
the `printstatus()` function for details). This information can be used to
|
||||||
populate an external status bar with a script that parses the information.
|
populate an external status bar with a script that parses the information.
|
||||||
@@ -143,7 +159,7 @@ inspiration, and to the various contributors to the project, including:
|
|||||||
|
|
||||||
|
|
||||||
[Discord server]: https://discord.gg/jJxZnrGPWN
|
[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/
|
[Wayland]: https://wayland.freedesktop.org/
|
||||||
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots/
|
||||||
[wlroots-next branch]: https://github.com/djpohly/dwl/tree/wlroots-next
|
[wlroots-next branch]: https://github.com/djpohly/dwl/tree/wlroots-next
|
||||||
|
|||||||
@@ -11,34 +11,8 @@ client_is_x11(Client *c)
|
|||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
return c->type == X11Managed || c->type == X11Unmanaged;
|
return c->type == X11Managed || c->type == X11Unmanaged;
|
||||||
#else
|
#endif
|
||||||
return 0;
|
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 *
|
static inline struct wlr_surface *
|
||||||
@@ -54,7 +28,7 @@ client_surface(Client *c)
|
|||||||
static inline int
|
static inline int
|
||||||
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
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_surface *root_surface;
|
||||||
struct wlr_layer_surface_v1 *layer_surface;
|
struct wlr_layer_surface_v1 *layer_surface;
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
@@ -65,44 +39,44 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
return type;
|
return -1;
|
||||||
root_surface = wlr_surface_get_root_surface(s);
|
root_surface = wlr_surface_get_root_surface(s);
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (wlr_surface_is_xwayland_surface(root_surface)
|
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
|
||||||
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(root_surface))) {
|
|
||||||
c = xsurface->data;
|
c = xsurface->data;
|
||||||
type = c->type;
|
type = c->type;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wlr_surface_is_layer_surface(root_surface)
|
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
|
||||||
&& (layer_surface = wlr_layer_surface_v1_from_wlr_surface(root_surface))) {
|
|
||||||
l = layer_surface->data;
|
l = layer_surface->data;
|
||||||
type = LayerShell;
|
type = LayerShell;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wlr_surface_is_xdg_surface(root_surface)
|
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
|
||||||
&& (xdg_surface = wlr_xdg_surface_from_wlr_surface(root_surface))) {
|
while (xdg_surface) {
|
||||||
while (1) {
|
tmp_xdg_surface = NULL;
|
||||||
switch (xdg_surface->role) {
|
switch (xdg_surface->role) {
|
||||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
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))
|
|
||||||
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
|
||||||
|
|
||||||
xdg_surface = wlr_xdg_surface_from_wlr_surface(xdg_surface->popup->parent);
|
|
||||||
break;
|
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
|
||||||
c = xdg_surface->data;
|
|
||||||
type = c->type;
|
|
||||||
goto end;
|
|
||||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
|
||||||
|
|
||||||
|
if (!tmp_xdg_surface)
|
||||||
|
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
||||||
|
|
||||||
|
xdg_surface = tmp_xdg_surface;
|
||||||
|
break;
|
||||||
|
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||||
|
c = xdg_surface->data;
|
||||||
|
type = c->type;
|
||||||
|
goto end;
|
||||||
|
case WLR_XDG_SURFACE_ROLE_NONE:
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,19 +92,16 @@ end:
|
|||||||
static inline void
|
static inline void
|
||||||
client_activate_surface(struct wlr_surface *s, int activated)
|
client_activate_surface(struct wlr_surface *s, int activated)
|
||||||
{
|
{
|
||||||
struct wlr_xdg_surface *surface;
|
struct wlr_xdg_toplevel *toplevel;
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
struct wlr_xwayland_surface *xsurface;
|
struct wlr_xwayland_surface *xsurface;
|
||||||
if (wlr_surface_is_xwayland_surface(s)
|
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
|
||||||
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
|
|
||||||
wlr_xwayland_surface_activate(xsurface, activated);
|
wlr_xwayland_surface_activate(xsurface, activated);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (wlr_surface_is_xdg_surface(s)
|
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s)))
|
||||||
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
|
wlr_xdg_toplevel_set_activated(toplevel, activated);
|
||||||
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
|
|
||||||
wlr_xdg_toplevel_set_activated(surface->toplevel, activated);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
@@ -140,23 +111,16 @@ client_set_bounds(Client *c, int32_t width, int32_t height)
|
|||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
if (c->surface.xdg->client->shell->version >=
|
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
|
||||||
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0)
|
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 wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
|
||||||
|
}
|
||||||
return 0;
|
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 *
|
static inline const char *
|
||||||
client_get_appid(Client *c)
|
client_get_appid(Client *c)
|
||||||
{
|
{
|
||||||
@@ -167,6 +131,27 @@ client_get_appid(Client *c)
|
|||||||
return c->surface.xdg->toplevel->app_id;
|
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
|
static inline void
|
||||||
client_get_geometry(Client *c, struct wlr_box *geom)
|
client_get_geometry(Client *c, struct wlr_box *geom)
|
||||||
{
|
{
|
||||||
@@ -192,7 +177,6 @@ client_get_parent(Client *c)
|
|||||||
#endif
|
#endif
|
||||||
if (c->surface.xdg->toplevel->parent)
|
if (c->surface.xdg->toplevel->parent)
|
||||||
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,35 +193,35 @@ client_get_title(Client *c)
|
|||||||
static inline int
|
static inline int
|
||||||
client_is_float_type(Client *c)
|
client_is_float_type(Client *c)
|
||||||
{
|
{
|
||||||
struct wlr_box min = {0}, max = {0};
|
struct wlr_xdg_toplevel *toplevel;
|
||||||
client_get_size_hints(c, &max, &min);
|
struct wlr_xdg_toplevel_state state;
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||||
|
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||||
|
size_t i;
|
||||||
if (surface->modal)
|
if (surface->modal)
|
||||||
return 1;
|
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]
|
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog]
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|
|| surface->window_type[i] == netatom[NetWMWindowTypeSplash]
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|
|| surface->window_type[i] == netatom[NetWMWindowTypeToolbar]
|
||||||
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
|| surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
||||||
return 1;
|
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
|
#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
|
toplevel = c->surface.xdg->toplevel;
|
||||||
client_is_mapped(Client *c)
|
state = toplevel->current;
|
||||||
{
|
return toplevel->parent || (state.min_width != 0 && state.min_height != 0
|
||||||
#ifdef XWAYLAND
|
&& (state.min_width == state.max_width
|
||||||
if (client_is_x11(c))
|
|| state.min_height == state.max_height));
|
||||||
return c->surface.xwayland->mapped;
|
|
||||||
#endif
|
|
||||||
return c->surface.xdg->mapped;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@@ -247,7 +231,8 @@ client_is_rendered_on_mon(Client *c, Monitor *m)
|
|||||||
* but rather actual displaying of the pixels.
|
* but rather actual displaying of the pixels.
|
||||||
* Usually VISIBLEON suffices and is also faster. */
|
* Usually VISIBLEON suffices and is also faster. */
|
||||||
struct wlr_surface_output *s;
|
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;
|
return 0;
|
||||||
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
|
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
|
||||||
if (s->output == m->wlr_output)
|
if (s->output == m->wlr_output)
|
||||||
@@ -323,6 +308,14 @@ client_send_close(Client *c)
|
|||||||
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
|
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
|
static inline void
|
||||||
client_set_fullscreen(Client *c, int fullscreen)
|
client_set_fullscreen(Client *c, int fullscreen)
|
||||||
{
|
{
|
||||||
@@ -358,18 +351,25 @@ client_set_tiled(Client *c, uint32_t edges)
|
|||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
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 *
|
static inline void
|
||||||
client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
|
client_set_suspended(Client *c, int suspended)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c)) {
|
||||||
return wlr_surface_surface_at(c->surface.xwayland->surface,
|
wlr_xwayland_surface_set_withdrawn(c->surface.xwayland, suspended);
|
||||||
cx, cy, sx, sy);
|
return;
|
||||||
|
}
|
||||||
#endif
|
#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
|
static inline int
|
||||||
|
|||||||
+17
-5
@@ -1,14 +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 */
|
/* appearance */
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
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 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 unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
|
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 */
|
/* 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 - tagcount must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
static const int tagcount = 9;
|
#define TAGCOUNT (9)
|
||||||
|
|
||||||
|
/* logging */
|
||||||
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
@@ -145,6 +154,9 @@ static const Key keys[] = {
|
|||||||
|
|
||||||
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
/* 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} },
|
||||||
|
/* 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)} }
|
#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),
|
||||||
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
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)`
|
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||||
|
|
||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG = pkg-config
|
||||||
@@ -6,6 +6,7 @@ PKG_CONFIG = pkg-config
|
|||||||
# paths
|
# paths
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANDIR = $(PREFIX)/share/man
|
MANDIR = $(PREFIX)/share/man
|
||||||
|
DATADIR = $(PREFIX)/share
|
||||||
|
|
||||||
XWAYLAND =
|
XWAYLAND =
|
||||||
XLIBS =
|
XLIBS =
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl v
|
.Op Fl v
|
||||||
|
.Op Fl d
|
||||||
.Op Fl s Ar startup command
|
.Op Fl s Ar startup command
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
@@ -22,6 +23,12 @@ option,
|
|||||||
writes its name and version to standard error and exits unsuccessfully.
|
writes its name and version to standard error and exits unsuccessfully.
|
||||||
.Pp
|
.Pp
|
||||||
When given the
|
When given the
|
||||||
|
.Fl d
|
||||||
|
option,
|
||||||
|
.Nm
|
||||||
|
enables full wlroots logging, including debug information.
|
||||||
|
.Pp
|
||||||
|
When given the
|
||||||
.Fl s
|
.Fl s
|
||||||
option,
|
option,
|
||||||
.Nm
|
.Nm
|
||||||
@@ -101,7 +108,7 @@ These environment variables are used by
|
|||||||
A directory where temporary user files, such as the Wayland socket,
|
A directory where temporary user files, such as the Wayland socket,
|
||||||
are stored.
|
are stored.
|
||||||
.It Ev XDG_CONFIG_DIR
|
.It Ev XDG_CONFIG_DIR
|
||||||
A directory containung configuration of various programs and
|
A directory containing configuration of various programs and
|
||||||
libraries, including libxkbcommon.
|
libraries, including libxkbcommon.
|
||||||
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
|
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
|
||||||
Tell how to connect to an underlying X11 or Wayland server.
|
Tell how to connect to an underlying X11 or Wayland server.
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=dwl
|
||||||
|
Comment=dwm for Wayland
|
||||||
|
Exec=dwl
|
||||||
|
Type=Application
|
||||||
Reference in New Issue
Block a user