Commit graph

2895 commits

Author SHA1 Message Date
Johan Malm
8863672b1f labwc-config(5): describe how keys are processed
...when matching against keybinds.

Copied from:

63dc609085/src/input/keyboard.c (L215-L238)
2024-12-16 20:56:45 +00:00
Consolatis
63dc609085 cosmic-workspaces: abstract transaction-addon
This allows to use it for a future ext-workspace implementation.
It is also more generalized so can be used for other protocol
implementation in the future in case the protocols require some
kind of transaction management.
2024-12-15 21:06:39 +00:00
Weblate
afe416f04e Translation updates from weblate
Co-authored-by: vTT <vttfreebsd@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fr/
Translation: Labwc/labwc
2024-12-15 21:04:19 +00:00
Johan Malm
85118e0af0 README.md: add "lightweight and box-inspired" 2024-12-15 20:56:43 +00:00
tokyo4j
40c7350064 menu: improve algorithm for menu placement with xdg-positioner
This commit delegates the calculation for menu position into wlroots
utilities for xdg_positioner.

Notable functional changes are:
- Slide the menu to fit in the output when it's opened out of the output
  (e.g. top-left window menu is opened when the window is overflowing to
  the left), rather than not updating the menu at all.
- The horizontal alignment of menus is now determined based on the size of
  each (sub)menu alone rather than the total width of entire menu tree.
  This means submenus can now overlap with is parents, but this is no
  longer a problem since we recently added support for menu borders.
- Fixed that pipemenus always follow the alignment of its parent even when
  it overflows from the output.
2024-12-15 11:43:23 +09:00
Johan Malm
08de4f3d6b labwc-actions(5): add missing position option to ShowMenu 2024-12-15 01:07:24 +01:00
Johan Malm
71bf564a66 README.md: add gammastep 2024-12-15 01:02:25 +01:00
Orfeas
f4c270c92f query: extend "monitor" query & add missing docs 2024-12-14 20:28:16 +00:00
tokyo4j
01032ef3bd font: remove arrow character from font buffer
Arrow signs are specific to submenu items, so they would be more natural
to be handled in menu.c rather than accepting "arrow" in
font_buffer_create().

Also I allowed non-positive numbers for max_width in font_buffer_create(),
in which case the natural font width is used as the buffer width.
2024-12-14 20:09:53 +00:00
tokyo4j
10fc656c23 menu: some refactor
- Don't store font/background buffers in menuitem struct since we no
  longer dynamically update buffers of existing menuitems.
- Factor out the duplicated codes for creating menu item scenes for each
  unselected/selected states.
2024-12-14 20:09:53 +00:00
Consolatis
f5d706bae3 CONTRIBUTING.md: update package maintainer list 2024-12-14 07:18:21 +00:00
tokyo4j
daae379433 view: s/scene_node/content_node/ 2024-12-14 12:03:58 +09:00
Johan Malm
c3a1a59a58 build: bump version to 0.8.2 2024-12-13 19:14:37 +00:00
Johan Malm
72fe7a9742 NEWS.md: update for 0.8.2 2024-12-13 19:10:34 +00:00
Johan Malm
2dd31b0a3a docs/environment: remove example MOZ_ENABLE_WAYLAND=1
...because it has not been relevant since before firefox v121 and even
firefox-esr on Debian bullseye is now at v128.

Suggested-by: cry0xen
2024-12-12 20:13:10 +00:00
Andrew J. Hesford
df6081b52c config: only default to xwayland persistence on old wlroots versions
This is a compile-time check, so it will be too conservative if somebody
updates wlroots after building labwc, but that is still better than the
alternatives.
2024-12-12 02:20:33 +01:00
Consolatis
ea58ab0259 scripts: add wl_compcheck.py
Simple utility to allow protocol and version comparison between different
running compositors. This can be used to detect missing protocols or
versions in labwc. See for example this result when running against the
current labwc master and sway 1.10 (nested, results on DRM may differ):

  Protocols missing from labwc @ wayland-0
  ext_transient_seat_manager_v1                   1
  wl_compositor                                   6  (has version 5)
  wp_alpha_modifier_v1                            1
  wp_content_type_manager_v1                      1
  xdg_wm_base                                     5  (has version 3)
  zwp_keyboard_shortcuts_inhibit_manager_v1       1

  Protocols missing from sway @ wayland-1
  wl_drm                                          2
  zcosmic_workspace_manager_v1                    1
