Commit graph

2133 commits

Author SHA1 Message Date
Consolatis
51cdefa93e CI: rewrite smoke test and support LABWC_RUNS env var 2024-03-16 18:42:47 +01:00
Consolatis
fc9cf5c931 src/common/buf.c: enhance the buffer API
There is at least one user of the buffer API that reuse a single
buffer by just resetting `buf.len` to `0`. This works as long as
the new user of the buffer actually adds something to the buffer.

However, if we don't add anything but still provide `buf.buf` to
a consumer, the old content will be re-used.

This patch thus adds two new clearing variants to the buffer API:
- `buf_clear()` which doesn't reset the internal allocations
- `buf_reset()` which does free the internal allocations

Additionally, this patch makes `buffer_add_char()` public which
allows adding single characters to an existing buffer. This will
be used in a future PR which implements custom format strings for
the OSD.
2024-03-16 15:45:46 +00:00
droc12345
b0c2ac1a6d
osd: add window-switcher field content types (#1623)
...`workspace`, `state`, `type_short` and `output`.

Example usage:

    <windowSwitcher allWorkspaces="yes">
      <fields>
        <field content="workspace" width="5%" />
        <field content="state" width="3%" />
        <field content="type_short" width="3%" />
        <field content="output" width="9%" />
        <field content="identifier" width="30%" />
        <field content="title" width="50%" />
      </fields>
    </windowSwitcher>
2024-03-16 15:28:37 +00:00
Weblate
901240b321 Translation updates from weblate
Co-authored-by: Hiroaki Yamamoto <hrak1529@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ja/
Translation: Labwc/labwc
2024-03-16 14:39:39 +00:00
Weblate
1597d683ca Translation updates from weblate
Co-authored-by: Abdullah Albaroty <albaroty@gmail.com>
Co-authored-by: Hiroaki Yamamoto <hrak1529@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: alwanasary <baity.jannati@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ar/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/id/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ja/
Translation: Labwc/labwc
2024-03-14 20:24:29 +00:00
tokyo4j
b6d576922b IME: support IME popup 2024-03-14 20:11:03 +00:00
Consolatis
53fc8d5e39 CI: add simple runtime test 2024-03-14 00:42:13 +01:00
Andrew J. Hesford
cdac800692 action: allow client-menu to open at mouse cursor 2024-03-13 10:51:50 -04:00
Scarcely There
bfa3a32ae3 session: Don't close a null dir in read_environment_dir
Closes: #1615 [via git-merge-pr]
2024-03-13 10:36:55 -04:00
Andrew J. Hesford
3460d5be98 session: abort process_line early if line contains no key 2024-03-13 11:47:11 +01:00
Johan Malm
5cb3583108 keyboard: use 'us' as fallback for XKB_DEFAULT_LAYOUT
...if keymap cannot be created for the provided XKB_DEFAULT_LAYOUT.

If keymap still cannot be created, exit with a helpful message to avoid
crash that is hard to understand.

Fixes: https://github.com/stefonarch/lxqt-labwc-session/issues/7
2024-03-12 20:59:39 +00:00
Simon Long
1e1e90d0bb
Reload cursor theme and size on reconfigure
Fixes: #1587
2024-03-12 20:53:41 +01:00
Andrew J. Hesford
9e0846ea14 docs/labwc-config.5: fix "environment directory" typo 2024-03-12 07:36:06 -04:00
droc12345
4ecac26548
workspaces: add ability to set prefix when using number argument 2024-03-11 23:19:03 +01:00
Andrew J. Hesford
e837445114 session: process environment.d and allow empty variables
1. All '*.env' files in an 'environment.d' directory alongside each
   potential 'environment' file will be parsed and added to the
   environment.

2. For the purposes of configuration merging, an environment definition
   exists at one level if either the 'environment' file is defined or
   its corresponding 'environment.d' contains any valid '*.env' file.

3. Variable declarations of the form "VARIABLE=", with no following
   value, will be written to the environment as empty strings.
2024-03-11 20:01:14 +00:00
Standreas
52cb643189
docs/labwc-config.5.scd: fix typo 2024-03-11 08:17:52 +01:00
Jens Peters
90823b3350 README.md: add alt-space binding
That one was missing in the default bindings.
2024-03-10 19:49:16 +01:00
Johan Malm
a5fcbfaf72 cursor: process layer subsurfaces in cursor_button_press()
...to give keyboard focus to layer-shell clients if exclusive or on-demand
interactivity is set, so that menu popups can be navigated with the
keyboard. This still only works if the client is in top (or overlay)
layers. Support for bottom and background to be done as a separate patch
set.

Revert 06b19f0 to process layer-shell subsurfaces in
`cursor_button_press()`, but only when their parent layer-shell surface
has keyboard interactivity.

Fix bug in `get_cursor_context()` which resulted in layer-surfaces not
being detected correctly.

Background:

Commit 06b19f0 (issue #1131) disabled processing of layer-shell
subsurfaces in cursor_button_press() because when pressing a task in
Waybar (Gtk panel using layer-shell subsurfaces) the foreign-toplevel
minimize-raise action did not work correctly as the action logic relied on
the recipient window being activated and by clicking on the panel, the
panel itself was both surface-focusd and activated (and thus the window
de-activated).

The un-intended consequence was that by not responding to layer-subsurface
cursor buttons presses, layer-shell clients (such as panels) were not
given keyboard focus if they indeed wanted it by setting exclusive or
on-demand keyboard interactivity.

The good news is that that following @jlindgren90's refactoring (various)
the only place where we call `view_set_actived()` is in
`focus_change_notify()` in `seat.c` and we now only do it for views
(bb8f0bc).

Another side-effect (positive) of 06b19f0 was that a Waybar dnd bug was
fixed (pointer-serial-number validation failure).

Have tested with sfwbar, waybar and tint (test-panel) the following
results:
- Minimize-raise works even when on-demand keyboard interactivity is set
- Keyboard interactivity is given popup-menus (sfwbar and tint) when the
  panels are in the top layer (support for bottom will be as a separate
  patch set)
- Waybar dnd still works (even when hard-coding keyboard-interactivity)

References:
- bb8f0bc960
- 40ce95a68c/src/seat.c (L481-L483)
- 40ce95a68c/src/dnd.c (L24)
- https://github.com/johanmalm/tint

Fixes: #1572
2024-03-09 00:44:19 +01:00
Hiroaki Yamamoto
be37f9a564
Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
Consolatis
60aab98e8d Add optional headless fallback output
This allows configuring a headless fallback output that
is automatically created whenever there is no other output
around. It is destroyed when a new output is discovered.

It can be enabled by setting the environment variable
LABWC_FALLBACK_OUTPUT to the desired output name.

The feature benefits applications like wayvnc the most
as there is always an output available to connect to.

Co-Authored-By: Simon Long <simon@raspberrypi.com>
2024-03-08 13:54:13 +01:00
tokyo4j
e00f7cd6db view: validate move/resize request from clients
Move/resize requests from xwayland views and xdg toplevels should be
ignored when the view is not pressed.

This is relevant for touchpad taps with <tapAndDrag> disabled.

When the user taps the client surface (e.g. chromium and mpv) with the
setting above, libinput sends button press & release signals so quickly
that the compositor receives move/resize request from the client AFTER
the button release signal is processed, so `interactive_finish()` is
never called.
2024-03-07 20:30:50 +00:00
tokyo4j
f6d588507e style: prettify comments
Prettify comments formatted by clang-format at commit 77328698
2024-03-07 20:30:50 +00:00
Consolatis
95e8573388 src/output.c: refactor virtual output related functions
This commit moves the virtual output related functions
into their own file at `src/output-virtual.c` with its
own include file to reduce `include/labwc.h` bit by bit.

Additionally, it removes the need to keep the
`server->headless.pending_output_name` char array around
by temporarily disconnecting the handler when creating a
new virtual output. This allows to set the output name
right in the `output_virtual_add()` call rather than to
store the pending name until the new output event handler
has been called.

It also makes adding a virtual fallback output easier in
a follow-up PR.
2024-03-07 19:51:54 +00:00
Weblate
40ce95a68c Translation updates from weblate
Co-authored-by: Abdullah Albaroty <albaroty@gmail.com>
Co-authored-by: Standreas <standreas@riseup.net>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ar/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/de/
Translation: Labwc/labwc
2024-03-06 18:37:18 +00:00
Consolatis
1b9176c427 src/action.c: remove assumption about MoveToOutput direction being valid 2024-03-06 18:34:56 +00:00
Consolatis
983ca66d07 src/action.c: fix MoveToOutput action by renaming 'name' argument
We were using the argument name 'name' before
which is already used by the action itself:
`<action name="MoveToOutput" name="HDMI-A-1" />`

Change the argument name to "output" which also
matches the `FocusOutput` action.

Fixes: #1589
Reported-by: @bnason (thanks!)
2024-03-06 18:34:56 +00:00
Andrew J. Hesford
bcf2d7e091 docs/labwc.1: fix LABWC_PWD -> LABWC_PID typo 2024-03-05 17:51:10 -05:00
Johan Malm
4d68ee424a osd: show preview for windows on other workspaces
Written-by: @Consolatis
2024-03-05 22:16:55 +01:00
Johan Malm
72a41058af osd: only call wl_array_{init,relesase} once 2024-03-05 22:16:55 +01:00
Johan Malm
247d2b581c osd: optionally show windows on all workspaces
Also share common config option (rc.window_switcher.criteria) in osd.c and
desktop.c to make sure the window lists are always consistent.

Configure with `<windowSwitcher allWorkspaces="yes|no">`
2024-03-05 22:16:55 +01:00
Johan Malm
41419d9479 osd: do not use server->workspace_current->tree
...as it is no longer needed following the use of shared infrastructure
between osd.c and desktop.c introduced in the last few commits.
2024-03-05 22:16:55 +01:00
Johan Malm
7704b595d3 osd: restore preview at end of cycling
...so that sub-views are shown in front of root ones.
2024-03-05 22:16:55 +01:00
Johan Malm
79bca44cb1 window-rules: add root-toplevel critiera 2024-03-05 22:16:55 +01:00
Johan Malm
c71fccbcec osd: include always-on-top views in window-switcher 2024-03-05 22:16:55 +01:00
Johan Malm
777e6bb868 desktop: refactor desktop_cycle_view()
...in preparation for using common window-rule criteria with osd.c

No functional change intended.

Related-to #1454
2024-03-05 22:16:55 +01:00
John Lindgren
6a35e8e78c view: remove view_is_related(), no longer used 2024-03-05 20:51:32 +00:00
John Lindgren
bb8f0bc960 seat: don't deactivate view for any non-view surface
Now we now longer gray-out the active window when opening a focusable
popup menu (e.g. the applications menu from an XWayland panel). This
matches Openbox behavior.
2024-03-05 20:51:32 +00:00
John Lindgren
11cdad0c11 Revert "desktop: allow re-focus between "globally active" views of the same PID"
This is undesired when a focusable popup (e.g. applications menu) of an
unfocusable view (e.g. XWayland panel) is closed.

This reverts commit f6e3527767.
2024-03-05 20:51:32 +00:00
John Lindgren
4eb34f97de xwayland: remove "try to focus on parent surface" logic
This was apparently to fix an Intellij focus issue, but I don't see any
issues with Intellij currently, and the logic is wrong when the parent
XWayland surface doesn't want focus (e.g. an XWayland panel with a
focusable applications menu).
2024-03-05 20:51:32 +00:00
John Lindgren
9e3785f8cd xwayland: treat Globally Active windows according to type
Tested with IntelliJ IDEA and JDownloader 2, which were problematic in
the past.

Fixes: #1139 #1341
2024-03-05 20:51:32 +00:00
Simon Long
3ebc07f7aa
Handle touch on headerbar (#1550)
...using cursor emulate events.
2024-03-05 20:41:17 +00:00
tokyo4j
334cd09106 IME: support input method 2024-03-05 20:28:15 +00:00
Consolatis
7e60c57b81 src/server.c: filter out xwayland shell for usual clients 2024-03-04 21:35:40 +00:00
Consolatis
74501bc7fa src/output.c: restore flicker free resize when running nested
PR #1301 did partly revert the first variant because
`lab_wlr_scene_output_commit()` (which uses the `output->pending`
state in contrast to `wlr_scene_output_commit()`) was deemd to
cause 'frozen' frames during video playback (#1273).

We are now back at using `lab_wlr_scene_output_commit()` for
unrelated reasons and the cause of the original issue #1273 was
likely that `wlr_scene_output_send_frame_done()` was only sent
on a successful commit. This was changed to always be sent.

So lets restore the flicker free nested resize as well.
2024-03-04 21:24:17 +00:00
Standreas
f250c6ba12
Add weblate information (#1581)
...and some sub-headings
2024-03-04 21:20:08 +00:00
John Lindgren
c78750283f key-state: use struct assignment 2024-03-04 02:27:40 +01:00
Andrew J. Hesford
0af7bc886a docs/labwc.1: restructure, document session management 2024-03-04 01:57:32 +01:00
Andrew J. Hesford
c9d08f8218 session: only update activation environment...
...when running DRM backend or by explicit request
2024-03-04 01:57:32 +01:00
David F
22fe8cf546
session.c: updated dbus activation environment with more env vars
Fixes: #694
2024-03-03 18:47:58 +01:00
Andrew J. Hesford
f90b7dca2a session: run shutdown script, clean up activation env before exit 2024-03-02 21:30:03 -05:00