mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-23 23:52:41 +00:00
Compare commits
16 Commits
991236e902
..
0.7
| Author | SHA1 | Date | |
|---|---|---|---|
| d5bbe6d54d | |||
| 2783d91611 | |||
| b2abff8b57 | |||
| 298c6e1839 | |||
| cfc80c8f44 | |||
| 0e0c97db56 | |||
| 74e45c4014 | |||
| 464dddc110 | |||
| cb01023db6 | |||
| 5bbb0ab404 | |||
| ed74960373 | |||
| cc622d4dd5 | |||
| 3256ae0679 | |||
| e3f1aab770 | |||
| 57153fd557 | |||
| a9bcdff683 |
@@ -1,3 +1 @@
|
|||||||
Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com>
|
Lennart Jablonka <humm@ljabl.com> <hummsmith42@gmail.com>
|
||||||
Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@outlook.com>
|
|
||||||
Leonardo Hernández Hernández <leohdz172@proton.me> <leohdz172@protonmail.com>
|
|
||||||
|
|||||||
+7
-10
@@ -8,15 +8,6 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Support for the linux-drm-syncobj-v1 protocol ([wlroots!4715][wlroots!4715], [#685][685])
|
|
||||||
* Allow the use of non-system wlroots library ([#646][646])
|
|
||||||
|
|
||||||
[wlroots!4715]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4715
|
|
||||||
[685]: https://codeberg.org/dwl/dwl/pulls/685
|
|
||||||
[646]: https://codeberg.org/dwl/dwl/pulls/646
|
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
@@ -30,7 +21,7 @@
|
|||||||
|
|
||||||
## 0.7
|
## 0.7
|
||||||
|
|
||||||
This version is just 0.6 with wlroots 0.18 compatibility.
|
See also [0.6](#0.6) release notes. 0.7 builds against wlroots 0.18.x.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
@@ -41,9 +32,15 @@ This version is just 0.6 with wlroots 0.18 compatibility.
|
|||||||
[601]: https://codeberg.org/dwl/dwl/issues/601
|
[601]: https://codeberg.org/dwl/dwl/issues/601
|
||||||
|
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Crash when re-mapping unmapped clients.
|
||||||
|
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
Guido Cella
|
Guido Cella
|
||||||
|
Lennart Jablonka
|
||||||
|
|
||||||
|
|
||||||
## 0.6
|
## 0.6
|
||||||
|
|||||||
@@ -6,15 +6,15 @@ include config.mk
|
|||||||
# flags for compiling
|
# flags for compiling
|
||||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
||||||
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
||||||
DWLDEVCFLAGS = -g -Wpedantic -Wall -Wextra -Wdeclaration-after-statement \
|
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
|
||||||
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
-Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
||||||
-Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
|
-Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
|
||||||
-Wfloat-conversion
|
-Wfloat-conversion
|
||||||
|
|
||||||
# CFLAGS / LDFLAGS
|
# CFLAGS / LDFLAGS
|
||||||
PKGS = wayland-server xkbcommon libinput $(XLIBS)
|
PKGS = wlroots-0.18 wayland-server xkbcommon libinput $(XLIBS)
|
||||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
||||||
|
|
||||||
all: dwl
|
all: dwl
|
||||||
dwl: dwl.o util.o
|
dwl: dwl.o util.o
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# dwl - dwm for Wayland
|
# dwl - dwm for Wayland
|
||||||
|
|
||||||
Join us on our IRC channel: [#dwl on Libera Chat]
|
Join us on our IRC channel: [#dwl on Libera Chat]
|
||||||
Or on the community-maintained [Discord server].
|
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,
|
||||||
@@ -14,6 +14,8 @@ philosophy. Like dwm, dwl is:
|
|||||||
|
|
||||||
## Getting Started:
|
## Getting Started:
|
||||||
|
|
||||||
|
### **dwl branch 0.7 and releases based upon 0.7 build against [wlroots] 0.18**
|
||||||
|
|
||||||
### Latest semi-stable [release]
|
### Latest semi-stable [release]
|
||||||
This is probably where you want to start. This builds against the dependent
|
This is probably where you want to start. This builds against the dependent
|
||||||
packages' versions currently shipping in major distributions. If your
|
packages' versions currently shipping in major distributions. If your
|
||||||
@@ -102,7 +104,7 @@ automatically, you will need to configure it prior to launching `dwl`, e.g.:
|
|||||||
|
|
||||||
Information about selected layouts, current window title, app-id, 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 `STATUS INFORMATION` section in `_dwl_(1)`). 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
|
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
|
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,
|
do want to run a startup command that does not consume the status information,
|
||||||
|
|||||||
@@ -126,14 +126,15 @@ client_get_appid(Client *c)
|
|||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return c->surface.xwayland->class ? c->surface.xwayland->class : "broken";
|
return c->surface.xwayland->class;
|
||||||
#endif
|
#endif
|
||||||
return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken";
|
return c->surface.xdg->toplevel->app_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
client_get_clip(Client *c, struct wlr_box *clip)
|
client_get_clip(Client *c, struct wlr_box *clip)
|
||||||
{
|
{
|
||||||
|
struct wlr_box xdg_geom = {0};
|
||||||
*clip = (struct wlr_box){
|
*clip = (struct wlr_box){
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
@@ -146,8 +147,9 @@ client_get_clip(Client *c, struct wlr_box *clip)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clip->x = c->surface.xdg->geometry.x;
|
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
|
||||||
clip->y = c->surface.xdg->geometry.y;
|
clip->x = xdg_geom.x;
|
||||||
|
clip->y = xdg_geom.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -162,7 +164,7 @@ client_get_geometry(Client *c, struct wlr_box *geom)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*geom = c->surface.xdg->geometry;
|
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline Client *
|
static inline Client *
|
||||||
@@ -198,9 +200,9 @@ client_get_title(Client *c)
|
|||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return c->surface.xwayland->title ? c->surface.xwayland->title : "broken";
|
return c->surface.xwayland->title;
|
||||||
#endif
|
#endif
|
||||||
return c->surface.xdg->toplevel->title ? c->surface.xdg->toplevel->title : "broken";
|
return c->surface.xdg->toplevel->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@@ -299,6 +301,17 @@ client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
|
|||||||
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
|
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
|
static inline void
|
||||||
client_send_close(Client *c)
|
client_send_close(Client *c)
|
||||||
{
|
{
|
||||||
@@ -331,13 +344,6 @@ client_set_fullscreen(Client *c, int fullscreen)
|
|||||||
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
|
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
client_set_scale(struct wlr_surface *s, float scale)
|
|
||||||
{
|
|
||||||
wlr_fractional_scale_v1_notify_scale(s, scale);
|
|
||||||
wlr_surface_set_preferred_buffer_scale(s, (int32_t)ceilf(scale));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
client_set_size(Client *c, uint32_t width, uint32_t height)
|
client_set_size(Client *c, uint32_t width, uint32_t height)
|
||||||
{
|
{
|
||||||
@@ -358,11 +364,8 @@ static inline void
|
|||||||
client_set_tiled(Client *c, uint32_t edges)
|
client_set_tiled(Client *c, uint32_t edges)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c))
|
||||||
wlr_xwayland_surface_set_maximized(c->surface.xwayland,
|
|
||||||
edges != WLR_EDGE_NONE, edges != WLR_EDGE_NONE);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
|
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
|
||||||
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
||||||
@@ -388,8 +391,8 @@ client_wants_focus(Client *c)
|
|||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
return client_is_unmanaged(c)
|
return client_is_unmanaged(c)
|
||||||
&& wlr_xwayland_surface_override_redirect_wants_focus(c->surface.xwayland)
|
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
|
||||||
&& wlr_xwayland_surface_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
|
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
_VERSION = 0.8-dev
|
_VERSION = 0.7
|
||||||
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
|
||||||
@@ -8,29 +8,10 @@ PREFIX = /usr/local
|
|||||||
MANDIR = $(PREFIX)/share/man
|
MANDIR = $(PREFIX)/share/man
|
||||||
DATADIR = $(PREFIX)/share
|
DATADIR = $(PREFIX)/share
|
||||||
|
|
||||||
WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19`
|
|
||||||
WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19`
|
|
||||||
|
|
||||||
# Allow using an alternative wlroots installations
|
|
||||||
# This has to have all the includes required by wlroots, e.g:
|
|
||||||
# Assuming wlroots git repo is "${PWD}/wlroots" and you only ran "meson setup build && ninja -C build"
|
|
||||||
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
|
||||||
# -I$(PWD)/wlroots/include
|
|
||||||
# Set -rpath to avoid using the wrong library.
|
|
||||||
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build -L$(PWD)/wlroots/build -lwlroots-0.19
|
|
||||||
|
|
||||||
# Assuming you ran "meson setup --prefix ${PWD}/0.19 build && ninja -C build install"
|
|
||||||
#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \
|
|
||||||
# -I$(PWD)/wlroots/0.19/include/wlroots-0.19
|
|
||||||
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/0.19/lib64 -L$(PWD)/wlroots/0.19/lib64 -lwlroots-0.19
|
|
||||||
|
|
||||||
XWAYLAND =
|
XWAYLAND =
|
||||||
XLIBS =
|
XLIBS =
|
||||||
# Uncomment to build XWayland support
|
# Uncomment to build XWayland support
|
||||||
#XWAYLAND = -DXWAYLAND
|
#XWAYLAND = -DXWAYLAND
|
||||||
#XLIBS = xcb xcb-icccm
|
#XLIBS = xcb xcb-icccm
|
||||||
|
|
||||||
# dwl itself only uses C99 features, but wlroots' headers use anonymous unions (C11).
|
CC = gcc
|
||||||
# To avoid warnings about them, we do not use -std=c99 and instead of using the
|
|
||||||
# gmake default 'CC=c99', we use cc.
|
|
||||||
CC = cc
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ starts a shell process running
|
|||||||
when starting.
|
when starting.
|
||||||
When stopping, it sends
|
When stopping, it sends
|
||||||
.Dv SIGTERM
|
.Dv SIGTERM
|
||||||
to the child process group and waits for it to exit.
|
to the child process and waits for it to exit.
|
||||||
.Pp
|
.Pp
|
||||||
Users are encouraged to customize
|
Users are encouraged to customize
|
||||||
.Nm
|
.Nm
|
||||||
@@ -55,10 +55,10 @@ Move window to a single tag.
|
|||||||
Toggle tag for window.
|
Toggle tag for window.
|
||||||
.It Mod-p
|
.It Mod-p
|
||||||
Spawn
|
Spawn
|
||||||
.Xr wmenu-run 1 .
|
.Nm wmenu-run .
|
||||||
.It Mod-Shift-Return
|
.It Mod-Shift-Return
|
||||||
Spawn
|
Spawn
|
||||||
.Xr foot 1 .
|
.Nm foot .
|
||||||
.It Mod-[jk]
|
.It Mod-[jk]
|
||||||
Move focus down/up the stack.
|
Move focus down/up the stack.
|
||||||
.It Mod-[id]
|
.It Mod-[id]
|
||||||
@@ -100,112 +100,6 @@ Quit
|
|||||||
.Nm .
|
.Nm .
|
||||||
.El
|
.El
|
||||||
These might differ depending on your keyboard layout.
|
These might differ depending on your keyboard layout.
|
||||||
.Ss Mouse commands
|
|
||||||
.Bl -tag -width 20n -offset indent -compact
|
|
||||||
.It Mod-Button1
|
|
||||||
Move focused window while dragging.
|
|
||||||
Tiled windows will be toggled to the floating state.
|
|
||||||
.It Mod-Button2
|
|
||||||
Toggle focused window between floating and tiled state.
|
|
||||||
.It Mod-Button3
|
|
||||||
.El
|
|
||||||
.Sh STATUS INFORMATION
|
|
||||||
.Nm
|
|
||||||
writes its status information to standard output.
|
|
||||||
If the
|
|
||||||
.Fl s
|
|
||||||
option is given, the status information is written to the standard input of the
|
|
||||||
child process instead.
|
|
||||||
.Pp
|
|
||||||
Said information has the following format:
|
|
||||||
.Bd -ragged -offset indent
|
|
||||||
.Ar <monitor>
|
|
||||||
.Ar <component>
|
|
||||||
.Ar <data>
|
|
||||||
.Ed
|
|
||||||
.Pp
|
|
||||||
.Bl -tag -width 11n -offset 0 -compact
|
|
||||||
.It Ar <monitor>
|
|
||||||
is the name given to the output.
|
|
||||||
.It Ar <component>
|
|
||||||
is one of (in order)
|
|
||||||
.Em title ,
|
|
||||||
.Em appid ,
|
|
||||||
.Em fullscreen ,
|
|
||||||
.Em floating ,
|
|
||||||
.Em selmon ,
|
|
||||||
.Em tags ,
|
|
||||||
.Em layout .
|
|
||||||
.It Ar <data>
|
|
||||||
changes depending on
|
|
||||||
.Ar <component> .
|
|
||||||
.Bl -tag -width 10n -compact
|
|
||||||
.It Em title
|
|
||||||
The title of the focused window on
|
|
||||||
.Ar <monitor>
|
|
||||||
or nothing if there is no focused window.
|
|
||||||
.It Em appid
|
|
||||||
The app_id of the focused window on
|
|
||||||
.Ar <monitor>
|
|
||||||
or nothing if there is no focused window.
|
|
||||||
.It Em fullscreen
|
|
||||||
Prints 1 if the focused window on
|
|
||||||
.Ar <monitor>
|
|
||||||
is in fullscreen state, otherwise prints 0. If there is no focused
|
|
||||||
window it prints nothing.
|
|
||||||
.It Em floating
|
|
||||||
Prints 1 if the focused window on
|
|
||||||
.Ar <monitor>
|
|
||||||
is in floating state, otherwise prints 0. If there is no focused
|
|
||||||
window it prints nothing.
|
|
||||||
.It Em selmon
|
|
||||||
Prints 1 if
|
|
||||||
.Ar <monitor>
|
|
||||||
is the selected monitor, otherwise prints 0.
|
|
||||||
.It Em tags
|
|
||||||
Prints four bitmasks in the following order:
|
|
||||||
.Bl -bullet -width 2n -compact
|
|
||||||
.It
|
|
||||||
Occupied tags of
|
|
||||||
.Ar <monitor> .
|
|
||||||
.It
|
|
||||||
Selected tags of
|
|
||||||
.Ar <monitor> .
|
|
||||||
.It
|
|
||||||
Tags of the focused window on
|
|
||||||
.Ar <monitor> .
|
|
||||||
.It
|
|
||||||
Tags where a window on
|
|
||||||
.Ar <monitor>
|
|
||||||
requested activation or has urgency hints.
|
|
||||||
.El
|
|
||||||
The bitmasks are 32-bit unsigned decimal integers.
|
|
||||||
.It Em layout
|
|
||||||
Prints the symbol of the current layout.
|
|
||||||
.El
|
|
||||||
.El
|
|
||||||
.Ss Examples
|
|
||||||
When there is a selected window:
|
|
||||||
.Bd -literal -offset indent
|
|
||||||
HDMI\-A\-1 title \(ti/source/repos/dwl > man \-l dwl.1
|
|
||||||
HDMI\-A\-1 appid footclient
|
|
||||||
HDMI\-A\-1 fullscreen 0
|
|
||||||
HDMI\-A\-1 floating 0
|
|
||||||
HDMI\-A\-1 selmon 1
|
|
||||||
HDMI\-A\-1 tags 271 4 4 0
|
|
||||||
HDMI\-A\-1 layout [T]
|
|
||||||
.Ed
|
|
||||||
.Pp
|
|
||||||
When there is no selected window:
|
|
||||||
.Bd -literal -offset indent
|
|
||||||
HDMI\-A\-1 title
|
|
||||||
HDMI\-A\-1 appid
|
|
||||||
HDMI\-A\-1 fullscreen
|
|
||||||
HDMI\-A\-1 floating
|
|
||||||
HDMI\-A\-1 selmon 1
|
|
||||||
HDMI\-A\-1 tags 271 512 0 0
|
|
||||||
HDMI\-A\-1 layout [T]
|
|
||||||
.Ed
|
|
||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
These environment variables are used by
|
These environment variables are used by
|
||||||
.Nm :
|
.Nm :
|
||||||
@@ -248,9 +142,17 @@ Start
|
|||||||
with s6 in the background:
|
with s6 in the background:
|
||||||
.Dl dwl \-s \(aqs6\-svscan <&\-\(aq
|
.Dl dwl \-s \(aqs6\-svscan <&\-\(aq
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr dwm 1 ,
|
|
||||||
.Xr foot 1 ,
|
.Xr foot 1 ,
|
||||||
.Xr wmenu 1 ,
|
.Xr wmenu 1 ,
|
||||||
|
.Xr dwm 1 ,
|
||||||
.Xr xkeyboard-config 7
|
.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
|
.Sh BUGS
|
||||||
All of them.
|
All of them.
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include <wlr/types/wlr_keyboard_group.h>
|
#include <wlr/types/wlr_keyboard_group.h>
|
||||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||||
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
||||||
#include <wlr/types/wlr_linux_drm_syncobj_v1.h>
|
|
||||||
#include <wlr/types/wlr_output.h>
|
#include <wlr/types/wlr_output.h>
|
||||||
#include <wlr/types/wlr_output_layout.h>
|
#include <wlr/types/wlr_output_layout.h>
|
||||||
#include <wlr/types/wlr_output_management_v1.h>
|
#include <wlr/types/wlr_output_management_v1.h>
|
||||||
@@ -106,18 +105,15 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct Monitor Monitor;
|
typedef struct Monitor Monitor;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Must keep this field first */
|
/* Must keep these three elements in this order */
|
||||||
unsigned int type; /* XDGShell or X11* */
|
unsigned int type; /* XDGShell or X11* */
|
||||||
|
struct wlr_box geom; /* layout-relative, includes border */
|
||||||
Monitor *mon;
|
Monitor *mon;
|
||||||
struct wlr_scene_tree *scene;
|
struct wlr_scene_tree *scene;
|
||||||
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
||||||
struct wlr_scene_tree *scene_surface;
|
struct wlr_scene_tree *scene_surface;
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_list flink;
|
struct wl_list flink;
|
||||||
struct wlr_box geom; /* layout-relative, includes border */
|
|
||||||
struct wlr_box prev; /* layout-relative, includes border */
|
|
||||||
struct wlr_box bounds; /* only width and height are used */
|
|
||||||
union {
|
union {
|
||||||
struct wlr_xdg_surface *xdg;
|
struct wlr_xdg_surface *xdg;
|
||||||
struct wlr_xwayland_surface *xwayland;
|
struct wlr_xwayland_surface *xwayland;
|
||||||
@@ -132,6 +128,8 @@ typedef struct {
|
|||||||
struct wl_listener fullscreen;
|
struct wl_listener fullscreen;
|
||||||
struct wl_listener set_decoration_mode;
|
struct wl_listener set_decoration_mode;
|
||||||
struct wl_listener destroy_decoration;
|
struct wl_listener destroy_decoration;
|
||||||
|
struct wlr_box prev; /* layout-relative, includes border */
|
||||||
|
struct wlr_box bounds;
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
struct wl_listener activate;
|
struct wl_listener activate;
|
||||||
struct wl_listener associate;
|
struct wl_listener associate;
|
||||||
@@ -153,6 +151,7 @@ typedef struct {
|
|||||||
} Key;
|
} Key;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
struct wl_list link;
|
||||||
struct wlr_keyboard_group *wlr_group;
|
struct wlr_keyboard_group *wlr_group;
|
||||||
|
|
||||||
int nsyms;
|
int nsyms;
|
||||||
@@ -166,9 +165,9 @@ typedef struct {
|
|||||||
} KeyboardGroup;
|
} KeyboardGroup;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Must keep this field first */
|
/* Must keep these three elements in this order */
|
||||||
unsigned int type; /* LayerShell */
|
unsigned int type; /* LayerShell */
|
||||||
|
struct wlr_box geom;
|
||||||
Monitor *mon;
|
Monitor *mon;
|
||||||
struct wlr_scene_tree *scene;
|
struct wlr_scene_tree *scene;
|
||||||
struct wlr_scene_tree *popups;
|
struct wlr_scene_tree *popups;
|
||||||
@@ -327,6 +326,7 @@ static void setcursor(struct wl_listener *listener, void *data);
|
|||||||
static void setcursorshape(struct wl_listener *listener, void *data);
|
static void setcursorshape(struct wl_listener *listener, void *data);
|
||||||
static void setfloating(Client *c, int floating);
|
static void setfloating(Client *c, int floating);
|
||||||
static void setfullscreen(Client *c, int fullscreen);
|
static void setfullscreen(Client *c, int fullscreen);
|
||||||
|
static void setgamma(struct wl_listener *listener, void *data);
|
||||||
static void setlayout(const Arg *arg);
|
static void setlayout(const Arg *arg);
|
||||||
static void setmfact(const Arg *arg);
|
static void setmfact(const Arg *arg);
|
||||||
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
||||||
@@ -357,6 +357,7 @@ static void xytonode(double x, double y, struct wlr_surface **psurface,
|
|||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
|
static const char broken[] = "broken";
|
||||||
static pid_t child_pid = -1;
|
static pid_t child_pid = -1;
|
||||||
static int locked;
|
static int locked;
|
||||||
static void *exclusive_focus;
|
static void *exclusive_focus;
|
||||||
@@ -382,6 +383,7 @@ static struct wlr_idle_notifier_v1 *idle_notifier;
|
|||||||
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
|
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
|
||||||
static struct wlr_layer_shell_v1 *layer_shell;
|
static struct wlr_layer_shell_v1 *layer_shell;
|
||||||
static struct wlr_output_manager_v1 *output_mgr;
|
static struct wlr_output_manager_v1 *output_mgr;
|
||||||
|
static struct wlr_gamma_control_manager_v1 *gamma_control_mgr;
|
||||||
static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
|
static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
|
||||||
static struct wlr_virtual_pointer_manager_v1 *virtual_pointer_mgr;
|
static struct wlr_virtual_pointer_manager_v1 *virtual_pointer_mgr;
|
||||||
static struct wlr_cursor_shape_manager_v1 *cursor_shape_mgr;
|
static struct wlr_cursor_shape_manager_v1 *cursor_shape_mgr;
|
||||||
@@ -459,8 +461,10 @@ applyrules(Client *c)
|
|||||||
Monitor *mon = selmon, *m;
|
Monitor *mon = selmon, *m;
|
||||||
|
|
||||||
c->isfloating = client_is_float_type(c);
|
c->isfloating = client_is_float_type(c);
|
||||||
appid = client_get_appid(c);
|
if (!(appid = client_get_appid(c)))
|
||||||
title = client_get_title(c);
|
appid = broken;
|
||||||
|
if (!(title = client_get_title(c)))
|
||||||
|
title = broken;
|
||||||
|
|
||||||
for (r = rules; r < END(rules); r++) {
|
for (r = rules; r < END(rules); r++) {
|
||||||
if ((!r->title || strstr(title, r->title))
|
if ((!r->title || strstr(title, r->title))
|
||||||
@@ -531,6 +535,8 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
|
|||||||
|
|
||||||
wlr_scene_layer_surface_v1_configure(l->scene_layer, &full_area, usable_area);
|
wlr_scene_layer_surface_v1_configure(l->scene_layer, &full_area, usable_area);
|
||||||
wlr_scene_node_set_position(&l->popups->node, l->scene->node.x, l->scene->node.y);
|
wlr_scene_node_set_position(&l->popups->node, l->scene->node.x, l->scene->node.y);
|
||||||
|
l->geom.x = l->scene->node.x;
|
||||||
|
l->geom.y = l->scene->node.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,17 +630,17 @@ buttonpress(struct wl_listener *listener, void *data)
|
|||||||
break;
|
break;
|
||||||
case WL_POINTER_BUTTON_STATE_RELEASED:
|
case WL_POINTER_BUTTON_STATE_RELEASED:
|
||||||
/* If you released any buttons, we exit interactive move/resize mode. */
|
/* If you released any buttons, we exit interactive move/resize mode. */
|
||||||
/* TODO: should reset to the pointer focus's current setcursor */
|
/* TODO should reset to the pointer focus's current setcursor */
|
||||||
if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {
|
if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {
|
||||||
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
||||||
cursor_mode = CurNormal;
|
cursor_mode = CurNormal;
|
||||||
/* Drop the window off on its new monitor */
|
/* Drop the window off on its new monitor */
|
||||||
selmon = xytomon(cursor->x, cursor->y);
|
selmon = xytomon(cursor->x, cursor->y);
|
||||||
setmon(grabc, selmon, 0);
|
setmon(grabc, selmon, 0);
|
||||||
grabc = NULL;
|
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
cursor_mode = CurNormal;
|
||||||
}
|
}
|
||||||
cursor_mode = CurNormal;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* If the event wasn't handled by the compositor, notify the client with
|
/* If the event wasn't handled by the compositor, notify the client with
|
||||||
@@ -710,6 +716,8 @@ cleanupmon(struct wl_listener *listener, void *data)
|
|||||||
wl_list_remove(&m->frame.link);
|
wl_list_remove(&m->frame.link);
|
||||||
wl_list_remove(&m->link);
|
wl_list_remove(&m->link);
|
||||||
wl_list_remove(&m->request_state.link);
|
wl_list_remove(&m->request_state.link);
|
||||||
|
if (m->lock_surface)
|
||||||
|
destroylocksurface(&m->destroy_lock_surface, NULL);
|
||||||
m->wlr_output->data = NULL;
|
m->wlr_output->data = NULL;
|
||||||
wlr_output_layout_remove(output_layout, m->wlr_output);
|
wlr_output_layout_remove(output_layout, m->wlr_output);
|
||||||
wlr_scene_output_destroy(m->scene_output);
|
wlr_scene_output_destroy(m->scene_output);
|
||||||
@@ -757,7 +765,8 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
|
|||||||
struct wlr_layer_surface_v1_state old_state;
|
struct wlr_layer_surface_v1_state old_state;
|
||||||
|
|
||||||
if (l->layer_surface->initial_commit) {
|
if (l->layer_surface->initial_commit) {
|
||||||
client_set_scale(layer_surface->surface, l->mon->wlr_output->scale);
|
wlr_fractional_scale_v1_notify_scale(layer_surface->surface, l->mon->wlr_output->scale);
|
||||||
|
wlr_surface_set_preferred_buffer_scale(layer_surface->surface, (int32_t)ceilf(l->mon->wlr_output->scale));
|
||||||
|
|
||||||
/* Temporarily set the layer's current state to pending
|
/* Temporarily set the layer's current state to pending
|
||||||
* so that we can easily arrange it */
|
* so that we can easily arrange it */
|
||||||
@@ -797,19 +806,20 @@ commitnotify(struct wl_listener *listener, void *data)
|
|||||||
*/
|
*/
|
||||||
applyrules(c);
|
applyrules(c);
|
||||||
if (c->mon) {
|
if (c->mon) {
|
||||||
client_set_scale(client_surface(c), c->mon->wlr_output->scale);
|
wlr_surface_set_preferred_buffer_scale(client_surface(c), (int)ceilf(c->mon->wlr_output->scale));
|
||||||
|
wlr_fractional_scale_v1_notify_scale(client_surface(c), c->mon->wlr_output->scale);
|
||||||
}
|
}
|
||||||
setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */
|
setmon(c, NULL, 0); /* Make sure to reapply rules in mapnotify() */
|
||||||
|
|
||||||
wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel,
|
wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel, WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
||||||
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, 0, 0);
|
||||||
if (c->decoration)
|
if (c->decoration)
|
||||||
requestdecorationmode(&c->set_decoration_mode, c->decoration);
|
requestdecorationmode(&c->set_decoration_mode, c->decoration);
|
||||||
wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, 0, 0);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
if (client_surface(c)->mapped && c->mon)
|
||||||
|
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
||||||
|
|
||||||
/* mark a pending resize as completed */
|
/* mark a pending resize as completed */
|
||||||
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
|
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
|
||||||
@@ -834,13 +844,11 @@ commitpopup(struct wl_listener *listener, void *data)
|
|||||||
return;
|
return;
|
||||||
popup->base->surface->data = wlr_scene_xdg_surface_create(
|
popup->base->surface->data = wlr_scene_xdg_surface_create(
|
||||||
popup->parent->data, popup->base);
|
popup->parent->data, popup->base);
|
||||||
if ((l && !l->mon) || (c && !c->mon)) {
|
if ((l && !l->mon) || (c && !c->mon))
|
||||||
wlr_xdg_popup_destroy(popup);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
box = type == LayerShell ? l->mon->m : c->mon->w;
|
box = type == LayerShell ? l->mon->m : c->mon->w;
|
||||||
box.x -= (type == LayerShell ? l->scene->node.x : c->geom.x);
|
box.x -= (type == LayerShell ? l->geom.x : c->geom.x);
|
||||||
box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);
|
box.y -= (type == LayerShell ? l->geom.y : c->geom.y);
|
||||||
wlr_xdg_popup_unconstrain_from_box(popup, &box);
|
wlr_xdg_popup_unconstrain_from_box(popup, &box);
|
||||||
wl_list_remove(&listener->link);
|
wl_list_remove(&listener->link);
|
||||||
}
|
}
|
||||||
@@ -1094,10 +1102,10 @@ createpointer(struct wlr_pointer *pointer)
|
|||||||
libinput_device_config_middle_emulation_set_enabled(device, middle_button_emulation);
|
libinput_device_config_middle_emulation_set_enabled(device, middle_button_emulation);
|
||||||
|
|
||||||
if (libinput_device_config_scroll_get_methods(device) != LIBINPUT_CONFIG_SCROLL_NO_SCROLL)
|
if (libinput_device_config_scroll_get_methods(device) != LIBINPUT_CONFIG_SCROLL_NO_SCROLL)
|
||||||
libinput_device_config_scroll_set_method(device, scroll_method);
|
libinput_device_config_scroll_set_method (device, scroll_method);
|
||||||
|
|
||||||
if (libinput_device_config_click_get_methods(device) != LIBINPUT_CONFIG_CLICK_METHOD_NONE)
|
if (libinput_device_config_click_get_methods(device) != LIBINPUT_CONFIG_CLICK_METHOD_NONE)
|
||||||
libinput_device_config_click_set_method(device, click_method);
|
libinput_device_config_click_set_method (device, click_method);
|
||||||
|
|
||||||
if (libinput_device_config_send_events_get_modes(device))
|
if (libinput_device_config_send_events_get_modes(device))
|
||||||
libinput_device_config_send_events_set_mode(device, send_events_mode);
|
libinput_device_config_send_events_set_mode(device, send_events_mode);
|
||||||
@@ -1271,7 +1279,6 @@ destroynotify(struct wl_listener *listener, void *data)
|
|||||||
wl_list_remove(&c->commit.link);
|
wl_list_remove(&c->commit.link);
|
||||||
wl_list_remove(&c->map.link);
|
wl_list_remove(&c->map.link);
|
||||||
wl_list_remove(&c->unmap.link);
|
wl_list_remove(&c->unmap.link);
|
||||||
wl_list_remove(&c->maximize.link);
|
|
||||||
}
|
}
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
@@ -1362,6 +1369,7 @@ focusclient(Client *c, int lift)
|
|||||||
wl_list_insert(&fstack, &c->flink);
|
wl_list_insert(&fstack, &c->flink);
|
||||||
selmon = c->mon;
|
selmon = c->mon;
|
||||||
c->isurgent = 0;
|
c->isurgent = 0;
|
||||||
|
client_restack_surface(c);
|
||||||
|
|
||||||
/* Don't change border color if there is an exclusive focus or we are
|
/* Don't change border color if there is an exclusive focus or we are
|
||||||
* handling a drag operation */
|
* handling a drag operation */
|
||||||
@@ -1688,8 +1696,7 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
|
|
||||||
/* Create scene tree for this client and its border */
|
/* Create scene tree for this client and its border */
|
||||||
c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
|
c->scene = client_surface(c)->data = wlr_scene_tree_create(layers[LyrTile]);
|
||||||
/* Enabled later by a call to arrange() */
|
wlr_scene_node_set_enabled(&c->scene->node, c->type != XDGShell);
|
||||||
wlr_scene_node_set_enabled(&c->scene->node, client_is_unmanaged(c));
|
|
||||||
c->scene_surface = c->type == XDGShell
|
c->scene_surface = c->type == XDGShell
|
||||||
? wlr_scene_xdg_surface_create(c->scene, c->surface.xdg)
|
? wlr_scene_xdg_surface_create(c->scene, c->surface.xdg)
|
||||||
: wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
: wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
||||||
@@ -1702,7 +1709,6 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
/* Unmanaged clients always are floating */
|
/* Unmanaged clients always are floating */
|
||||||
wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]);
|
wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]);
|
||||||
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
||||||
client_set_size(c, c->geom.width, c->geom.height);
|
|
||||||
if (client_wants_focus(c)) {
|
if (client_wants_focus(c)) {
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
exclusive_focus = c;
|
exclusive_focus = c;
|
||||||
@@ -1820,8 +1826,8 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
|
|||||||
&& toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w, &l) >= 0) {
|
&& toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w, &l) >= 0) {
|
||||||
c = w;
|
c = w;
|
||||||
surface = seat->pointer_state.focused_surface;
|
surface = seat->pointer_state.focused_surface;
|
||||||
sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
|
sx = cursor->x - (l ? l->geom.x : w->geom.x);
|
||||||
sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
|
sy = cursor->y - (l ? l->geom.y : w->geom.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* time is 0 in internal calls meant to restore pointer focus. */
|
/* time is 0 in internal calls meant to restore pointer focus. */
|
||||||
@@ -2035,6 +2041,7 @@ printstatus(void)
|
|||||||
Monitor *m = NULL;
|
Monitor *m = NULL;
|
||||||
Client *c;
|
Client *c;
|
||||||
uint32_t occ, urg, sel;
|
uint32_t occ, urg, sel;
|
||||||
|
const char *appid, *title;
|
||||||
|
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
occ = urg = 0;
|
occ = urg = 0;
|
||||||
@@ -2046,8 +2053,10 @@ printstatus(void)
|
|||||||
urg |= c->tags;
|
urg |= c->tags;
|
||||||
}
|
}
|
||||||
if ((c = focustop(m))) {
|
if ((c = focustop(m))) {
|
||||||
printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
|
title = client_get_title(c);
|
||||||
printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
|
appid = client_get_appid(c);
|
||||||
|
printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
|
||||||
|
printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
|
||||||
printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
||||||
printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
|
printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
|
||||||
sel = c->tags;
|
sel = c->tags;
|
||||||
@@ -2082,7 +2091,6 @@ powermgrsetmode(struct wl_listener *listener, void *data)
|
|||||||
wlr_output_commit_state(m->wlr_output, &state);
|
wlr_output_commit_state(m->wlr_output, &state);
|
||||||
|
|
||||||
m->asleep = !event->mode;
|
m->asleep = !event->mode;
|
||||||
updatemons(NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2099,6 +2107,7 @@ rendermon(struct wl_listener *listener, void *data)
|
|||||||
Monitor *m = wl_container_of(listener, m, frame);
|
Monitor *m = wl_container_of(listener, m, frame);
|
||||||
Client *c;
|
Client *c;
|
||||||
struct wlr_output_state pending = {0};
|
struct wlr_output_state pending = {0};
|
||||||
|
struct wlr_gamma_control_v1 *gamma_control;
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
/* Render if no XDG clients have an outstanding resize and are visible on
|
/* Render if no XDG clients have an outstanding resize and are visible on
|
||||||
@@ -2108,7 +2117,32 @@ rendermon(struct wl_listener *listener, void *data)
|
|||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_scene_output_commit(m->scene_output, NULL);
|
/*
|
||||||
|
* HACK: The "correct" way to set the gamma is to commit it together with
|
||||||
|
* the rest of the state in one go, but to do that we would need to rewrite
|
||||||
|
* wlr_scene_output_commit() in order to add the gamma to the pending
|
||||||
|
* state before committing, instead try to commit the gamma in one frame,
|
||||||
|
* and commit the rest of the state in the next one (or in the same frame if
|
||||||
|
* the gamma can not be committed).
|
||||||
|
*/
|
||||||
|
if (m->gamma_lut_changed) {
|
||||||
|
gamma_control
|
||||||
|
= wlr_gamma_control_manager_v1_get_control(gamma_control_mgr, m->wlr_output);
|
||||||
|
m->gamma_lut_changed = 0;
|
||||||
|
|
||||||
|
if (!wlr_gamma_control_v1_apply(gamma_control, &pending))
|
||||||
|
goto commit;
|
||||||
|
|
||||||
|
if (!wlr_output_test_state(m->wlr_output, &pending)) {
|
||||||
|
wlr_gamma_control_v1_send_failed_and_destroy(gamma_control);
|
||||||
|
goto commit;
|
||||||
|
}
|
||||||
|
wlr_output_commit_state(m->wlr_output, &pending);
|
||||||
|
wlr_output_schedule_frame(m->wlr_output);
|
||||||
|
} else {
|
||||||
|
commit:
|
||||||
|
wlr_scene_output_commit(m->scene_output, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
skip:
|
skip:
|
||||||
/* Let clients know a frame has been rendered */
|
/* Let clients know a frame has been rendered */
|
||||||
@@ -2310,6 +2344,17 @@ setfullscreen(Client *c, int fullscreen)
|
|||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setgamma(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
struct wlr_gamma_control_manager_v1_set_gamma_event *event = data;
|
||||||
|
Monitor *m = event->output->data;
|
||||||
|
if (!m)
|
||||||
|
return;
|
||||||
|
m->gamma_lut_changed = 1;
|
||||||
|
wlr_output_schedule_frame(m->wlr_output);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setlayout(const Arg *arg)
|
setlayout(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -2387,7 +2432,7 @@ setsel(struct wl_listener *listener, void *data)
|
|||||||
void
|
void
|
||||||
setup(void)
|
setup(void)
|
||||||
{
|
{
|
||||||
int drm_fd, i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
||||||
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
|
|
||||||
@@ -2437,10 +2482,6 @@ setup(void)
|
|||||||
wlr_linux_dmabuf_v1_create_with_renderer(dpy, 5, drw));
|
wlr_linux_dmabuf_v1_create_with_renderer(dpy, 5, drw));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((drm_fd = wlr_renderer_get_drm_fd(drw)) >= 0 && drw->features.timeline
|
|
||||||
&& backend->features.timeline)
|
|
||||||
wlr_linux_drm_syncobj_manager_v1_create(dpy, 1, drm_fd);
|
|
||||||
|
|
||||||
/* Autocreates an allocator for us.
|
/* Autocreates an allocator for us.
|
||||||
* The allocator is the bridge between the renderer and the backend. It
|
* The allocator is the bridge between the renderer and the backend. It
|
||||||
* handles the buffer creation, allowing wlroots to render onto the
|
* handles the buffer creation, allowing wlroots to render onto the
|
||||||
@@ -2464,14 +2505,15 @@ setup(void)
|
|||||||
wlr_viewporter_create(dpy);
|
wlr_viewporter_create(dpy);
|
||||||
wlr_single_pixel_buffer_manager_v1_create(dpy);
|
wlr_single_pixel_buffer_manager_v1_create(dpy);
|
||||||
wlr_fractional_scale_manager_v1_create(dpy, 1);
|
wlr_fractional_scale_manager_v1_create(dpy, 1);
|
||||||
wlr_presentation_create(dpy, backend, 2);
|
wlr_presentation_create(dpy, backend);
|
||||||
wlr_alpha_modifier_v1_create(dpy);
|
wlr_alpha_modifier_v1_create(dpy);
|
||||||
|
|
||||||
/* Initializes the interface used to implement urgency hints */
|
/* Initializes the interface used to implement urgency hints */
|
||||||
activation = wlr_xdg_activation_v1_create(dpy);
|
activation = wlr_xdg_activation_v1_create(dpy);
|
||||||
LISTEN_STATIC(&activation->events.request_activate, urgent);
|
LISTEN_STATIC(&activation->events.request_activate, urgent);
|
||||||
|
|
||||||
wlr_scene_set_gamma_control_manager_v1(scene, wlr_gamma_control_manager_v1_create(dpy));
|
gamma_control_mgr = wlr_gamma_control_manager_v1_create(dpy);
|
||||||
|
LISTEN_STATIC(&gamma_control_mgr->events.set_gamma, setgamma);
|
||||||
|
|
||||||
power_mgr = wlr_output_power_manager_v1_create(dpy);
|
power_mgr = wlr_output_power_manager_v1_create(dpy);
|
||||||
LISTEN_STATIC(&power_mgr->events.set_mode, powermgrsetmode);
|
LISTEN_STATIC(&power_mgr->events.set_mode, powermgrsetmode);
|
||||||
@@ -3040,24 +3082,17 @@ configurex11(struct wl_listener *listener, void *data)
|
|||||||
{
|
{
|
||||||
Client *c = wl_container_of(listener, c, configure);
|
Client *c = wl_container_of(listener, c, configure);
|
||||||
struct wlr_xwayland_surface_configure_event *event = data;
|
struct wlr_xwayland_surface_configure_event *event = data;
|
||||||
if (!client_surface(c) || !client_surface(c)->mapped) {
|
/* TODO: figure out if there is another way to do this */
|
||||||
|
if (!c->mon) {
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||||
event->x, event->y, event->width, event->height);
|
event->x, event->y, event->width, event->height);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (client_is_unmanaged(c)) {
|
if (c->isfloating || client_is_unmanaged(c))
|
||||||
wlr_scene_node_set_position(&c->scene->node, event->x, event->y);
|
resize(c, (struct wlr_box){.x = event->x, .y = event->y,
|
||||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
.width = event->width + c->bw * 2, .height = event->height + c->bw * 2}, 0);
|
||||||
event->x, event->y, event->width, event->height);
|
else
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((c->isfloating && c != grabc) || !c->mon->lt[c->mon->sellt]->arrange) {
|
|
||||||
resize(c, (struct wlr_box){.x = event->x - c->bw,
|
|
||||||
.y = event->y - c->bw, .width = event->width + c->bw * 2,
|
|
||||||
.height = event->height + c->bw * 2}, 0);
|
|
||||||
} else {
|
|
||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -3109,7 +3144,7 @@ sethints(struct wl_listener *listener, void *data)
|
|||||||
{
|
{
|
||||||
Client *c = wl_container_of(listener, c, set_hints);
|
Client *c = wl_container_of(listener, c, set_hints);
|
||||||
struct wlr_surface *surface = client_surface(c);
|
struct wlr_surface *surface = client_surface(c);
|
||||||
if (c == focustop(selmon))
|
if (c == focustop(selmon) || !c->surface.xwayland->hints)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
|
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
|
||||||
|
|||||||
@@ -38,14 +38,14 @@ ecalloc(size_t nmemb, size_t size)
|
|||||||
int
|
int
|
||||||
fd_set_nonblock(int fd) {
|
fd_set_nonblock(int fd) {
|
||||||
int flags = fcntl(fd, F_GETFL);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
if (flags < 0) {
|
if (flags < 0) {
|
||||||
perror("fcntl(F_GETFL):");
|
perror("fcntl(F_GETFL):");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
||||||
perror("fcntl(F_SETFL):");
|
perror("fcntl(F_SETFL):");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user