Commit graph

2647 commits

Author SHA1 Message Date
Consolatis
bce14a5ad7 toplevel-capture: partial initial implementation
Missing:
- xwayland child windows
- xwayland unmanaged windows, e.g. popups / menus / ...
- xdg child window positioning
- xdg subsurfaces (test-case: mate-terminal settings listboxes)
- xdg popup positioning
2026-05-20 17:49:06 +01:00
Tomi Ollila
80ff89c640 Typo/style fixes in docs and code comments
Codespell(1)-pointed typos in files listed by `git ls-files`
(sans checkpatch.pl and possibly some others). Removed some
extra spaces. Added a few missing trailing periods.
`Default is ...`.  Added spaces in ' />' where missing
(sans e.g. wayland protocol and t/* files).
Fit some lines in docs/*.scd to 80 colums.

Used git grep commands (to find similar cases):
$ git grep -n '\S/>'
$ git grep -nF '.  '
$ git grep -n '[^\t*'\'',{#]\t'
$ git grep -ni 'default '

No functional change. No change in *.[ch] line numbers.
2026-05-18 19:55:05 +01:00
massi
4af693a7fd window-title: cleaner string replace
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2026-05-16 14:36:51 +01:00
massi
cd7be59d5f window-title: rewording, renaming, lint fixes 2026-05-16 14:36:51 +01:00
massi
0a9bd41df0 window-title: add documentation 2026-05-16 14:36:51 +01:00
massi
df6dde131f window-title: implement window-title command line argument
When -t or --window-title is supplied, its required argument is treated as a
format string where `%o` is replaced by the `wlr-output`'s `name` when we set
the window title.

This uses glib to split and join the format string because our own
`string-helpers` library only has `str_join`. Otherwise using `string-helpers`
would have been preferred.
2026-05-16 14:36:51 +01:00
massi
7a53f294a8 output.c: use env var LABWC_TITLE to set nested labwc window title
Introduces an environment variable LABWC_TITLE, which, when set, will
be used to set the title of a nested instance of labwc.
2026-05-16 14:36:51 +01:00
Tomi Ollila
8473ea4b72 main: update --version string 2026-05-13 14:47:08 +02:00
Alex Chernika
e2f3c03287
src/menu: slight clean up of menu accelerators
Slight clean up of the accelerator implementation, including use of glib for utf8-parsing
2026-05-08 20:35:40 +02:00
Christopher Snowhill
c1b11c7821 chase wlroots: Add support for HDR10 output
v2: Switch XRGB to XBGR
v3: Rewrite HDR mode checking and setting
v4: Restructure HDR support detection
v5: Fix code style
v6: Fix old style function declaration
v7: This function should be declared static
v8: This helper function can accept a const struct on input
v9: Rebase now that 0.20 is merged
v10: Rewrite with multiple color format attempts
v11: Add in the parts that accidentally got left in my
     original color-management-v1 patch
v12: Add missing function prototype
v13: Apply suggested changes
v14: Changed HDR application setup in new output
v15: Rewrite configure_new_output to use lab_wlr_scene_output_commit
v16: Fixed application of HDR on external mode or output config change
v17: Fixed it for real this time instead of crashing
v18: Moved the effective resolution collection, plus one style change.
2026-05-07 15:21:34 +02:00
Consolatis
2189b2be1e main: include wlroots version in --version string 2026-05-07 06:24:30 +01:00
Consolatis
2480a23b19 common/macros: change WLR_VERSION macro to runtime evaluation 2026-05-07 06:24:30 +01:00
Johan Malm
0f5e4f8dd0 cycle.c: put common code in get_cycle_app_id 2026-05-07 04:42:11 +02:00
Johan Malm
949e9ffe42 cycle.c: put common code in get_view_criteria() 2026-05-07 04:42:11 +02:00
Johan Malm
f42e1895d4 buf.c: fix -fanalyze warning
../src/common/buf.c:61:28: error: write to string literal [-Werror=analyzer-write-to-string-literal]
   61 |                         *p = '\0';
      |                         ~~~^~~~~~
2026-05-05 20:31:47 +02:00
Alex Chernika
3632c6703a menu: implement menu accelerators
Menu accelerators are one-letter mnemonics to quickly select/exec
items from the current menu. For each menu item, the accelerator is
defined as the first character of the item label, converted to
lowercase. A different accelerator can be explicitly defined in
menu.xml with the special '_' character before the target letter.

- Add a field `accelerator` to the `menuitem` struct
- Implement `menu_item_select_by_accelerator()`

Example:
The accelerator for an item with the label "e_macs" is 'm'.
2026-05-05 19:16:59 +01:00
Alex Chernika
07a0a4e59b scaled-buffer: introduce scaled_font_buffer_update_markup()
This function behaves identically to `scaled_font_buffer_update()`
but allows setting the text as pango markup, supporting further
customization like underscores.
2026-05-05 19:16:59 +01:00
tokyo4j
0ff9af4ae0 src/img/img-xpm.c: fix unused variable warning
This fixes a warning in gcc16 below:

../src/img/img-xpm.c: In function ‘xpm_load_to_surface’:
../src/img/img-xpm.c:354:33: warning: variable ‘xcnt’ set but not used [-Wunused-but-set-variable=]
  354 |                 for (int n = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
      |                                 ^~~~
2026-05-04 06:21:58 +01:00
elviosak
6ce25978e7 Add Next/PreviousWindowImmediate to switch windows without OSD
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Co-authored-by: @johanmalm
2026-05-02 13:37:34 +01:00
elviosak
bc7498dc6f fix chromium popup on maximized window 2026-05-01 19:49:40 +01:00
Jos Dehaes
def6ff22d3 session: drop goto label from spawn_sync_no_shell
Replace goto out with break since g_strfreev follows the switch directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 19:45:01 +01:00
Jos Dehaes
998fd80737 session: run activation env update synchronously
dbus-update-activation-environment and systemctl --user import-environment
were fired asynchronously via spawn_async_no_shell, racing with the autostart
script. Any systemd user service started from autostart (e.g. via
labwc-session.target) could start before the import completed, leaving
WAYLAND_DISPLAY and related variables absent from its environment and those
of any apps it launches.

Run both commands synchronously via a new spawn_sync_no_shell helper so
the import is guaranteed to complete before the autostart script executes.
2026-04-29 19:45:01 +01:00
Jos Dehaes
e61d58e54d desktop: only apply raise-on-focus delay to sloppy-focus
The raise_on_focus_delay is meant to dampen z-order churn from
focus-follows-mouse cursor passes. Applying it to every focus
change meant explicit actions (alt-tab cycle finish, Focus action,
xdg/xwayland activation, view map, etc.) also waited for the delay
before raising, which felt laggy.

Route all non-sloppy-focus callers through an immediate raise and
keep the timer-based raise only for desktop_focus_view_or_surface(),
which is the sloppy-focus entry point.
2026-04-28 20:33:09 +01:00
Jos Dehaes
9661ed4285 server: cancel pending auto-raise on config reload
If the user disables raiseOnFocus or lowers raiseOnFocusDelay while
a raise is queued, the queued raise should not fire against the new
config. Cancel it in reload_config_and_theme() before rereading the
rc.xml.
2026-04-28 20:33:09 +01:00
Jos Dehaes
ecc5565686 view: cancel pending auto-raise on view destroy
The pending_auto_raise_view pointer would become dangling if the
view it references is destroyed before the timer fires. Clear it
in view_destroy() alongside the existing active_view cleanup.
2026-04-28 20:33:09 +01:00
Jos Dehaes
28908adfbe desktop: implement delayed auto-raise timer logic
When raiseOnFocus is enabled and raiseOnFocusDelay is > 0, defer
view_move_to_front() until a wl_event_loop timer elapses instead of
raising immediately. The pending view/timer pair lives on struct
server so that at most one raise can be pending per compositor.

Semantics:
  delay_ms == 0            : immediate raise (preserves prior behavior)
  delay_ms >  0, hover A   : schedule raise of A after delay_ms
  another hover before     : timer is reset and the new view becomes
    expiry                   the pending one (brief flyby hovers do
                             not stack up raises)
  focus change, raise=false: pending raise is cancelled

This is most useful with followMouse to avoid brief passes of the
cursor stacking up z-order changes.
2026-04-28 20:33:09 +01:00
Jos Dehaes
7b3f37725f rcxml: add raiseOnFocusDelay option
Add a new <focus><raiseOnFocusDelay> element accepting an integer in
milliseconds. The default of 0 preserves the current behavior (raise
immediately when raiseOnFocus is enabled).

The new field is carried as uint32_t raise_on_focus_delay_ms on
struct rcxml. This commit only adds the parser and default; the
actual delay logic follows in a subsequent commit.
2026-04-28 20:33:09 +01:00
diniamo
5c7bfe3c67 Add onbutton scrollMethod, scrollButton 2026-04-27 20:55:55 +01:00
tokyo4j
7d264c907f src/cycle/cycle.c: fix typo 2026-04-26 19:07:23 +09:00
Thorbjørn Lindeijer
5f668a82ee interactive: allow resize on fully maximized views
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Modifier+right-drag resize was silently ignored on fully maximized views
because of an early-return guard in interactive_begin(). The axis-specific
un-maximization logic introduced in #3043 already handles partial
maximization correctly; extend that to the VIEW_AXIS_BOTH case so both
axes are cleared while keeping the current geometry as the starting point
of the resize.

Move already permits dragging maximized views, so this also removes an
asymmetry between the move and resize paths.

Fixes: #3524
2026-04-19 13:37:13 +01:00
Yannis Drougas
c5ea41e876 Add overrideInhibition to keyboard.keybind
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2026-04-14 22:33:49 +01:00
yuiiio
4c7a9960a4 osd-thumbnail: fix failed to get client texture
Use wlr_client_buffer->texture directly instead of wlr_texture_from_buffer.
All buffers in content_tree are wlr_client_buffer.

wlr_texture_from_buffer calls client_buffer_begin_data_ptr_access which
fails when client_buffer->source == NULL (client released buffer early,
e.g. wl_shm foot-terminal).
2026-04-15 00:26:10 +09:00
Johan Malm
da37e97a45 Add action ToggleShowDesktop
Some checks are pending
labwc.github.io / notify (push) Waiting to run
2026-04-13 21:59:09 +01:00
Tobias Bengfort
8b32422b93 rcxml: allow to restrict privileged interfaces
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2026-04-11 16:34:11 +02:00
Johan Malm
c8bb3381a4 Add key state OSD for debugging
Some checks are pending
labwc.github.io / notify (push) Waiting to run
Add action `DebugToggleKeyStateIndicator` to show in the top-left corner
the pressed, bound, pressed-sent keys as well as modifiers.

This should help fault find issues like #2771 and #3238

Based-on: #3262
Co-authored-by: @tokyo4j
2026-04-10 21:19:11 +01:00
Manuel Barrio Linares
3ec20044b5 server: add support for color-management-v1 and color-representation-manager-v1 2026-04-10 12:59:44 +02:00
John Lindgren
90c38e2681 xdg: set initial position a hair earlier to fix window rules
Partially reverts: 3f223fe5b0
("xdg: unify initial positioning logic")
2026-04-07 20:05:00 +02:00
Jens Peters
a893b1ab50 input: fix tablet tool tilt motion
Tilt axis are not relative.
2026-04-06 22:10:10 +01:00
Consolatis
c9b4da2ce2 osd-thumbnail: handle buffer allocation failure
Fixes: #3489
2026-04-02 22:10:30 +02:00
Consolatis
8c6faa010f make wlroots libinput backend optional 2026-03-31 22:58:49 +02:00
Consolatis
dfbea3e156 make wlroots session backend optional 2026-03-31 22:58:49 +02:00
Consolatis
046d055ac0 make wlroots DRM backend optional 2026-03-31 22:58:49 +02:00
Johan Malm
fe1955fb27 Stop generating wayland-protocols server headers
We still need to generate wlr-protocols server headers, as well as
client headers and code.

References:
- https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5075
- https://github.com/swaywm/sway/pull/8838
2026-03-31 20:51:49 +02:00
Jens Peters
0d049552bc input: support tablet tool pressure range configuration
Needs wlroots 0.20.0.
2026-03-31 19:56:07 +02:00
GlassOnTin
9a8154836c keyboard: use XKB_CONTEXT_NO_SECURE_GETENV on Android
Android's bionic libc implements secure_getenv() as a function that
always returns NULL because app processes don't have AT_SECURE set.
This prevents xkbcommon from reading XKB_DEFAULT_LAYOUT and other
environment variables when resolving keyboard layouts.

Use XKB_CONTEXT_NO_SECURE_GETENV on Android so xkbcommon falls back
to regular getenv(), which works correctly in the Android app
environment.
2026-03-30 22:25:35 +01:00
tokyo4j
3128f50a25 xwayland: remove atom synchronization
It was used to get window icon via _NET_WM_ICON, which is now
implemented by wlroots 0.20. Anyone who needs another atom can revert
this commit and add atoms in the `atoms` array.
2026-03-30 11:55:37 +02:00
tokyo4j
cdee4ba5f1 xwayland: use wlr_xwayland_surface_fetch_icon() 2026-03-30 11:55:37 +02:00
Christopher Snowhill
cee5712877 chase wlroots: wlr_scene_set_gamma_control_manager_v1
Ref: 515275ee7214bf91f8a758b660093eb4b932195a
(wlr_scene: Introduce wlr_scene_set_gamma_control_manager_v1)

This wlroots change eliminates the need for separate event tracking for gamma
control application.

v2: Fix code style
v3: Rebase now that 0.20 is merged
2026-03-30 11:18:53 +02:00
tokyo4j
647e9b7658 Drop cosmic-workspace and use wlroots implementation of ext-workspace-v1 2026-03-30 10:29:04 +02:00
Manuel Barrio Linares
76f166ae42 chase wlroots: wlr_xwayland_set_cursor now takes a wlr_buffer (MR 5230)
Ref: 84d603acc06a45dd3c3a4b2cf1fd08b2933ca2b5
(xwayland: take wlr_buffer in wlr_xwayland_set_cursor())

Ref: 6ae54dca23064e897b393283887986e5719a747f
(xwayland: lock new buffer instead of the old one)

Co-Authored-By: Consolatis

This wlroots change fixes a potential UAF which we dealt with in labwc.
We can thus remove the workaround completely.
2026-03-29 15:58:13 +01:00