Commit graph

3413 commits

Author SHA1 Message Date
John Lindgren
4f8b80700e tree-wide: do not try to use outputs with no scene_output
- check for valid scene_output in output_is_usable()
- change many "output != NULL" checks to use output_is_usable()
- remove one now-redundant separate check for valid scene_output

Fixes a crash at startup (with autoEnableOutputs=no) due to
dereferencing null scene_output in create_output_config() since:

7d7ece21d9
("output: suppress error when output position is unavailable")

Fixes: #3357
2026-02-04 21:05:16 +00:00
John Lindgren
81778a16bb xwayland: flush X11 connection after focus/activate
This mitigates a race where the XWayland server may generate an unwanted
FocusOut event for the newly activated window, if it receives mouse/
pointer events over the parallel wayland connection first.

In particular, this fixes an issue with certain fullscreen applications
(such as Minecraft) that self-minimize when receiving FocusOut.

Also limit a previous similar workaround to apply only to XWayland views.

Fixes: #3344

See also: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/4044
2026-02-04 18:53:45 +01:00
tokyo4j
12b6d05481 view: fix error messages on region or usable area changes
f58b532 implemented output-relative position saving/restoring on output
un-plugging/re-plugging. It worked as follows:

1. Store the output-relative view geometry in `view->last_placement`
  (if not set) before adding/removing an output from the layout.
2. After adding/removing an output, call `view_adjust_for_layout_change()`
  after the layout change to restore the output-relative view geometry
  based on `view->last_placement`.

However, it didn't consider `view_adjust_for_layout_change()` being
called from other places such as `regions_reconfigure()` and
`output_update_all_usable_areas()`, causing an error message "view has
no last placement info". This can happen when a panel is mapped or
unmapped, or on Reconfigure.

This commit fixes it by changing the life cycle of
`view->last_placement`. It used to be set only before output layout
changes and cleared on user-initiated moves/resizes, but now it is set
and updated on user-initiated moves/resizes. I think this is more
intuitive, too.
2026-02-04 19:14:51 +09:00
tokyo4j
7fabc6afe3 string-helpers: update comments for str_equal() 2026-02-04 19:14:51 +09:00
tokyo4j
55a256f2fa desktop: use for_each_view() in desktop_topmost_focusable_view()
Fixes a regression in 83b619c2 that the bottom-most view is focused
when when an exclusive layer surface (e.g. fuzzel) is unfocused.

Also, added some comments to clarify the order.
2026-01-31 17:16:13 +01:00
John Lindgren
67e3b36e58 view: cancel interactive move/resize when minimized/unmapped
Currently, with enough dexterity, you can minimize a window via hotkey
with one hand while continuing to move it (now invisible) with the
mouse in your other hand. The same can probably happen with XWayland
windows that self-unmap at an inconvenient time.

Probably not a common occurrence, but it's trivial to handle.
2026-01-31 08:15:49 +01:00
tokyo4j
37618a1456 Avoid double use of struct workspace
`struct workspace` was used both for representing an actual workspace
and for an entry of workspace configuration. Avoid it for clarity.
2026-01-30 18:41:37 +01:00
tokyo4j
4819f47f98 cycle: fix spurious focus changes on finishing window switcher
As described in the `FIXME` comment in `cycle.c`, we had spurious focus
changes where the keyboard focus is momentarily given to the previously
focused window when finishing the window switcher, an then it is given
to the selected window.

This commit fixes this by adding a parameter in
`seat_focus_override_end()` to avoid restoring the focus to the
previously focused window.

I also removed the check for `!seat->seat->keyboard_state.focused_surface`
in `seat_focus_override_end()`. I thought it was necessary to avoid
updating the keyboard focus if the focus was given to a session-lock
surface before e.g. finishing window switching, but `seat_focus()` is
no-op in that case anyway.
2026-01-30 17:06:30 +00:00
tokyo4j
83b619c285 desktop: use for_each_view() instead of scene graph traversal
...for desktop_focus_output() and desktop_topmost_focusable_view().
2026-01-30 16:53:06 +00:00
Jacques Boscq
edf3624dac Unshade window if selected from client-list-combined-menu 2026-01-28 22:34:50 +01:00
tokyo4j
90812103b6 view: don't update top layer visibility in view_discover_output()
This commit does not change any behaviors.

