Commit graph

2634 commits

Author SHA1 Message Date
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
Johan Malm
13a58c58eb NEWS.md: interim update 2024-11-12 17:44:28 +00:00
tokyo4j
9580caf8f8 theme: rename title_height to titlebar_height
Also removed the redundant initialization of title_height in
theme_builtin().
2024-11-12 17:25:39 +00:00
tokyo4j
1639919889 theme: rename menu_item_padding to menu_items_padding 2024-11-12 17:25:39 +00:00
tokyo4j
d916a78aca theme: move some variables into theme->window
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`
2024-11-12 17:25:39 +00:00
tokyo4j
720ae1fc87 theme: reorder theme entries in documentation and codebase 2024-11-12 17:25:39 +00:00
tokyo4j
eaf11face6 server: release all the resources on exit
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.
2024-11-12 16:21:06 +09:00
tokyo4j
71629741d6 server: release server->ssd_hover_state on exit 2024-11-12 16:21:06 +09:00
tokyo4j
fc66caf5d8 cosmic-workspace: destroy manager when wl_display is destroyed 2024-11-12 16:21:06 +09:00
tokyo4j
102bcc5013 seat: destroy seat->workspace_osd_timer on exit 2024-11-12 16:21:06 +09:00
tokyo4j
b08f753497 icon-loader: fix memory leak of icon_loader->icon_theme 2024-11-12 16:21:06 +09:00
tokyo4j
3f2cc1b29f osd: fix memory leak of output->osd_buffer 2024-11-12 16:21:06 +09:00
enometh
2d3be5ab56
src/output.c: skip painting output when session is not active
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>
2024-11-12 00:33:38 +01:00
Jens Peters
8a5608a3af input: add hold-begin/-end gestures 2024-11-11 15:06:25 +01:00
Jens Peters
7195d7793c input: ensure visible cursor on gestures 2024-11-11 15:06:25 +01:00
Jens Peters
8d99450fc9 input: notify idle-manager on gestures 2024-11-11 15:06:25 +01:00
Jens Peters
37b4e17788 input: use CONNECT_SIGNAL macro 2024-11-11 15:06:25 +01:00
Johan Malm
a88c721979
environment: ignore env var assignments > 1 KiB (#2325)
...to guard against recursive constructs like FOO=$FOO:bar which would
grow on each reconfigure.

Add log message as well as a warning against this in the man page.
2024-11-10 20:40:51 +00:00
Jens Peters
fc774d0071 input: hide cursor when using touch input
Hide the cursor on touch input and keep the cursur invisible
until pointer or tablet input.
2024-11-10 17:08:38 +09:00
Jens Peters
d1cde3c435 input: close xdg-popups on touch down
Taken over and now shared from the tablet implementation.
2024-11-10 17:08:38 +09:00
Jens Peters
7e0cd8ee5a input: move notify-idle-manager to tablet/touch handlers
Move them away from the cursor emulate functions. This
avoid calling them twice for touch motion.

Also notify idle manager on touch down/up.
2024-11-10 17:08:38 +09:00
Jens Peters
eed972cef1 input: clear pointer focus on touch input
Otherwise the pointer focus could interfere with touch input, like
showing hover effect on unexpected locations.
2024-11-10 17:08:38 +09:00
Jens Peters
3dbd5f30fc input: move touch only with one touch point
In other words, do not move the cursor when more than
one finger is down.
2024-11-10 17:08:38 +09:00
Jens Peters
a3d8688c17 input: warp cursor to touch coordinates
This makes the behavior consistent with non-touch
capable surfaces and the desktop.
2024-11-10 17:08:38 +09:00
Consolatis
4415178707 meson.build: increase wlroots dep to 0.18.1
This ensures users do not run into asserts()
when using the ext-foreign-toplevel-list protocol.
2024-11-09 20:06:19 +00:00
Consolatis
d6a48ab7a7 foreign-toplevel: add ext-toplevel-list support 2024-11-09 20:06:19 +00:00