]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
22 months agoinput: notify idle manager when emulating cursor move
Jens Peters [Fri, 12 Apr 2024 21:21:39 +0000 (23:21 +0200)]
input: notify idle manager when emulating cursor move

Looks like we forgot that one earlier.

22 months agoosd: add window-switcher custom field (#1670)
droc12345 [Wed, 10 Apr 2024 22:39:31 +0000 (17:39 -0500)]
osd: add window-switcher custom field (#1670)

Add custom field with subset of printf style formatting
to replace the original field formats.

Example:

    <windowSwitcher preview="no" outlines="no" allWorkspaces="yes">
      <fields>
        <field content="custom" format="foobar %b %3s %-10o %-20W %-10i%t" width="100%" />
      </fields>
    </windowSwitcher>

Mono space font recommended. May need OSD width adjusted

Co-authored-by: @Consolatis (based on work done by them)
22 months agosnap: cache and ignore last-snapped edge when growing or shrinking
Andrew J. Hesford [Tue, 2 Apr 2024 19:58:50 +0000 (15:58 -0400)]
snap: cache and ignore last-snapped edge when growing or shrinking

When growing or shrinking a view by snapping to an edge, a client may
ignore the requested size and instead keep its original size or
substitute a different (possibly constrained) size. In this case, the
view may not actually contact the snapped edge, and a subsequent snap
attempt will just keep re-trying (and failing) to contact the same ege.

To mitigate this, remember the last-snapped view, snapping direction and
offset of the snapping edge in snap.c; when re-attempting a snap for the
same view in the same direction, ignore the edge that was last "hit", to
allow snapping to progress beyond the problematic edge.

22 months agoTranslation updates from weblate
Weblate [Mon, 8 Apr 2024 13:23:39 +0000 (15:23 +0200)]
Translation updates from weblate

Co-authored-by: Jouni Järvinen <jounijarvis@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fi/
Translation: Labwc/labwc

22 months agosrc/layer.c: deal with wlroots scene graph running out of memory
Consolatis [Mon, 8 Apr 2024 15:59:39 +0000 (17:59 +0200)]
src/layer.c: deal with wlroots scene graph running out of memory

This fixes an issue detected by the static analyzer.

Rather than setting up the new popup as usual return
a wayland error to the client and destroy the popup.

22 months agosrc/ssd/ssd_part.c: ensure button is found
Consolatis [Mon, 8 Apr 2024 15:56:56 +0000 (17:56 +0200)]
src/ssd/ssd_part.c: ensure button is found

This fixes an issue detected by the static analyzer.
It currently is not a real bug but it could become
one in the future if `add_toggled_icon()` is called
before `add_scene_button()`.

Rather than having `add_toggled_icon()` go through
the list, find the root button and then fetch its
node descriptor just supply the button as argument.

22 months agoCI: enable gcc static analyzer
Consolatis [Mon, 8 Apr 2024 15:32:16 +0000 (17:32 +0200)]
CI: enable gcc static analyzer

22 months agooutput: ensure we don't run into an assert() on VT switch
Consolatis [Mon, 8 Apr 2024 14:29:20 +0000 (16:29 +0200)]
output: ensure we don't run into an assert() on VT switch

Also reduce log spam from failed output commits that
can happen for various reasons outside of our control.

Fixes: #1667
23 months agosrc/theme.c: support inline alpha encoding like #aabbccff
Consolatis [Sun, 7 Apr 2024 15:25:40 +0000 (17:25 +0200)]
src/theme.c: support inline alpha encoding like #aabbccff

.. and mark the current `#rrggbb aaa` encoding as deprecated.

23 months agocommon/font: avoid rendering semi-transparent background twice
John Lindgren [Sun, 7 Apr 2024 07:26:16 +0000 (03:26 -0400)]
common/font: avoid rendering semi-transparent background twice

Fill with the background color first only if the background color is
opaque. This is necessary for subpixel rendering to work properly (it
does not work on top of transparency).

However, if the background color is not opaque, leave the buffer
unfilled (completely transparent) since the background is already
rendered by the scene element underneath. In this case we have to
disable subpixel rendering.

v2: use 0.999 alpha cutoff and fix CodeStyleCheck

Fixes: (the rest of) #1684
23 months agoosd: support percent values for window switcher width
Droc [Tue, 26 Mar 2024 10:12:19 +0000 (05:12 -0500)]
osd: support percent values for window switcher width

Add ability to set width with percentage of monitor instead of just pixels.
With this the OSD sizes itself properly on both my 4k and 2k monitors.

example: 50% or 75% instead of 600, max 100%

23 months agodocs: 80 column lines (where possible), drop trailing whitespace
Tomi Ollila [Sun, 31 Mar 2024 18:19:59 +0000 (21:19 +0300)]
docs: 80 column lines (where possible), drop trailing whitespace

with one typofix

23 months agoUse pre-multiplied colors by default
Consolatis [Sat, 6 Apr 2024 15:46:30 +0000 (17:46 +0200)]
Use pre-multiplied colors by default

wlr_scene_rects expect their color to be pre-multiplied
while cairo_set_source_rgba() expects them to not be
pre-multiplied. With this patch we now use premultiplied
colors internally by default and then reverse it when
setting cairo colors.

This ensures the titlebar uses a consistent color in case
it was defined with some transparency by the user.

Fixes: #1684
23 months agocursor: fix dnd bug
Johan Malm [Sat, 6 Apr 2024 20:46:17 +0000 (21:46 +0100)]
cursor: fix dnd bug

...where dnd does not finish properly on cursor-button-release if there
is no surface under the cursor such as on the desktop when no background
client is running.

Written-by: @tokyo4j
Fixes: #1673
23 months agocursor: send release event to CSD client before finishing window dragging
tokyo4j [Fri, 5 Apr 2024 09:01:06 +0000 (18:01 +0900)]
cursor: send release event to CSD client before finishing window dragging

This fixes that, when a CSD window is dragged into below waybar and the cursor
button is released, the cursor focus is moved from the CSD window to waybar and
a release event is sent to waybar, not original CSD window.

23 months agooverlay: add snap-to-edge overlay (PR #1652)
Hiroaki Yamamoto [Fri, 5 Apr 2024 02:35:31 +0000 (11:35 +0900)]
overlay: add snap-to-edge overlay (PR #1652)

...and unify region overlay and snap-to-edge overlay into overlay.c.

Snap-to-edge overlay is delayed for 500ms to prevent flickering when
the view is dragged from an output to another (demo in discussion labwc#1613).

This also fixes a bug that region overlay is not shown when a modifier
key is re-pressed.

23 months agoTranslation updates from weblate
Weblate [Wed, 27 Mar 2024 22:23:35 +0000 (23:23 +0100)]
Translation updates from weblate

Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Co-authored-by: Roberalz <lumintnian@outlook.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: rico542 <rico@alwaysdata.net>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/es/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/eu/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fr/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/gl/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt/
Translation: Labwc/labwc

23 months agocommon: validate and properly parse floats
Andrew J. Hesford [Thu, 28 Mar 2024 02:13:50 +0000 (22:13 -0400)]
common: validate and properly parse floats

Fixes: #1665.
23 months agocursor: validate double-click against SSD part type
Johan Malm [Mon, 25 Mar 2024 21:49:46 +0000 (21:49 +0000)]
cursor: validate double-click against SSD part type

...because click on different parts of a client should not be
interpreted as a double click.

Previously only cursor-button and view were validated to be the same
between clicks. This resulted in, for example a click on the client
surface itself quickly followed by a click on the SSD titlebar being
interpreted as a double-click on the titlebar.

Fixes: #1657
23 months agodocs: Refer to calibration matrix
Jens Peters [Tue, 26 Mar 2024 19:21:02 +0000 (20:21 +0100)]
docs: Refer to calibration matrix

23 months agolayer: try to set keyboard focus on map
Johan Malm [Sun, 24 Mar 2024 19:31:29 +0000 (19:31 +0000)]
layer: try to set keyboard focus on map

...for the following reasons:

1. We interpret 'normal input-focus semantics' for clients with on-demand
   keyboard interactivity to means that a surface receives input focus on
   cursor-button-press AND on map (the latter previously missing), just
   like a normal window would. In this regard, we do not differentiate
   between layers.

2. Most layer-surfaces set the keyboard interactivity at a similar time to
   their first (and normally only) map, so the absence of an explicit
   attempt to focus on map does not make a difference. However, for a
   long-running layer-shell client (such as lxqt-runner) which sets the
   interactivity on launch and then maps/unmaps many times throughout its
   lifetime, a specific focus-attempt is required on map to avoid the
   client itself having to keep resetting its interactivity to grab the
   keyboard on map.

3. Compositors like sway and river process focus (for clients with
   keyboard-interactivity)  in their map-handlers, so this makes for a
   common approach.

Fixes: #1653
23 months agomenu: support pipe menus
Johan Malm [Tue, 31 Oct 2023 21:36:45 +0000 (21:36 +0000)]
menu: support pipe menus

See labwc-menu(5) for usage.

Co-authored-by: @Consolatis
23 months agocommon/spawn.c: add spawn_piped()
Consolatis [Mon, 18 Mar 2024 05:15:15 +0000 (06:15 +0100)]
common/spawn.c: add spawn_piped()

23 months agomenu: move already-on-selected-item check
Johan Malm [Tue, 31 Oct 2023 21:21:20 +0000 (21:21 +0000)]
menu: move already-on-selected-item check

...menu_process_item_selection() as the previous variant did not work.

23 months agomenu: minor refactor of menu_configure()
Johan Malm [Tue, 31 Oct 2023 21:13:41 +0000 (21:13 +0000)]
menu: minor refactor of menu_configure()

23 months agomenu: s/menu_open/menu_open_root/
Johan Malm [Tue, 31 Oct 2023 21:08:04 +0000 (21:08 +0000)]
menu: s/menu_open/menu_open_root/

...to be consistent with the 'close' equivalent

23 months agolabwc-config(5): clarify applicability of element/attribute (#1655)
Johan Malm [Sun, 24 Mar 2024 21:32:27 +0000 (21:32 +0000)]
labwc-config(5): clarify applicability of element/attribute (#1655)

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
23 months agoCONTRIBUTING.md: add Gentoo overlay maintainer
Consolatis [Fri, 22 Mar 2024 20:54:11 +0000 (21:54 +0100)]
CONTRIBUTING.md: add Gentoo overlay maintainer

23 months agoNEWS.md: interim update
Johan Malm [Thu, 21 Mar 2024 21:36:17 +0000 (21:36 +0000)]
NEWS.md: interim update

23 months agorcxml: add missing check for calibrationMatrix
SnowNF [Thu, 21 Mar 2024 08:46:44 +0000 (16:46 +0800)]
rcxml: add missing check for calibrationMatrix

23 months agorcxml: improve parse calibrationMatrix
SnowNF [Wed, 20 Mar 2024 08:19:49 +0000 (16:19 +0800)]
rcxml: improve parse calibrationMatrix

23 months agodocs: fix format in calibrationMatrix section
SnowNF [Wed, 20 Mar 2024 05:09:21 +0000 (13:09 +0800)]
docs: fix format in calibrationMatrix section

23 months agodocs: fix scdoc build
SnowNF [Wed, 20 Mar 2024 04:51:54 +0000 (12:51 +0800)]
docs: fix scdoc build

23 months agodocs: add calibrationMatrix section for libinput
SnowNF [Wed, 20 Mar 2024 04:17:21 +0000 (12:17 +0800)]
docs: add calibrationMatrix section for libinput

23 months agoOptimize the code based on the suggestions
SnowNF [Wed, 20 Mar 2024 03:31:42 +0000 (11:31 +0800)]
Optimize the code based on the suggestions

23 months agolibinput: add support for touchscreen set matrix
SnowNF [Tue, 19 Mar 2024 19:32:41 +0000 (03:32 +0800)]
libinput: add support for touchscreen set matrix

My android pad emit a strange touch input from libinput, need to rotate it in 270 degree clockwise to fix.

23 months agoworkspaces.c: fix bug with RTL locales, closes #1633
01micko [Mon, 18 Mar 2024 10:58:18 +0000 (20:58 +1000)]
workspaces.c: fix bug with RTL locales, closes #1633

23 months agosrc/xdg-popup.c: unconstrain popup within usable area
tokyo4j [Wed, 13 Mar 2024 11:01:16 +0000 (20:01 +0900)]
src/xdg-popup.c: unconstrain popup within usable area

23 months agoxwayland: fix segv bug when starting game
Johan Malm [Sun, 17 Mar 2024 21:06:46 +0000 (21:06 +0000)]
xwayland: fix segv bug when starting game

...for example `Fall Guys`. It is believed to be caused by setting
override-redirect on an xwayland-surface with a child window, thus
breaking the way root-toplevels are obtained.

```
    (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at pthread_kill.c:44
    at pthread_kill.c:78
    (fmt=0x7739d9f9bb68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5a76573f9222 "root", file=file@entry=0x5a76573f9606 "../labwc/src/view.c", line=line@entry=2013, function=function@entry=0x5a7657400320 <__PRETTY_FUNCTION__.14> "view_move_to_front") at assert.c:94
    (assertion=assertion@entry=0x5a76573f9222 "root", file=file@entry=0x5a76573f9606 "../labwc/src/view.c", line=line@entry=2013, function=function@entry=0x5a7657400320 <__PRETTY_FUNCTION__.14> "view_move_to_front") at assert.c:103
    at ../labwc/src/view.c:2013
    at ../labwc/src/view-impl-common.c:30
    at ../labwc/src/xwayland.c:677
    at ../wayland-1.22.0/src/wayland-server.c:2241
    (signal=signal@entry=0x5a7659025160, data=data@entry=0x5a7659024e90)
    at ../wayland-1.22.0/src/wayland-server.c:2241
    at ../subprojects/wlroots/types/wlr_compositor.c:493
    (cif=cif@entry=0x7ffc74d32530, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
    (cif=cif@entry=0x7ffc74d32530, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7ffc74d32600) at ../src/x86/ffi64.c:710
    (closure=closure@entry=0x5a7658f5adc0, target=<optimized out>,
    target@entry=0x5a7659025240, opcode=opcode@entry=6, data=<optimized out>,
    data@entry=0x5a7658609820, flags=2) at ../wayland-1.22.0/src/connection.c:1025
    (fd=<optimized out>, mask=<optimized out>, data=<optimized out>)
    at ../wayland-1.22.0/src/wayland-server.c:438
    (loop=0x5a7657816e60, timeout=timeout@entry=-1)
    at ../wayland-1.22.0/src/event-loop.c:1027
    at ../wayland-1.22.0/src/wayland-server.c:1493
    at ../labwc/src/main.c:179
```

Reported-by: @kode54
23 months agolayer: do not focus on-demand clients in commit-handler
Johan Malm [Sat, 16 Mar 2024 20:58:00 +0000 (20:58 +0000)]
layer: do not focus on-demand clients in commit-handler

...because we should only try to focus them as part of normal input
handling semantics, for example when receiving a cursor-button-press.

23 months agolayer: do not change keyboard-focus in map-handler
Johan Malm [Sat, 9 Mar 2024 15:04:44 +0000 (15:04 +0000)]
layer: do not change keyboard-focus in map-handler

If a client wants keyboard-interactivity this will be processed in the
commit handler.

Remove duplicate (and incorrect) requrests for focus.

23 months agolayer: change focus better on 'none' keyboard-interactivity request
Johan Malm [Sat, 9 Mar 2024 15:03:26 +0000 (15:03 +0000)]
layer: change focus better on 'none' keyboard-interactivity request

...and on unmap.

Add `try_to_focus_next_layer_or_toplevel()` which does the following
(in order of precedence):

- Give focus to last added overlay/top layer-shell client with exclusive
  interactivity on the output nearest the pointer (normally the one where
  the users is currently working). The reason for not considering clients
  on all outputs is that giving focus to a client on another output may be
  confusing to the user.

- Give focus to topmost toplevel if one exists (this was done previously
  anyway).

23 months agocursor: use layer_try_set_focus() on press
Johan Malm [Sat, 9 Mar 2024 10:48:52 +0000 (10:48 +0000)]
cursor: use layer_try_set_focus() on press

This means that the logic described in 2ff026b will be used when a
layer-surface is pressed on with a cursor button. For example, a surface
with on-demand keyboard interactivity will not steal focus from a client
with exclusive keyboard interactivity.

23 months agoseat: remove unecessary top/overlay check in seat_set_focus_layer()
Johan Malm [Sat, 9 Mar 2024 10:33:34 +0000 (10:33 +0000)]
seat: remove unecessary top/overlay check in seat_set_focus_layer()

Such checks should be made prior to calling the function (which they
are).

23 months agolayer: change logic for giving keyboard-interactivity
Johan Malm [Sat, 9 Mar 2024 10:31:47 +0000 (10:31 +0000)]
layer: change logic for giving keyboard-interactivity

Use the following logic:
 - Exclusive: Grant regardless of layer (previously it was only given if
   in top or overlay layers) AND grant if in the same or higher layer
   (nearer overlay) compared with other clients with exclusive
   interactivity.
 - On-demand: Grant only if no other layer-shell client has exclusive
   keyboard interactivity. Previously it was treated the same as
   exclusive.
 - None: Unset focus if the commit associated with the 'none' came from
   the currently focused layer. Previously it was just unset regardless.

23 months agoxwayland: exclude unfocusable views from wlr-foreign-toplevel
John Lindgren [Sun, 17 Mar 2024 20:16:24 +0000 (16:16 -0400)]
xwayland: exclude unfocusable views from wlr-foreign-toplevel

These views (notifications, floating toolbars, etc.) should not be
shown in taskbars/docks/etc. (which are the stated use-case of the
wlr-foreign-toplevel protocol).

23 months agocommon: render text buffers with opaque background
John Lindgren [Sun, 17 Mar 2024 02:20:40 +0000 (22:20 -0400)]
common: render text buffers with opaque background

After a roundabout discussion[1] with wlroots devs, it's become apparent
that subpixel text rendering (a.k.a. "ClearType") does not work properly
when rendering over a transparent background, as labwc currently does.

Basically it comes down to the fact that the color of semi-transparent
pixels (which is adjusted redder or bluer to compensate for RGB subpixel
alignment) depends somewhat on background color. When rendering over
transparency, the text engine doesn't know the intended background color
and can't adjust the pixel colors correctly.

With Pango/Cairo, the end result can range from grayscale rendering (no
subpixel rendering at all) to wrong/oversaturated colors (for example,
bright pink pixels when rendering white text on blue background).

This change solves the issue by first filling the text buffer with an
opaque background color before rendering the text over it. Currently,
this is easy since the background is always a solid color. It may be a
little more complex (but doable) if we implement gradients in future.

Note that GTK 4 (and to some degree, recent versions of Microsoft
Windows) avoid this issue by disabling subpixel rendering altogether. I
would much prefer that labwc NOT do this -- it results in noticeably
blurrier text on non-retina LCD screens, which are still common.

[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3822

23 months agoNLS: translate "Workspaces" in rcxml.c
M A [Sun, 17 Mar 2024 05:23:41 +0000 (15:23 +1000)]
NLS: translate "Workspaces" in rcxml.c

Fixes: #1630
23 months agoCI: ensure Void has a font installed
Consolatis [Sat, 16 Mar 2024 17:16:44 +0000 (18:16 +0100)]
CI: ensure Void has a font installed

Otherwise the runtime test randomly fails due to
strange pango behavior. This is a workaround for
the issue and not a permanent fix.

A full investigation into pango internals is required
to figure out why `pango_layout_get_extents()` returns
invalid data after the first call. See PR #1627 for a
testcase.

23 months agoCI: rewrite smoke test and support LABWC_RUNS env var
Consolatis [Sat, 16 Mar 2024 17:02:01 +0000 (18:02 +0100)]
CI: rewrite smoke test and support LABWC_RUNS env var

23 months agosrc/common/buf.c: enhance the buffer API
Consolatis [Sat, 16 Mar 2024 03:39:45 +0000 (04:39 +0100)]
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.

23 months agoosd: add window-switcher field content types (#1623)
droc12345 [Sat, 16 Mar 2024 15:28:37 +0000 (10:28 -0500)]
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>

23 months agoTranslation updates from weblate
Weblate [Fri, 15 Mar 2024 16:23:30 +0000 (17:23 +0100)]
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

23 months agoTranslation updates from weblate
Weblate [Tue, 12 Mar 2024 21:48:48 +0000 (22:48 +0100)]
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

23 months agoIME: support IME popup
tokyo4j [Thu, 22 Feb 2024 18:50:55 +0000 (03:50 +0900)]
IME: support IME popup

23 months agoCI: add simple runtime test
Consolatis [Wed, 13 Mar 2024 14:26:16 +0000 (15:26 +0100)]
CI: add simple runtime test

23 months agoaction: allow client-menu to open at mouse cursor
Andrew J. Hesford [Sun, 10 Mar 2024 18:28:41 +0000 (14:28 -0400)]
action: allow client-menu to open at mouse cursor

23 months agosession: Don't close a null dir in read_environment_dir
Scarcely There [Wed, 13 Mar 2024 05:22:49 +0000 (00:22 -0500)]
session: Don't close a null dir in read_environment_dir

Closes: #1615 [via git-merge-pr]
23 months agosession: abort process_line early if line contains no key
Andrew J. Hesford [Wed, 13 Mar 2024 10:14:55 +0000 (06:14 -0400)]
session: abort process_line early if line contains no key

23 months agokeyboard: use 'us' as fallback for XKB_DEFAULT_LAYOUT
Johan Malm [Mon, 11 Mar 2024 22:04:52 +0000 (22:04 +0000)]
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
23 months agoReload cursor theme and size on reconfigure
Simon Long [Tue, 12 Mar 2024 19:53:41 +0000 (19:53 +0000)]
Reload cursor theme and size on reconfigure

Fixes: #1587
23 months agodocs/labwc-config.5: fix "environment directory" typo
Andrew J. Hesford [Tue, 12 Mar 2024 11:35:42 +0000 (07:35 -0400)]
docs/labwc-config.5: fix "environment directory" typo

23 months agoworkspaces: add ability to set prefix when using number argument
droc12345 [Mon, 11 Mar 2024 22:19:03 +0000 (17:19 -0500)]
workspaces: add ability to set prefix when using number argument

23 months agosession: process environment.d and allow empty variables
Andrew J. Hesford [Sat, 9 Mar 2024 17:03:30 +0000 (12:03 -0500)]
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.

23 months agodocs/labwc-config.5.scd: fix typo
Standreas [Mon, 11 Mar 2024 07:17:52 +0000 (08:17 +0100)]
docs/labwc-config.5.scd: fix typo

23 months agoREADME.md: add alt-space binding
Jens Peters [Sun, 10 Mar 2024 18:38:33 +0000 (19:38 +0100)]
README.md: add alt-space binding

That one was missing in the default bindings.

2 years agocursor: process layer subsurfaces in `cursor_button_press()`
Johan Malm [Thu, 7 Mar 2024 19:15:02 +0000 (19:15 +0000)]
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:
- https://github.com/labwc/labwc/commit/bb8f0bc960dca192b8579d67297c0586ec20bfe0
- https://github.com/labwc/labwc/blob/40ce95a68cf19796dd67b0527fddfdbe46181805/src/seat.c#L481-L483
- https://github.com/labwc/labwc/blob/40ce95a68cf19796dd67b0527fddfdbe46181805/src/dnd.c#L24
- https://github.com/johanmalm/tint

Fixes: #1572
2 years agoFix various typos across the codebase
Hiroaki Yamamoto [Fri, 8 Mar 2024 12:59:20 +0000 (21:59 +0900)]
Fix various typos across the codebase

2 years agoAdd optional headless fallback output
Consolatis [Thu, 7 Mar 2024 01:11:46 +0000 (02:11 +0100)]
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>
2 years agoview: validate move/resize request from clients
tokyo4j [Thu, 7 Mar 2024 15:53:39 +0000 (00:53 +0900)]
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.

2 years agostyle: prettify comments
tokyo4j [Thu, 7 Mar 2024 15:45:04 +0000 (00:45 +0900)]
style: prettify comments

Prettify comments formatted by clang-format at commit 77328698

2 years agosrc/output.c: refactor virtual output related functions
Consolatis [Wed, 6 Mar 2024 23:22:51 +0000 (00:22 +0100)]
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.

2 years agoTranslation updates from weblate
Weblate [Wed, 6 Mar 2024 09:23:27 +0000 (10:23 +0100)]
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

2 years agosrc/action.c: remove assumption about MoveToOutput direction being valid
Consolatis [Wed, 6 Mar 2024 03:46:40 +0000 (04:46 +0100)]
src/action.c: remove assumption about MoveToOutput direction being valid

2 years agosrc/action.c: fix MoveToOutput action by renaming 'name' argument
Consolatis [Wed, 6 Mar 2024 03:30:17 +0000 (04:30 +0100)]
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!)
2 years agodocs/labwc.1: fix LABWC_PWD -> LABWC_PID typo
Andrew J. Hesford [Tue, 5 Mar 2024 22:50:53 +0000 (17:50 -0500)]
docs/labwc.1: fix LABWC_PWD -> LABWC_PID typo

2 years agoosd: show preview for windows on other workspaces
Johan Malm [Tue, 5 Mar 2024 21:01:39 +0000 (21:01 +0000)]
osd: show preview for windows on other workspaces

Written-by: @Consolatis
2 years agoosd: only call wl_array_{init,relesase} once
Johan Malm [Mon, 4 Mar 2024 20:30:31 +0000 (20:30 +0000)]
osd: only call wl_array_{init,relesase} once

2 years agoosd: optionally show windows on all workspaces
Johan Malm [Sun, 3 Mar 2024 20:03:32 +0000 (20:03 +0000)]
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">`

2 years agoosd: do not use server->workspace_current->tree
Johan Malm [Sun, 3 Mar 2024 19:51:15 +0000 (19:51 +0000)]
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.

2 years agoosd: restore preview at end of cycling
Johan Malm [Tue, 30 Jan 2024 18:06:21 +0000 (18:06 +0000)]
osd: restore preview at end of cycling

...so that sub-views are shown in front of root ones.

2 years agowindow-rules: add root-toplevel critiera
Johan Malm [Tue, 30 Jan 2024 18:04:43 +0000 (18:04 +0000)]
window-rules: add root-toplevel critiera

2 years agoosd: include always-on-top views in window-switcher
Johan Malm [Thu, 25 Jan 2024 19:54:59 +0000 (19:54 +0000)]
osd: include always-on-top views in window-switcher

2 years agodesktop: refactor desktop_cycle_view()
Johan Malm [Thu, 25 Jan 2024 19:52:54 +0000 (19:52 +0000)]
desktop: refactor desktop_cycle_view()

...in preparation for using common window-rule criteria with osd.c

No functional change intended.

Related-to #1454

2 years agoview: remove view_is_related(), no longer used
John Lindgren [Wed, 14 Feb 2024 08:13:12 +0000 (03:13 -0500)]
view: remove view_is_related(), no longer used

2 years agoseat: don't deactivate view for any non-view surface
John Lindgren [Wed, 14 Feb 2024 08:11:32 +0000 (03:11 -0500)]
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.

2 years agoRevert "desktop: allow re-focus between "globally active" views of the same PID"
John Lindgren [Wed, 14 Feb 2024 03:35:56 +0000 (22:35 -0500)]
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 f6e3527767fffe81fa05073ae73893bb89a45d4f.

2 years agoxwayland: remove "try to focus on parent surface" logic
John Lindgren [Wed, 14 Feb 2024 03:32:14 +0000 (22:32 -0500)]
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).

2 years agoxwayland: treat Globally Active windows according to type
John Lindgren [Thu, 15 Feb 2024 02:11:03 +0000 (21:11 -0500)]
xwayland: treat Globally Active windows according to type

Tested with IntelliJ IDEA and JDownloader 2, which were problematic in
the past.

Fixes: #1139 #1341
2 years agoHandle touch on headerbar (#1550)
Simon Long [Tue, 5 Mar 2024 20:41:17 +0000 (20:41 +0000)]
Handle touch on headerbar (#1550)

...using cursor emulate events.

2 years agoIME: support input method
tokyo4j [Fri, 9 Feb 2024 07:52:37 +0000 (16:52 +0900)]
IME: support input method

2 years agosrc/server.c: filter out xwayland shell for usual clients
Consolatis [Sun, 25 Feb 2024 23:54:57 +0000 (00:54 +0100)]
src/server.c: filter out xwayland shell for usual clients

2 years agosrc/output.c: restore flicker free resize when running nested
Consolatis [Tue, 27 Feb 2024 22:25:45 +0000 (23:25 +0100)]
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.

2 years agoAdd weblate information (#1581)
Standreas [Mon, 4 Mar 2024 21:20:08 +0000 (22:20 +0100)]
Add weblate information (#1581)

...and some sub-headings

2 years agokey-state: use struct assignment
John Lindgren [Sat, 11 Nov 2023 04:44:41 +0000 (23:44 -0500)]
key-state: use struct assignment

2 years agodocs/labwc.1: restructure, document session management
Andrew J. Hesford [Mon, 4 Mar 2024 00:33:10 +0000 (19:33 -0500)]
docs/labwc.1: restructure, document session management

2 years agosession: only update activation environment...
Andrew J. Hesford [Sun, 3 Mar 2024 20:04:24 +0000 (15:04 -0500)]
session: only update activation environment...

...when running DRM backend or by explicit request

2 years agosession.c: updated dbus activation environment with more env vars
David F [Sun, 3 Mar 2024 17:47:58 +0000 (18:47 +0100)]
session.c: updated dbus activation environment with more env vars

Fixes: #694
2 years agosession: run shutdown script, clean up activation env before exit
Andrew J. Hesford [Sun, 18 Feb 2024 17:23:14 +0000 (12:23 -0500)]
session: run shutdown script, clean up activation env before exit

2 years agoaction: reduce MoveToOutput logging
Johan Malm [Sat, 2 Mar 2024 19:40:33 +0000 (19:40 +0000)]
action: reduce MoveToOutput logging