Commit graph

2659 commits

Author SHA1 Message Date
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
tokyo4j
12cae9c7ee Add scaled_rect_buffer
scaled_rect_buffer is an implementation of scaled_scene_buffer and shows
an auto-scaling bordered rectangle. This is intended for menu borders,
but can be also useful for other elements like window switcher items.

We will support rounded corners for scaled_rect_buffer in the future.
2024-11-25 19:41:07 +00:00
Consolatis
763ba6209e workspaces: use view_for_each_reverse() to move omnipresent views
This ensures that the view ordering and focus behavior of
omnipresent views is the same when switching workspaces.
2024-11-25 19:21:43 +00:00
Consolatis
e274c588c0 view: add view_for_each_reverse() macro 2024-11-25 19:21:43 +00:00
John Lindgren
da1f28f3dd output: fix assert() fail when enabling an output that was disabled
When the output is in the process of being enabled, but the new state
has not been committed yet, wlr_output->enabled is still false. So it's
not safe to assert that it's true in output_enable_adaptive_sync().

Fixes: 36e099fc93
"view: ensure output is usable before setting adaptive sync"
2024-11-23 17:47:08 +01:00
tokyo4j
296b28d008 docs: describe some default values 2024-11-23 11:16:34 +00:00
tokyo4j
794452ca29 docs: align format for describing default values 2024-11-23 11:16:34 +00:00
tokyo4j
c2928027be scaled-font-buffer: apply buffer sharing mechanism
scaled_font_buffer.{width,height} are no longer set in _create_buffer()
since that function is not called when the buffer is reused from the
cache.
2024-11-21 20:31:41 +00:00
tokyo4j
c893878aca scaled-scene-buffer: implement buffer sharing mechanism
Implementers can define impl->equal() which compares two
scaled-scene-buffers so that buffers are not allocated for visually
duplicated scaled-scene-buffers.

Currently this mechanism isn't applied for scaled-font-buffers since we
haven't defined impl->equal() for it.
2024-11-21 20:31:41 +00:00
tokyo4j
f071431266 common/list: add WL_LIST_INIT() macro 2024-11-21 20:31:41 +00:00
Consolatis
71b4277852 scaled-scene-buffer: allow multiple wlr_buffer_drops()
This allows implementations of the interface to share a single
wlr_buffer for multiple wlr_scene_buffer nodes and still make
the scaled-scene-buffer handle the buffer drops.

wlr_scene_buffer holds an implicit lock while using a wlr_buffer
and scaled-scene-buffer.c holds additional locks for as long as
a buffer is within its internal cache.

This should ensure that a shared wlr_buffer never gets actually
dropped even if wlr_buffer_drop() has been called by another
scaled-scene-buffer instance using the same wlr_buffer.
2024-11-21 20:31:41 +00:00
Jens Peters
2df6628490 NEWS.md: fix author 2024-11-20 20:46:18 +00:00
Johan Malm
cfc92f43db
Merge pull request #2360 from jp7677/sfdo-app-name
feat: add libsfdo desktop entry name as OSD element
2024-11-19 21:49:56 +00:00
Jens Peters
7b5c76d573
osd: add desktop entry name option
Looks desktop entry name up from libsfdo.
2024-11-19 18:36:54 +01:00
Jens Peters
57aee700f7
sfdo: add sfdo_desktop_entry_name_lookup() 2024-11-19 18:36:54 +01:00
Jens Peters
f69576f8a6
icon-loader: rename to desktop-entry
Also rename `struct icon_loader` to `struct sfdo`.
2024-11-19 18:36:08 +01:00
tokyo4j
9703c1deca src/menu.c: remove unnecessary re-renderings of font buffers
I missed that `scaled_font_buffer_update()` has `max_width` argument and
the subsequent calls to `scaled_font_buffer_set_max_width()` caused
unnecessary re-renderings.
2024-11-19 03:12:28 +01:00
Consolatis
e647fc7b23 icon-loader: fall back to app-id if icon from .desktop failed
Reported-By: LimeOn via IRC
2024-11-17 22:41:29 +01:00
Weblate
d6686803ff Translation updates from weblate
Co-authored-by: Moo <hazap@hotmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/lt/
Translation: Labwc/labwc
2024-11-16 22:15:09 +00:00
Consolatis
7b1af3036c Remove some line terminators from log messages 2024-11-16 22:13:17 +00:00
Consolatis
ec271dcd57 rcxml.c: keep zfree(string) calls together to ease detecting missing ones 2024-11-16 22:13:17 +00:00
Consolatis
5c9cae71cd rcxml.c: fix mem leak for repeated string config entries
An example is
```xml
<theme>
  <name>Numix</name>
</theme>
<theme name="Numix" />
```

