Commit graph

2805 commits

Author SHA1 Message Date
Consolatis
0c5352d904 CI: fix Debian build, wlroots package got renamed
Also disable it for now because we can just use the shipped version
of libwlroots-0.18-dev rather than needing to build it ourselves.
2025-02-07 18:13:16 +01:00
tokyo4j
fb5e85f40f menu: remove ShowMenu action from menu items
Previous commits fixed some unexpected behaviors when ShowMenu action is
executed from menu items, but that was still prone to bugs because when
calling actions_run(), we allow an inconsistent state where all menus are
closed but pipemenus must not be destroyed.

So this commit simply removes ShowMenu actions from menu items on
initialization.
2025-02-07 17:58:55 +01:00
tokyo4j
8f5217c98b menu: assert no menu is opened in menu_open_root()
66a3beb added an early-return when the menu is opened, so we can guarantee
that no menu is opened there.
2025-02-07 17:58:55 +01:00
tokyo4j
4072a80eba menu: fix unexpected behavior when a menu is opened from another menu
server->menu_current should be cleared before calling actions_run() as
it may internally call menu_open_root(). Clearing it after actions_run()
leads to an inconsistent state where a menu is opened but
server->menu_current is NULL. It even lead to a segfault when the item
opening another menu is contained in a pipemenu, because
menu_open_root() calls destroy_pipemenu() when server->menu_current is
set, which makes accessing item->actions a UAF.
2025-02-07 17:58:55 +01:00
Weblate
465488110d Translation updates from weblate
Co-authored-by: EggSupernova <leomelo34@protonmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt_BR/
Translation: Labwc/labwc
2025-02-05 21:16:23 +00:00
01micko
9ed4058680 README.md#Integration: add xfce4-panel
inspired by https://forums.bunsenlabs.org/viewtopic.php?pid=141053#p141053
2025-02-05 15:23:17 +01:00
Andrew J. Hesford
b2623ce1e3 docs/rc.xml.all: correct description of resize.cornerRange 2025-02-04 18:55:31 -05:00
Andrew J. Hesford
6b9cc5dd64 ssd: make sizes of invisible SSD extents configurable 2025-02-04 18:55:31 -05:00
Consolatis
fa6e524412 CI: restrict build jobs to code changes 2025-02-04 22:36:52 +01:00
Consolatis
e47f9204b9 action.c: add SSD margin to MoveTo coordinates
Fixes: #2469
2025-02-04 21:56:40 +01:00
Consolatis
897799da5a server: on exit, destroy backends first
This fixes a UAF caused by trying to update the xcursor in a
output destroy handler, in turn caused by destroying the backend.

