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.
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"
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.
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.
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.
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()`.
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.
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.
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).
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.
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.
For example, variables:
`theme->window_inactive_border_color`
`theme->window_active_border_color`
are converted to:
`theme->window[THEME_INACTIVE].border_color`
`theme->window[THEME_ACTIVE].border_color`
Release all the resources including wlr_allocator, wlr_renderer,
wlr_backend and wlr_scene. This makes it a lot easier to detect memory
leaks with ASAN.
On wlroots side, the commit ce615a44 needs to be reverted to detect memory
leaks with EGL renderer.
On switching to a console vt when an application is painting,
labwc produces a stream of log messages of the form
```
`00:00:52.345 [ERROR] [../src/output-state.c:45] Failed to commit frame` lines.
``
This patch tries to follow the lead from the solution to this problem
in https://github.com/WayfireWM/wayfire/pull/2484.patch
As noted in that commit message, this patch depends on unreleased
patches to seatd (master) to work reliably, and there may be a a risk
of locking up the labwc if it is used with the seatd-0.8.0.
Check that the session is initialized (is not NULL) before checking it
is active.
Co-authored-by: Madhu <enometh@net.meer>