Including various other variants.
Also change all other `free(x); x = xstrdup(y)` calls to `xstrdup_replace()`.
2024-11-16 22:13:17 +00:00
Consolatis
a4204d3335 common/mem.h: introduce xstrdup_replace() 2024-11-16 22:13:17 +00:00
Consolatis
6754801052 rcxml.c: fix mem leak when deduplicating keybinds
Before this patch `keybind->keysyms` wasn't free'd when
- deduplicating keybinds
- removing keybinds due to empty action list

This patch creates a shared `keybind_destroy()` helper
which gets used in all cases where a keybind is destroyed.
2024-11-16 22:13:17 +00:00
Jens Peters
07110d41ff theme: allow negative values for menu overlap
This fixes a regression introduced with:
dcd9b47e5b
2024-11-16 22:06:36 +00:00
tokyo4j
f8ed199197 menu: fix UAFs in menu_destroy() and item_destroy()
This fixes use-after-free when there's only 1 desktop and
menu_hide_submenu() is called to delete "Workspaces" submenu in
client-menu before menu scenes are initialized.

As menu_create() and item_create() no longer initialize scenes after
76515316, menu->scene_tree and item->tree should be null-checked.
2024-11-14 16:32:54 +01:00
tokyo4j
22eefa32a2 placement: set default placement policy to cascade 2024-11-14 09:21:01 +01:00
tokyo4j
b96742a039 menu: eliminate dead code
The deleted lines were dead code that didn't make any sense (even if it
were not dead, it should have recreated the parent of the hidden menu
rather than the hidden menu itself).
2024-11-14 06:11:13 +00:00
tokyo4j
10ee838c3b menu: fix menus disappearing when opening pipemenu
Commit 7651531 introduced a regression: `menu_update_scene()` which
re-creates a menu scene was called for all the menus when a pipemenu is
created, so the menus (parent of the pipemenu) were always moved to (0,0)
and hidden, and the pipemenu was incorrectly positioned.

This commit fixes it by calling `menu_update_scene()` only for the
pipemenu when it's created.
2024-11-14 06:11:13 +00:00
Consolatis
36e099fc93 view: ensure output is usable before setting adaptive sync
Fixes #2337
2024-11-14 05:13:51 +01:00
tokyo4j
d7e6f3a7a8 menu: invalidate nested duplicated menus
Prior to this commit, nesting the same menus caused stack overflow at
`close_all_submenus()` when trying to open it.
2024-11-14 05:28:06 +09:00
tokyo4j
3a7c6ce300 menu: consider padding when applying menu.width.{min,max} 2024-11-13 20:08:15 +00:00
tokyo4j
ec520d3520 menu: fix "menu.title.text.justify: right" not working 2024-11-13 20:08:15 +00:00
tokyo4j
7651531632 menu: refactor in preparation for richer menu design
This commit separates the process of creating scene-trees of the menu
items into `{item,separator,title}_create_scene()`. This will make it
easier to draw richer menu designs like borders, paddings and rounded
corners.
2024-11-13 20:08:15 +00:00
tokyo4j
90fad69027 src/menu.c: move some post_processing() and menu_update_width() 2024-11-13 20:08:15 +00:00
tokyo4j
d5daee6b96 menu: fix UAF of server->menu_current
This fixes segfault when exiting with a menu opened, which is a regression
from eaf11fac.
2024-11-13 16:52:19 +01:00
Consolatis
77d1747f1b workspaces: keep focus on omnipresent windows when switching workspaces
Fixes: #2329
2024-11-12 20:24:22 +01:00