Compare commits

..

9 commits

Author SHA1 Message Date
Johan Malm
4dab6994dc NEWS.md: add notes for 0.20.1 2026-06-15 19:32:59 +01:00
Nikolas Nyby
07e1053a8d readme: Use meson setup in example to fix meson warning
Using meson without an explicit command emits a warning.
2026-06-13 07:20:13 +01:00
Johan Malm
2135fb0d35 [fixup] minor typos 2026-06-12 21:26:14 +01:00
Johan Malm
bbfa6bbddb CONTRIBUTING.md: add section on LLM/AI Tools 2026-06-12 21:26:14 +01:00
Johan Malm
a814dd1e38 NEWS.md: add notes for 0.9.8 2026-06-11 22:23:14 +02:00
Consolatis
28d03b0893 src/buffer.c: prevent creating invalid buffers
Testcase: set title of foot to an invisible string (here LTR)

First one works and correctly sets the title, 2nd one crashes
- printf "\x1b]0;\xe2\x80\x8e%s\x07" "some title"
- printf "\x1b]0;\xe2\x80\x8e%s\x07" ""

Reported-by: Domo via IRC
2026-06-11 21:53:28 +02:00
Johan Malm
f4b9bdab65 NEWS.md: add notes on wlroots-0.20 2026-06-08 23:19:27 +02:00
Consolatis
78227f1724 CI: Debian Testing temporary labwc removal due to wlroots transition 2026-06-08 20:28:51 +02:00
Johan Malm
579e532908 xdg-shell: protect against SIGABRT when TTY switching
Ensure we have got sensible toplevel width/height before trying to set
size on configure.

This protects against an edge case experienced when TTY switching between
labwc and Xfce running on XOrg on another TTY. It is not yet clear what
causes this, but hitting wlroots assert() is not great, so let's protect
against it.

Written-by: @Tamaranch

Fixes: #3608
2026-06-04 20:05:06 +01:00
8 changed files with 132 additions and 9 deletions

View file

@ -93,10 +93,15 @@ jobs:
sed -i '/^Types/ s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources sed -i '/^Types/ s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources
apt-get update apt-get update
apt-get upgrade -y apt-get upgrade -y
apt-get install -y git gcc clang gdb xwayland apt-get install -y git gcc clang gdb xwayland meson pkgconf
apt-get build-dep -y labwc apt-get build-dep -y libwlroots-0.20-dev
apt-get build-dep -y libwlroots-0.19-dev # Debian Testing temporarily removed labwc due to wlroots 0.20 transition
apt-get build-dep -y libxkbcommon-dev #apt-get build-dep -y labwc
# Install the deps manually
apt-get install -y libxml2-dev liblzma-dev libglib2.0-dev \
libcairo2-dev libpango1.0-dev libinput-dev libpng-dev \
librsvg2-dev wayland-protocols libxkbcommon-dev libdrm-dev \
scdoc gettext libwlroots-0.20-dev libsfdo-dev
- name: Install FreeBSD dependencies - name: Install FreeBSD dependencies
if: matrix.name == 'FreeBSD' if: matrix.name == 'FreeBSD'

View file