2024-12-10 21:05:31 +00:00
Weblate
72b4be45c9 Translation updates from weblate
Co-authored-by: 이정희 <daemul72@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ko/
Translation: Labwc/labwc
2024-12-10 21:04:06 +00:00
Johan Malm
2d312cd28b config: temporarily set xwaylandPersistence to 'yes' by default (#2414)
...to avoid a bug that is present in wlroots <0.18.2 and which has the
potential to crash the compositor when performing a drag-and-drop action
at the same time as the XWayland server is shutting down.

This will be reverted when wlroots-0.18.2 can be linked with.

Related-to: #2371
2024-12-08 21:18:38 +00:00
Johan Malm
2348a5a87b labwc-config(5): add <xwaylandPersistence> to "core" section example 2024-12-08 21:18:38 +00:00
Weblate
9de8636942 Translation updates from weblate
Co-authored-by: unabomberlive <7alinchik@mail.ru>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ru/
Translation: Labwc/labwc
2024-12-08 21:06:04 +00:00
Johan Malm
8bad1d906c labwc-config(5): reflow some paragraphs to stay within 80 columns 2024-12-08 20:03:11 +01:00
Johan Malm
0b357a3bd4 labwc-config(5): add XML examples at start of some sections 2024-12-08 20:03:11 +01:00
Johan Malm
79232a61c1 config/rcxml.c: fix crash in <touch> section
...when options are specified as elements leading to hitting the assert()
in xstrdup().

Reproduce by using this rc.xml:

```
<?xml version="1.0"?>
<labwc_config>
  <touch>
    <deviceName>foo</deviceName>
    <mapToOutput>bar</mapToOutput>
  </touch>
</labwc_config>
```

It is likely that <touch> was only tested with options as attributes.
2024-12-08 20:01:01 +01:00
tokyo4j
5e422a0bc2 action: fix menu position with "x"/"y" arguments in multi-monitor setup
Prior to this commit, output-relative coordinate was passed to
menu_open_root() as the menu position when it's designated via "x"/"y"
arguments in ShowMenu action, so menu can be misplaced to the output other
than the one in which the cursor is in.
2024-12-08 17:00:03 +00:00
tokyo4j
21bd5b0025 Revert "menu: slightly slide menus opened from buttons"
With 2ade6a1, negative x-values can be passed to menu_configure() when the
window menu is opened from top-left button in a maximized window, but
wlr_output_layout_output_at() couldn't find the output for the coordinate
since it's out of the output layout, thus it just opened the menu without
updating its position.

As the next release is close and the visual improvement by 2ade6a1 is not
very impactful for UX, let's revert it for now.
2024-12-08 16:55:16 +09:00
tokyo4j
2ade6a1e85 menu: slightly slide menus opened from buttons
This commit slides menus opened from buttons (with atCursor="no") to the
left by menu.border.width. This makes the location of the window menu
look more natural, especially when it's opened from the window icon in
the left corner of the titlebar.
2024-12-06 05:56:26 +00:00
Consolatis
64bb57afa2
Add support for xdg-foreign-v1 and xdg-foreign-v2 (#2400) 2024-12-03 20:23:57 +00:00
Consolatis
f1e43762e0 server.c: block privileged protocols for sandboxed clients
In the longer term we want this to be user-configurable (and also depend
on the sandbox engine, app_id and instance).

But dropping privileged protocols for sandboxed clients in the meantime
seems like a sensible thing to do and matches user expectations.

Related: #2392
2024-12-03 19:32:22 +00:00
Johan Malm
9a9eaee5a1
NEWS.md: interim update 2024-12-01 21:04:23 +01:00
Johan Malm
8e3d5784a3 docs: simplify description of shell wildcard patterns
...to align with glob(7) language

Reported-by: @vyivel
2024-12-01 20:17:04 +01:00
tokyo4j
5847508eb2 ssd: fix pixman error when SSD is created for tiny windows
set_squared_corners(false) was always called when titlebar is created.
However, set_squared_corners(false) sets the width of the titlebar
background buffer to (view width) - (corner radius), which causes pixman
errors due to the negative width set for titlebar background buffer when
the view is so small.
2024-12-01 19:11:14 +00:00
Consolatis
23582c814e CI: disable clang for Debian until they get wayland 1.23.1 2024-12-01 19:53:53 +01:00
tokyo4j
83c583c668 scaled-rect-buffer: add missing cairo_surface_flush() 2024-11-28 18:56:03 +09:00
tokyo4j
4502d58eec buffer: remove buffer->cairo
It's more common for cairo_t to have a temporary lifetime and it will
prevent accidentally reusing its previous state.
2024-11-28 18:56:03 +09:00
tokyo4j
c48324975d buffer: always set buffer->{cairo,surface} for simplification 2024-11-28 18:56:03 +09:00
Johan Malm
d2a864dfe7 Add lsan.supp
...so suppress errors from ASAN with EGL renderer.

Also add a script to simplify running with sanitizer and this suppression
file.

Related-to: #2331
2024-11-26 21:29:09 +00:00
Johan Malm
2f8afb2376
keyboard: add window rule to send release-events (#2377)
...of modifiers which are part of keybinds. This supports clients (for
example blender) that want to see modifier-release-events even if they are
part of a keybinds.

Most clients (including those using Qt and GTK) are setup to not see these
modifier release events and actually misbehave if they do.  For example
Firefox shows the menu bar if alt is pressed and then released, whereas if
only pressed (because the release is absorbed) nothing happens. So, if
Firefox saw bound modifier-release-events it would show the menu bar every
time the window-switcher is used with alt-tab.

    <windowRules>
      <windowRule identifier="blender" wantAbsorbedModifierReleaseEvents="yes"/>
    </windowRules>

Issue #1507
2024-11-26 20:02:36 +00:00
Consolatis
665b39259a CI: make the smoke test start foot 2024-11-26 06:12:46 +01:00
Consolatis
b0fb81c77b CI: switch runtime tests to Arch to reduce total runtime 2024-11-26 06:12:46 +01:00
Consolatis
af3054394e CI: add address sanitizer to Debian runtime tests 2024-11-26 06:12:46 +01:00
Consolatis
918e64bb0b CI: re-enable Debian build job 2024-11-26 06:12:46 +01:00
Consolatis
6b5ca781db CI: move comment to the right place 2024-11-26 06:12:46 +01:00
Consolatis
9989efe0f4 CI: reduce job timeout to 10 minutes
Since GitHub runners now support hardware virtualization,
the maximal runtime of the FreeBSD runner is somewhere
around 3 to 6 minutes. It may still fail sometimes so
keep the timeout parameter around.
2024-11-26 06:12:46 +01:00
tokyo4j
a590795f7a graphic-helpers: fix segfault when medium-size icon file is loaded
lab_data_buffer->logical_{width,height} are not the actual size of the
backing buffer, so wlr_buffer.{width,height} should be used when
duplicating it in get_cairo_surface_from_lab_data_buffer().

This mistake caused segfault when an icon file 1~2 times larger than
window.button.{width,height} is loaded, because the buffer for the raw
icon file is reused by setting lab_data_buffer->logical_{width,height}
with the size for display which is different from
wlr_buffer.{width,height} (see buffer_convert_cairo_surface_for_icon()),
and it is duplicated with get_cairo_surface_from_lab_data_buffer() for
hovered/rounded variants of titlebar button.
2024-11-26 03:29:25 +01:00
tokyo4j
6b7157f046 menu: don't include menu.border.width for menu title height
It was a cruft from my experiment of adding borders around titles.

It even caused an integer overflow because theme->menu_border_width can be
INT_MIN when menu_header_height is calculated.
2024-11-26 10:05:40 +09:00
tokyo4j
45646c694f menu: invert the y-offset of submenus applied by menu.overlap.y
This follows Openbox's behavior.
2024-11-25 21:19:59 +00:00
tokyo4j
d70040c750 menu: overlap submenus by menu.border.width
This follows Openbox's behavior that aligns the first item of a submenu
with its parent item
2024-11-25 19:41:07 +00:00
tokyo4j
da418f9720 menu: support borders
This commit adds following theme configurations:

  menu.border.width: 1
  menu.border.color: #aaaaaa
2024-11-25 19:41:07 +00:00
tokyo4j
fb6bf3fdde theme: set default values of window.*.border.color to #aaaaaa
This makes the colors of titlebar and window borders different, but will
let menu.border.color (which will be supported soon) inherit
window.active.border.color just like Openbox does, without making the menu
borders around a selected menu item invisible.
2024-11-25 19:41:07 +00:00