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.
...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
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.
...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/tintFixes: #1572
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>
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.
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.
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!)
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">`
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.
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.
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).
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.