@ -19,7 +19,8 @@
- [6. Unit Tests](#unit-tests) - [6. Unit Tests](#unit-tests)
- [7. Submitting Patches](#submitting-patches) - [7. Submitting Patches](#submitting-patches)
- [8. Native Language Support](#native-language-support) - [8. Native Language Support](#native-language-support)
- [9. Upversion](#upversion) - [9. Tools](#tools)
- [10. Upversion](#upversion)
# How to Contribute # How to Contribute
@ -472,6 +473,29 @@ This generates a new pot file at `po/labwc.pot`
3. Copy the header from the original `labwc.pot` to the new one, keeping 3. Copy the header from the original `labwc.pot` to the new one, keeping
the newly generated dates, check for sanity and commit. the newly generated dates, check for sanity and commit.
# Tools
We permit LLM and AI-assisted tooling, but only on the basis that humans remain
fully accountable. Contributors must use an `Assisted-by:` tag in the commit
logs if AI tools generated or significantly assisted with any part of the code
or documentation. Humans retain full legal and technical responsibility for the
resulting work, including any defects.
We have received Pull Requests where the submitter clearly did not understand
the code, could not reason about it, and would be unable to maintain it. This
is not acceptable.
Any AI-generated code contribution must be compatible with the GPL-2.0-only
license.
While LLMs can be useful for triage, review, clean-up, API refactoring and
similar tasks, we strongly discourage AI slop. Code review effort is usually the
project's primary bottleneck, and submitting unreviewed, AI-generated garbage
wastes reviewer time, slows development, and harms the overall health of the
project. Likewise, AI-generated commit messages and AI-written text in issues
and discussions are strongly discouraged and may be treated as sabotage on this
basis.
# Upversion # Upversion
It is generally only the lead-maintainer who will upversion, but in order It is generally only the lead-maintainer who will upversion, but in order

59
NEWS.md
View file

@ -9,7 +9,9 @@ The format is based on [Keep a Changelog]
| Date | All Changes | wlroots version | lines-of-code | | Date | All Changes | wlroots version | lines-of-code |
|------------|---------------|-----------------|---------------| |------------|---------------|-----------------|---------------|
| 2026-06-15 | [0.20.1] | 0.20.1 | 28337 |
| 2026-05-25 | [0.20.0] | 0.20.1 | 28313 | | 2026-05-25 | [0.20.0] | 0.20.1 | 28313 |
| 2026-06-11 | [0.9.8] | 0.19.3 | 29284 |
| 2026-04-17 | [0.9.7] | 0.19.2 | 29277 | | 2026-04-17 | [0.9.7] | 0.19.2 | 29277 |
| 2026-03-15 | [0.9.6] | 0.19.2 | 29271 | | 2026-03-15 | [0.9.6] | 0.19.2 | 29271 |
| 2026-03-04 | [0.9.5] | 0.19.2 | 29251 | | 2026-03-04 | [0.9.5] | 0.19.2 | 29251 |
@ -45,7 +47,9 @@ The format is based on [Keep a Changelog]
| 2021-03-05 | [0.1.0] | 0.12.0 | 4627 | | 2021-03-05 | [0.1.0] | 0.12.0 | 4627 |
[unreleased]: NEWS.md#unreleased [unreleased]: NEWS.md#unreleased
[0.20.1]: NEWS.md#0201---2026-06-15
[0.20.0]: NEWS.md#0200---2026-05-25 [0.20.0]: NEWS.md#0200---2026-05-25
[0.9.8]: NEWS.md#098---2026-06-11
[0.9.7]: NEWS.md#097---2026-04-17 [0.9.7]: NEWS.md#097---2026-04-17
[0.9.6]: NEWS.md#096---2026-03-15 [0.9.6]: NEWS.md#096---2026-03-15
[0.9.5]: NEWS.md#095---2026-03-04 [0.9.5]: NEWS.md#095---2026-03-04
@ -84,6 +88,35 @@ The format is based on [Keep a Changelog]
[unreleased-commits] [unreleased-commits]
## Notes on wlroots-0.20
There are some regression warnings worth noting for the switch to wlroots 0.20:
- lxqt-panel auto-hiding does not work with a panel size greater than 40 [#3600]
[wlroots-5392]
- Some Wine game windows disappear after alt-tab. It is not yet clear where the
bug is, but the issue manifests itself when running wlroots-0.20 [#3615]
[wlroots-4103]
[wlroots-5392]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5392
[wlroots-4103]: https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/4103
## 0.20.1 - 2026-06-15
[0.20.1-commits]
This is a small bug fix release.
### Fixed
- Handle titles with no visible characters, for example the left-to-right mark
(‎) @Consolatis [#3630]
- Protect against SIGABRT when TTY switching in unusual circumstances by
ensuring that xdg-shell windows have sensible width and height before trying
to set size on configure. This protects against an edge case experienced when
switching between labwc on one TTY and Xfce on XOrg on another TTY.
@johanmalm @Tamaranch [#3617]
## 0.20.0 - 2026-05-25 ## 0.20.0 - 2026-05-25
[0.20.0-commits] [0.20.0-commits]
@ -217,6 +250,16 @@ There are some regression warnings worth noting for the switch to wlroots 0.19:
[wlroots-5098]:https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5098 [wlroots-5098]:https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5098
[gtk-8792]: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8792 [gtk-8792]: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8792
## 0.9.8 - 2026-06-11
[0.9.8-commits]
### Fixed
- Handle titles with no visible characters @Consolatis [#3631]
- Save window position on initial placement to fix Raspberry Pi pygame SDL
XWayland window starting off-screen. @tokyo4j [#3433] [#3625] [#3616]
## 0.9.7 - 2026-04-17 ## 0.9.7 - 2026-04-17
[0.9.7-commits] [0.9.7-commits]
@ -2770,8 +2813,10 @@ Compile with wlroots 0.12.0 and wayland-server >=1.16
ShowMenu ShowMenu
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ [Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
[unreleased-commits]: https://github.com/labwc/labwc/compare/0.20.0...HEAD [unreleased-commits]: https://github.com/labwc/labwc/compare/0.20.1...HEAD
[0.20.1-commits]: https://github.com/labwc/labwc/compare/0.20.0..0.20.1
[0.20.0-commits]: https://github.com/labwc/labwc/compare/0.9.5..0.20.0 [0.20.0-commits]: https://github.com/labwc/labwc/compare/0.9.5..0.20.0
[0.9.8-commits]: https://github.com/labwc/labwc/compare/0.9.7...0.9.8
[0.9.7-commits]: https://github.com/labwc/labwc/compare/0.9.6...0.9.7 [0.9.7-commits]: https://github.com/labwc/labwc/compare/0.9.6...0.9.7
[0.9.6-commits]: https://github.com/labwc/labwc/compare/0.9.5...0.9.6 [0.9.6-commits]: https://github.com/labwc/labwc/compare/0.9.5...0.9.6
[0.9.5-commits]: https://github.com/labwc/labwc/compare/0.9.4...0.9.5 [0.9.5-commits]: https://github.com/labwc/labwc/compare/0.9.4...0.9.5
@ -3223,6 +3268,7 @@ Compile with wlroots 0.12.0 and wayland-server >=1.16
[#2956]: https://github.com/labwc/labwc/pull/2956 [#2956]: https://github.com/labwc/labwc/pull/2956
[#2965]: https://github.com/labwc/labwc/pull/2965 [#2965]: https://github.com/labwc/labwc/pull/2965
[#2967]: https://github.com/labwc/labwc/pull/2967 [#2967]: https://github.com/labwc/labwc/pull/2967
[#2968]: https://github.com/labwc/labwc/pull/2968
[#2970]: https://github.com/labwc/labwc/pull/2970 [#2970]: https://github.com/labwc/labwc/pull/2970
[#2971]: https://github.com/labwc/labwc/pull/2971 [#2971]: https://github.com/labwc/labwc/pull/2971
[#2972]: https://github.com/labwc/labwc/pull/2972 [#2972]: https://github.com/labwc/labwc/pull/2972
@ -3317,6 +3363,7 @@ Compile with wlroots 0.12.0 and wayland-server >=1.16
[#3428]: https://github.com/labwc/labwc/pull/3428 [#3428]: https://github.com/labwc/labwc/pull/3428
[#3429]: https://github.com/labwc/labwc/pull/3429 [#3429]: https://github.com/labwc/labwc/pull/3429
[#3430]: https://github.com/labwc/labwc/pull/3430 [#3430]: https://github.com/labwc/labwc/pull/3430
[#3433]: https://github.com/labwc/labwc/pull/3433
[#3439]: https://github.com/labwc/labwc/pull/3439 [#3439]: https://github.com/labwc/labwc/pull/3439
[#3440]: https://github.com/labwc/labwc/pull/3440 [#3440]: https://github.com/labwc/labwc/pull/3440
[#3441]: https://github.com/labwc/labwc/pull/3441 [#3441]: https://github.com/labwc/labwc/pull/3441
@ -3343,4 +3390,14 @@ Compile with wlroots 0.12.0 and wayland-server >=1.16
[#3543]: https://github.com/labwc/labwc/pull/3543 [#3543]: https://github.com/labwc/labwc/pull/3543
[#3547]: https://github.com/labwc/labwc/pull/3547 [#3547]: https://github.com/labwc/labwc/pull/3547
[#3567]: https://github.com/labwc/labwc/pull/3567 [#3567]: https://github.com/labwc/labwc/pull/3567
[#3576]: https://github.com/labwc/labwc/pull/3576
[#3577]: https://github.com/labwc/labwc/pull/3577
[#3581]: https://github.com/labwc/labwc/pull/3581
[#3595]: https://github.com/labwc/labwc/pull/3595 [#3595]: https://github.com/labwc/labwc/pull/3595
[#3600]: https://github.com/labwc/labwc/pull/3600
[#3615]: https://github.com/labwc/labwc/pull/3615
[#3616]: https://github.com/labwc/labwc/pull/3616
[#3617]: https://github.com/labwc/labwc/pull/3617
[#3625]: https://github.com/labwc/labwc/pull/3625
[#3630]: https://github.com/labwc/labwc/pull/3630
[#3631]: https://github.com/labwc/labwc/pull/3631

View file

@ -153,7 +153,7 @@ Build dependencies include:
- meson, ninja, gcc/clang - meson, ninja, gcc/clang
- wayland-protocols - wayland-protocols
Disable xwayland with `meson -Dxwayland=disabled build/` Disable xwayland with `meson setup -Dxwayland=disabled build/`
For OS/distribution specific details see [wiki]. For OS/distribution specific details see [wiki].

View file

@ -95,6 +95,7 @@ buffer_adopt_cairo_surface(cairo_surface_t *surface)
buffer->surface = surface; buffer->surface = surface;
buffer->data = cairo_image_surface_get_data(buffer->surface); buffer->data = cairo_image_surface_get_data(buffer->surface);
assert(buffer->data);
buffer->format = DRM_FORMAT_ARGB8888; buffer->format = DRM_FORMAT_ARGB8888;
buffer->stride = cairo_image_surface_get_stride(buffer->surface); buffer->stride = cairo_image_surface_get_stride(buffer->surface);
buffer->logical_width = width; buffer->logical_width = width;
@ -107,6 +108,12 @@ buffer_adopt_cairo_surface(cairo_surface_t *surface)
struct lab_data_buffer * struct lab_data_buffer *
buffer_create_cairo(uint32_t logical_width, uint32_t logical_height, float scale) buffer_create_cairo(uint32_t logical_width, uint32_t logical_height, float scale)
{ {
if (!logical_width || !logical_height) {
wlr_log(WLR_ERROR, "Failed to create cairo buffer of %ux%u: dimensions must be > 0",
logical_width, logical_height);
return NULL;
}
/* Create an image surface with the scaled size */ /* Create an image surface with the scaled size */
cairo_surface_t *surface = cairo_surface_t *surface =
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
@ -142,6 +149,7 @@ buffer_create_from_data(void *pixel_data, uint32_t width, uint32_t height,
buffer->logical_width = width; buffer->logical_width = width;
buffer->logical_height = height; buffer->logical_height = height;
buffer->data = pixel_data; buffer->data = pixel_data;
assert(buffer->data);
buffer->format = DRM_FORMAT_ARGB8888; buffer->format = DRM_FORMAT_ARGB8888;
buffer->stride = stride; buffer->stride = stride;
buffer->surface = cairo_image_surface_create_for_data( buffer->surface = cairo_image_surface_create_for_data(
@ -188,6 +196,10 @@ buffer_resize(struct lab_data_buffer *src_buffer, int width, int height,
struct lab_data_buffer *buffer = struct lab_data_buffer *buffer =
buffer_create_cairo(width, height, scale); buffer_create_cairo(width, height, scale);
if (!buffer) {
wlr_log(WLR_INFO, "Failed to resize buffer to %dx%d", width, height);
return NULL;
}
cairo_t *cairo = cairo_create(buffer->surface); cairo_t *cairo = cairo_create(buffer->surface);
struct wlr_box container = { struct wlr_box container = {

View file

@ -82,6 +82,7 @@ font_buffer_create(struct lab_data_buffer **buffer, int max_width,
cairo_pattern_t *bg_pattern, double scale, bool use_markup) cairo_pattern_t *bg_pattern, double scale, bool use_markup)
{ {
if (string_null_or_empty(text)) { if (string_null_or_empty(text)) {
*buffer = NULL;
return; return;
} }
@ -91,6 +92,13 @@ font_buffer_create(struct lab_data_buffer **buffer, int max_width,
height = computed_height; height = computed_height;
} }
if (height <= 0 || width <= 0) {
wlr_log(WLR_INFO, "Refusing to create invisible font buffer of %dx%d",
width, height);
*buffer = NULL;
return;
}
*buffer = buffer_create_cairo(width, height, scale); *buffer = buffer_create_cairo(width, height, scale);
if (!*buffer) { if (!*buffer) {
wlr_log(WLR_ERROR, "Failed to create font buffer"); wlr_log(WLR_ERROR, "Failed to create font buffer");

View file

@ -29,7 +29,7 @@ _create_buffer(struct scaled_buffer *scaled_buffer, double scale)
&self->font, self->color, bg_pattern, scale, self->use_markup); &self->font, self->color, bg_pattern, scale, self->use_markup);
if (!buffer) { if (!buffer) {
wlr_log(WLR_ERROR, "font_buffer_create() failed"); wlr_log(WLR_INFO, "font_buffer_create() failed");
} }
zfree_pattern(solid_bg_pattern); zfree_pattern(solid_bg_pattern);

View file

@ -621,7 +621,24 @@ xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
if (geo.width != view->pending.width if (geo.width != view->pending.width
|| geo.height != view->pending.height) { || geo.height != view->pending.height) {
if (toplevel->base->initialized) { if (toplevel->base->initialized) {
serial = wlr_xdg_toplevel_set_size(toplevel, geo.width, geo.height); /*
* geo.{width,height} are checked here to guard against
* an odd edge-case reported in #3608 which involves TTY
* switching between labwc and Xfce running on X.Org on
* another TTY. It is not yet clear what causes this,
* but hitting wlroots assert() is not great, so let's
* protect against it.
*
* Ref:
* - https://github.com/labwc/labwc/issues/3608
*/
if (geo.width > 0 && geo.height > 0) {
serial = wlr_xdg_toplevel_set_size(toplevel,
geo.width, geo.height);
} else {
wlr_log(WLR_ERROR, "cannot set size %dx%d",
geo.width, geo.height);
}
} else { } else {
/* /*
* This may happen, for example, when a panel resizes because a * This may happen, for example, when a panel resizes because a