Fixes: #2539
2025-02-04 19:56:36 +00:00
tokyo4j
950337b895 ssd: fix resizing on border corners and add <resize><cornerRange>
Eliminate corner extents and instead use cursor position to map SSD
borders and extents to corner contexts, with a size configurable by the
<resize><cornerRange> parameter. This simplifies extent handling,
eliminates bugs in the detection of corner context, and allows users to
expand corner targets if they wish.

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2025-02-04 11:13:32 -05:00
Johan Malm
9ad6e3c68c NEWS.md: start converting section 0.8.0 references
...to [#%d] format and process with rip.c
2025-02-04 06:37:00 +00:00
Johan Malm
2e10fe6f41 Add scripts/rip.c
...to extract pull-request and issue reference from NEWS.md and output
them as GH URLs.
2025-02-04 06:37:00 +00:00
Orfeas
3e9c08871f query: encapsulate parser state into a struct 2025-02-03 20:00:22 +00:00
Consolatis
ed4553fc7e src/menu: add global config for menu.showIcons 2025-02-02 15:05:37 +00:00
Consolatis
1fa4070025 src/menu: add support for scalable menu icons 2025-02-02 15:05:37 +00:00
Consolatis
060b59f7ed src/config: let icon theme name default to theme 2025-02-02 15:05:37 +00:00
Consolatis
1e2c709d6b docs/labwc-menu: we only support a single menu.xml file 2025-02-02 15:05:37 +00:00
01micko
6efdb1037f README.md: fix minor grammar error, add libsfdo as optional dependency 2025-02-01 12:36:56 +01:00
tokyo4j
9a473f1848 wlr-foreign: send output_enter on initialization
This fixes a bug that output_enter events are not sent when a Slack
window running in background is re-mapped, which caused missing taskbar
items in Waybar when it's configured to show windows per output.
2025-01-27 13:18:29 +01:00
Consolatis
01592d2633 surface-helpers: reduce log spam
This shows up when processing out-of-surface movement on subsurfaces.
2025-01-26 14:22:06 +01:00
Consolatis
37d745b01d cursor.c: use subsurface as reference for out-of-surface movement
The protocol states that the wl_pointer motion coordinates must be
relative to the focused surface (e.g. the surface that last received
a wl_pointer enter event).

Before this patch, the coordinates were relative to the toplevel
surface instead, resulting in subsurface events having the wrong
coordinates when pressing a button over a subsurface and moving
the cursor outside of that subsurface.

Fixes: #2542
2025-01-26 14:22:06 +01:00
tokyo4j
26064fb8f6 Add <theme><fallbackAppIcon>
This commit adds <theme><fallbackAppIcon> that configures the icon name
to be used when lookups for an application icon is failed. Its default
value is set as 'labwc' which shows our labwc logo.
2025-01-26 11:46:32 +01:00
tokyo4j
dc474521ab ssd: dynamically look up window icons in titlebar for output scales
by introducing scaled_icon_buffer.
2025-01-26 11:46:32 +01:00
tokyo4j
5e29f79258 string-helpers: add str_equal() 2025-01-25 07:27:21 +09:00
tokyo4j
45f73b58a1 img: remove padding_x from lab_img_render()
padding_x in lab_img_render() was just to make sure window icons in the
titlebar doesn't get too close to adjacent buttons and it didn't felt
clean. To remove it from lab_img, this commit changes the size of window
icon buffers from (window.button.width)x(window.button.height) to
(window.button.width * 0.8)x(window.button.height) and horizontally
slide it by (window.button.width * 0.1) to keep the horizontal padding.

Note that the size of the hitbox for a window icon is kept the same and
nothing is changed from user's perspective.
2025-01-25 07:27:21 +09:00
tokyo4j
a0cf6bb068 Move "#if HAVE_LIBSFDO" inside desktop-entry.h 2025-01-25 07:27:21 +09:00
tokyo4j
bffdccf8dc refactor: add LAB_BS_DEFAULT in lab_button_state 2025-01-25 07:27:21 +09:00
Dima Krasner
36d6e9ef75 docs: fix incorrect default for window.label.text.justify 2025-01-24 12:57:06 +01:00
tokyo4j
4b7c502ace view: replace content_node with content_tree 2025-01-22 18:02:54 +01:00
tokyo4j
40b1f5407f ssd: fix InactiveWindow font not working 2025-01-22 17:54:48 +01:00
yuiiio
baab35c469 ime: cleanup new_popup_surface listener when destroy 2025-01-19 08:00:45 +09:00
yuiiio
f4d581ef91 xdg: cleanup request_show_window_menu listener when destroy 2025-01-16 00:08:56 +01:00
tokyo4j
08d31145fd cursor: don't leak bound scroll events from touchpad to clients
Prior to this commit, when we receive fine-grained scroll events from
touchpads that are bound to any mousebind, we leaked the scroll events to
the client unless the accumulated scroll delta exceeds the fixed threshold.
This was annoying for example when a user wants to ZoomIn/Out with
W-Up/Down mousebinds with a touchpad.

So this commit fixes it by not leaking the scroll events nor executing
actions when the accumulated delta doesn't exceed the threshold.
2025-01-14 09:35:07 +09:00
tokyo4j
1a6b01a83e rcxml: replace 'icon' with 'menu' when libsfdo is not linked 2025-01-14 08:41:00 +09:00
tokyo4j
f082dd7c25 rcxml: ignore duplicated buttons in <titlebar><layout>
...rather than ignoring the whole <titlebar><layout>.
2025-01-14 08:41:00 +09:00
tokyo4j
925360ffba scaled-scene-buffer: block sharing of buffers created before reconfigure
This prevents potential bugs that buffers created by scaled_scene_buffers
before Reconfigure are reused by other newly created scaled_scene_buffers.

This is targeted for scaled_icon_buffer whose buffer creation depends on
server->sfdo.
2025-01-13 18:24:10 +09:00
tokyo4j
c49f577c6b scaled-scene-buffer: store all the scaled_scene_buffers in a single list 2025-01-13 18:24:10 +09:00
Consolatis
138a514c90 seat: set repeat information for virtual keyboards
Fixes: #2513
2025-01-13 06:28:37 +09:00
Consolatis
0627190060 keyboard: add keyboard_get_all_modifiers()
And make mousebind handlers use that one.
Also remove keyboard_any_modifiers_pressed() and replace its usage
with the new function.

Without this patch we would only request the modifier state of the
keyboard group which makes mousebinds involving keyboard modifiers
break for virtual keyboards like when using wayvnc. Same story for
hiding the workspace overlay or snapping to regions.

Fixes: #2511
2025-01-13 06:28:37 +09:00
Tomi Ollila
577c24306f theme: don't try to load "themerc"s if theme_name is NULL
theme_name is NULL when <theme><name></name>...</theme> is in rc.xml
2025-01-12 14:55:04 +09:00
Consolatis
6496773fd1 scaled-scene-buffer: use outputs_update signal
This fixes an issue with buffers not updating when an output is configured
for a new scale. It also supports windows being on more than 2 outputs at
once and in general simplifies the code.
2025-01-11 07:29:46 +01:00
tinyboxvk
1a6dd845a2 Fix typos
Signed-off-by: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com>
2025-01-09 06:59:57 +00:00
Consolatis
4ecedcdb3b desktop-entry: separate icon and app_id icon lookup
This patch splits desktop_entry_icon_lookup() into two separate functions
- desktop_entry_load_icon(): load a icon from the configured icon theme
- desktop_entry_load_icon_from_app_id(): load a icon name from a .desktop
  file based on the given app_id and supply it to _load_icon().

The _load_icon() function will be used in a future menu icon
implementation whereas the _load_icon_from_app_id() function is used
within the SSD titlebar window icon lookup routine.
2025-01-09 00:57:06 +09:00
Consolatis
d53cf642f5 desktop-entry: accept uppercase icon endings 2025-01-09 00:57:06 +09:00
Consolatis
10c6abb36a string-helpers: add str_endswith_ignore_case() 2025-01-09 00:57:06 +09:00
tokyo4j
41aa7e1a7d IME: fix stuck Ctrl when pressed Ctrl+F in Firefox with Fcitx5
683f67b7 introduced another regression that the modifier state (Ctrl) is
stuck when Ctrl+F is pressed in some applications like Firefox while
Fcitx5 is running. This caused mouse scrolls to zoom in/out the UI.

Let me explain the cause in detail. When Ctrl+F is pressed, an input box
is opened in the application and Fcitx5 creates a new virtual keyboard
(VK), whose initial modifiers is empty. Then prior to 683f67b7, the
key/modifiers events flowed like this:

- The compositor detects F key-release
  - Modifiers (Ctrl pressed) are notified via _set_keyboard()
  - F key-release is forwarded to IM
- IM sends modifiers (Ctrl) back to the compositor via VK
  - **The modifiers on VK is updated (empty->Ctrl)**
  - **Modifers (Ctrl) are notified to the app**
- IM sends F key-release back to the compositor via VK
  - F key-release is notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is forwarded to IM
  - Modifiers (empty) are forwarded to IM
- IM sends Ctrl key-release back to the compsitor via VK
  - Ctrl key-release is notified to IM
- IM sends modifiers (empty) back to the compositor via VK
  - **The modifiers on VK is updated again (Ctrl->empty)**
  - **Modifiers (empty) are notified to the app**

Thus, the final modifiers (empty) is notified to the application as
expected. However, after 683f67b7, the key/modifiers events flowed like
this:

- The compositor detects F key-release
  - F key-release is directly notified to the app
  - The modifiers (Ctrl) is also notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is directly notified to the app
  - Modifiers (empty) are forwarded to IM
- IM sends modifiers (empty) back to the compositor via VK
  - **Modifier on VK is not updated (empty->empty)**
  - **The compositor ignores it**

So the final modifier (empty) is never notified to the application, which
causes stuck Ctrl modifier.

This commit fixes this by not forwarding the modifiers when it hasn't been
updated since it was forwarded previously. So after this commit, the
key/modifiers events flow like this:

- The compositor detects F key-release
  - F key-release is directly notified to the app
  - The modifiers (Ctrl) is also notified to the app
- The compositor detects Ctrl key-release
  - Ctrl key-release is directly notified to the app
  - The modifiers are directly notified to the app because the modifiers
    (empty) are the same as the last forwarded modifier (empty).
2025-01-07 19:31:56 +00:00
tokyo4j
405e543faf IME: rename pressed_keys to forwarded_pressed_keys 2025-01-07 19:31:56 +00:00
tokyo4j
6f1ef10d58 cursor: fix invisible cursor on application after reconfigure
On reconfigure, we should send wl_pointer.{leave,enter} events if the
cursor is on an application surface to let the application update the
cursor, but bad788cc prevented these events from being sent.
2025-01-06 21:05:54 +00:00