We don't need to call `desktop_update_top_layer_visibility()` in
`view_discover_output()` since it's called in `view_update_outputs()`.
2026-01-28 19:58:06 +00:00
tokyo4j
a62441ff77 cycle: show non-dialog child windows in window switcher
Before this commit, the window switcher skipped all the child windows.

However, as child windows not marked as modal dialogs can lose focus
(ref. `desktop_focus_view()`), it will make sense to include them in the
window switcher so that users can refocus them with keyboard.
This behavior follows KWin.
2026-01-27 21:10:32 +00:00
tokyo4j
87586104cd view: add view_is_modal_dialog() 2026-01-27 21:10:32 +00:00
Johan Malm
ac94e1d44c NEWS.md: interim update 2026-01-26 20:59:49 +00:00
Consolatis
645a7b56ce docs: correct description for 'overlay enabled' config
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2026-01-21 20:30:35 +00:00
John Lindgren
aa672215b1 view: avoid restacking when view (or a sub-view) is already in front
Currently, every click within a sub-view results in first restacking
the parent view in front, and then the sub-view. This is unnecessary
and has caused issues in the past, such as with Xaw popups (which
we've worked around in d748dc78bc by adding an xcb_flush()).

It would be better not to do the unnecessary restacking at all.
2026-01-19 18:35:17 +00:00
Weblate
ee7376421c Translation updates from weblate
Co-authored-by: Baurzhan Muftakhidinov <baurthefirst@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: milotype <mail@milotype.de>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/hr/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/kk/
Translation: Labwc/labwc
2026-01-18 21:02:25 +00:00
John Lindgren
cd291fe051 view: avoid repeated focus changes unminimizing parent/child views
When unminimizing a group of N parent/child views, we currently end up
triggering N focus changes (as well as O(N^2) surface restackings) due
to calling desktop_focus_view() for each view in turn.

Since desktop_focus_view() already raises all sibling views together
via view_move_to_front(), let's make view_minimize() call it only once
at the very end, once all views are visible.

Test cases:
- Audacious with floating plugin views (XWayland)
- xfce4-terminal with About dialog (xdg-shell)

v2: also avoid repeated focus changes when minimizing
2026-01-18 20:38:53 +00:00
tokyo4j
7d7ece21d9 output: suppress error when output position is unavailable
This commit removes the "failed to get output layout box" error printed
when disabling an output with `wlr-randr`.

Also, use `output->scene_output->{x,y}` instead of calling
`wlr_output_layout_get_box()` for simplicity. The positions of
scene-outputs are synced with the output-layout-outputs.
2026-01-14 18:14:10 +00:00
tokyo4j
37c7de32c8 view: keep and restore the output-relative position on layout changes
Before this patch, we always tried to preserve the global positions of
floating windows across layout changes, which meant that windows could
jump to different outputs if the output coordinates changed.

Instead, this patch adds the output name and output-relative position in
`view->last_placement` to keep them across layout changes, like KDE and
GNOME do.

This also allows us to remove `view->lost_output_due_to_layout_change`,
which was required to keep the output of fullscreen/maximized windows,
since we now always try to keep `view->output` whether or not the window
is floating.
2026-01-15 02:10:31 +09:00
tokyo4j
f58b532214 view: save last placement info before layout change
I will add output name and relative view position in
`view->last_placement` later, which needs to be saved before layout
changes unlike the global position.
2026-01-15 02:10:31 +09:00
tokyo4j
a964d41dd1 view: document adjust_floating_geometry() 2026-01-15 02:10:31 +09:00
tokyo4j
ee52853e69 view: rename last_layout_geometry to last_placement.layout_geo 2026-01-15 02:10:31 +09:00
John Lindgren
20929c0484 view: rework saving/restoring geometry across layout changes
After several iterations, this is basically a complete re-work. The old
implementation was difficult to follow and sometimes failed to restore
fullscreen/maximized/tiled geometry correctly, since it was based
entirely on natural (floating) geometry.

The new implementation:
 - always saves the actual (pending) geometry at first layout change
 - explicitly tracks whether a view has moved between outputs
 - consolidates invalidating the saved geometry into one place, rather
   than having lots of invalidate() calls sprinkled everywhere
2026-01-12 17:41:02 +09:00
Vasiliy Stelmachenok
c1c156ef39 xwayland: Do not try to focus a window that was already in focus
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
2026-01-12 00:06:10 +01:00
Tomi Ollila
f09a0c2be3 scripts/check: run checkpatch.pl processes with max 16 args each
Reduce the overhead of fork/execve/perl startup time by not
doing those for every files that are checked.

This also makes the check execution complete faster.

On similar systems and similar background load, the execution time
varies based on how find(1) outputs the (*.[ch]) files it sees on
filesystem -- the filenames are not sorted but are written from
directories src/ include/ clients/ t/ in that order -- more than
80% of the time goes checking files in src/, and how the 16-file
batches from that dir (108 files in src/, 208 total, as of 2026-01)
are distributed the checkpatch.pl processes affect mostly to the
total run time.
2026-01-09 23:17:14 +01:00
Consolatis
02327e19b0 CI: disable no-font check
Void made the foot package depend on the font.

Running this test now always fails with
> `dejavu-fonts-ttf-2.37_3` in transaction breaks installed pkg `foot-1.25.0_2'

As this test uses both and the feature itself
seems to work well lets just skip it for now.
2026-01-05 17:40:28 +00:00
John Lindgren
9600c73ea4 protocols: remove wlr-input-inhibitor-unstable-v1
It appears we don't support this protocol any more. It was originally
used for swaylock, which now uses ext-session-lock-v1 instead.
2026-01-04 04:20:33 +01:00
John Lindgren
f5909ac54d view: eliminate store_natural_geometry arguments
These were added to fix handling of natural geometry for snap-to-edge
behavior back in 9021020f6e and seemed like a good idea at the time.
Since then, the number of call sites has exploded, so it seems more
maintainable to put explicit checks for interactive move within the
three functions affected.
2026-01-01 12:54:16 +00:00
tokyo4j
742c2b53fd cycle: implement scrollable OSD
Before this commit, the OSD could overflow the screen when displaying
many window items. In this commit, we hide the overflowed items and
show a scrollbar to fit the OSD within the screen.
2025-12-31 22:46:53 +00:00
tokyo4j
97b31429a0 cycle: cycle: ensure server->cycle is cleared in destroy_cycle()
...as I'm adding more state variables there for scrolling mechanism.
2025-12-31 22:46:53 +00:00
tokyo4j
9f50971e0b Halt window switcher on Reconfigure
There was an invalid memory access (since introduction of thumbnail
style in 2e9292b) with following steps:

1. Press Alt-Tab
2. Update `<windowSwitcher><osd><style>` from `classic` to `thumbnail`
3. Run `Reconfigure`
4. Press Alt-Tab again

...because `cycle_osd_thumbnail_update()` is called even though
`cycle_osd_output->items` holds `cycle_osd_classic_item`.

This commit halts window switcher on `Reconfigure` to clear
`cycle_osd_output->items` and avoid that invalid memory access.
2025-12-31 14:18:02 +01:00
tokyo4j
8ad96c0410 cycle: add server->cycle_preview_tree
This doesn't change any behaviors.
2025-12-28 21:03:03 +00:00
tokyo4j
dfe428ae14 cycle: refactor to aggregate type definitions into cycle.h
We declared `cycle_state` struct in `labwc.h` and `cycle_osd_scene`
struct in `output.h`, which was unclean in terms of separation of
concerns.

So this commit firstly moves `cycle_state` to `cycle.h`, then replaces
`cycle_osd_scene` in `output.h` with `cycle_osd_output` in `cycle.h`
which is dynamically allocated in a similar manner to
`session_lock_output`. This ensures that all states about alt-tabbing
are stored in `server->cycle`.

Also, this commit fixes a rare memory leak in `output->cycle_osd.items`
when an output is destroyed while alt-tabbing, by freeing it when the
osd tree is destroyed.
2025-12-28 20:57:37 +00:00
Consolatis
276d4e61f9 config/rcxml.c: prevent wrong parse_bool() err message
by only parsing the boolean when it is not `disabledOnExternalMouse`.

Fixes: #3293
2025-12-26 20:39:36 +00:00
Consolatis
ec9579fdc1 CI: disable IRC notifications for now
Libera started requiring an account for the IP ranges of GH CI.
This currently results in the IRC notification job running for
more than one hour because the IRC client it uses doesn't
terminate properly after giving up and thus eats our CI minutes.

The patch disables the notifications for now until we figure out
a better way, either by registering a libera account for the bot
and supplying the credentials via secret or by changing to GH
webhooks to a publicly available service like pipe.pico.sh which
then can be listened to by our existing IRC bot.
2025-12-26 16:22:58 +01:00
tokyo4j
610d869561 cycle: add <action name="NextWindow" output="" and identifier="">
Some checks failed
labwc.github.io / notify (push) Has been cancelled
output="all|focused|cursor" filters windows by the output they are on.
identifier="all|current" filters windows by their app-id.
2025-12-26 05:25:54 +09:00
tokyo4j
a5c6ff499c cycle: support <action name="NextWindow" workspace="current|all">
This commit deprecates <windowSwitcher allWorkspaces="yes|no"> and adds
per-action argument <action name="NextWindow" workspace="current|all">.
2025-12-26 05:25:54 +09:00
Consolatis
caa9b90e80 docs: add example for GTK4 composing 2025-12-23 20:11:33 +00:00
Cameron Scott McCreery
64aec6ff5d
workspaces: add config option for initial workspace selection
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-12-22 22:17:43 +01:00
tokyo4j
c9b088e343 cycle: add and use get_outputs_by_filter()
This function can be reused for filtering windows to cycle through.
2025-12-22 18:57:51 +00:00
tokyo4j
64af206114 Rename cycle_osd_output_criteria to cycle_output_filter 2025-12-22 18:57:51 +00:00
tokyo4j
e2d83ff7f5 rcxml: sync rcxml.window_switcher with XML format 2025-12-22 18:57:51 +00:00
Johan Malm
a98fd8f974 build: bump version to 0.9.3 2025-12-19 16:38:55 +00:00
Johan Malm
d1ba186fe4 NEWS.md: update notes for 0.9.3 2025-12-19 16:32:58 +00:00
Juliana Sims
7537501668 labwc-config(5): correct semantically-significant typo
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-12-16 05:42:16 +00:00
Tomi Ollila
7f0abed9c8 docs: tab to space: 4, trailing newline: -1, fit some lines to 80-cols
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-12-12 19:49:38 +00:00
tokyo4j
1317439513 rcxml: minor updates for deprecation message 2025-12-12 15:57:43 +09:00
Johan Malm
a059fbb7cb NEWS.md: interim update
...at start of cool-down period for 0.9.3
2025-12-10 18:52:21 +00:00
Consolatis
333ae306b1 desktop-entry: better handle desktop files with dots in their name
This fixes - among others - cases like `R.E.P.O..desktop`.

Due to the duplicated dot at the end we were matching against
a 0 sized string which was always true and thus would always
match the desktop file, regardless of what the app-id was.

A related issue is that an app-id of `osomething` would match
a desktop file name called `R.E.P.O.desktop` due to the string
being size of 1.

Fix this by requiring the partial desktop filename string to
be at least 3 characters wide.

Fixes #3257
2025-12-11 01:36:38 +09:00