Commit graph

3291 commits

Author SHA1 Message Date
Weblate
b966a1ed73 Translation updates from weblate
Co-authored-by: BigELK176 ≡ <BigELK176@gmail.com>
Co-authored-by: Valera <ValeraDX@yandex.ru>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ru/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/zh_TW/
Translation: Labwc/labwc
2025-07-30 21:05:19 +01:00
John Lindgren
2e6b30eb50 include: move a few types from labwc.h to better locations 2025-07-30 21:04:31 +01:00
John Lindgren
e1475a1e47 include: reduce global includes in labwc.h 2025-07-30 21:04:31 +01:00
John Lindgren
e21fc065c4 include: split output.h from labwc.h 2025-07-30 21:04:31 +01:00
tokyo4j
2f414a438b rcxml: simplify the logic to traverse xml tree 2025-07-30 20:36:27 +01:00
tokyo4j
ad970544e1 string-helper: add str_space_only() 2025-07-30 20:36:27 +01:00
tokyo4j
67f36d9e13 rcxml: rewrite <tablet><map> parser 2025-07-30 20:36:27 +01:00
tokyo4j
619cae67fa rcxml: rewrite <theme><font> parser 2025-07-30 20:36:27 +01:00
tokyo4j
a865cc0777 rcxml: reorder functions 2025-07-30 20:36:27 +01:00
tokyo4j
ba00f57dad rcxml: rewrite <windowRules> parser 2025-07-30 20:36:27 +01:00
tokyo4j
936c5f6df1 rcxml: rewrite <windowSwitcher><fields> parser 2025-07-30 20:36:27 +01:00
tokyo4j
73dd3b8de1 rcxml: rewrite <region> parser 2025-07-30 20:36:27 +01:00
tokyo4j
a0d2e6a64b rcxml: rewrite <libinput> parser 2025-07-30 20:36:27 +01:00
tokyo4j
7adbfe88aa rcxml: rewrite <touch> parser 2025-07-30 20:36:27 +01:00
tokyo4j
8ae2d72cef rcxml: rewrite <margin> parser 2025-07-30 20:36:27 +01:00
tokyo4j
be31df097c rcxml: rewrite <mousebind> parser 2025-07-30 20:36:27 +01:00
tokyo4j
433168457f rcxml: rewrite <keybind> parser 2025-07-30 20:36:27 +01:00
tokyo4j
9462457cc2 rcxml: rewrite action parser
This commit rewrites the nested action parser into append_actions() which
is used by following commits. At this point, it's not used yet and parsing
"If" action is temporarily disabled.
2025-07-30 20:36:27 +01:00
tokyo4j
8881841098 common/xml: add helpers to parse rc.xml 2025-07-30 20:36:27 +01:00
tokyo4j
503af10505 rcxml: convert dotted properties into nested nodes before processing
For example, the following node:

  <keybind name.action="ShowMenu" menu.action="root-menu"
            x.position.action="1" y.position.action="2" />

is converted to:

 <keybind>
   <action>
     <name>ShowMenu</name>
     <menu>root-menu</menu>
     <position>
       <x>1</x>
       <y>2</y>
     </position>
   </action>
 </keybind>

...before processing the entire xml tree. This is a preparation to prevent
breaking changes when we refactor rcxml.c to use recursion instead of
encoding nodes into dotted strings.
2025-07-30 20:36:27 +01:00
John Lindgren
330c55e1b2 CONTRIBUTING.md: add section on include order 2025-07-29 21:51:56 +01:00
John Lindgren
0d396f84a7 CONTRIBUTING.md: minor updates
- style "GLib" with two capitals as in its own upstream docs
- use title-case consistently for headings
- add missing heading to table of contents
- update dead GLib documentation URL
2025-07-29 21:51:56 +01:00
John Lindgren
31d42b50e2 src: include primary header first
This is a common practice in C projects, which simply enforces that
each header must compile cleanly without implicit dependencies on
other headers (see also the previous commit).
2025-07-29 21:51:56 +01:00
John Lindgren
c9b576982d include: add missing header dependencies
Ensure that headers compile correctly regardless of include order.
2025-07-29 21:51:56 +01:00
Johan Malm
69b9122194 NEWS.md: update with notes on wlroots changes 2025-07-29 21:06:21 +01:00
tokyo4j
bdaf85eda1 Fix some warnings from clang-tidy
Notably this fixes a possible null pointer dereference in warp_cursor()
when output_nearest_to_cursor() returns null.
2025-07-28 15:27:45 +02:00
Weblate
b3b6715cdf Translation updates from weblate
Co-authored-by: Abdullah Albaroty <albaroty@gmail.com>
Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Co-authored-by: Moo <hazap@hotmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: kmephistoh <kanhaosmile@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ar/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/lt/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/zh_CN/
Translation: Labwc/labwc
2025-07-27 17:26:27 +01:00
tokyo4j
024ab280a0 cursor: also toggle mousebinds with ToggleKeybinds
Mousebinds can still be applied when the cursor is over their decoration
2025-07-28 00:06:52 +09:00
tokyo4j
73095f75cb Remove seat->nr_inhibited_keybind_views 2025-07-28 00:06:52 +09:00
Consolatis
f7702af9e4 src/xdg.c: prevent interacting with un-initialized xdg toplevels after unmap
Fixes: #2937
Fixes: #2944

Originally-Reported-By: tranzystorekk via IRC
2025-07-27 23:51:28 +09:00
tokyo4j
0d9384de74 style: remove newlines after wl_list_for_each_reverse() 2025-07-27 08:26:39 +09:00
John Lindgren
d96656ccdc menu: add struct menu_parse_context to reduce static vars
The lifetime of the "current_" variables (current_menu, current_item,
current_item_action) is very difficult to understand from reading the
code. It appears that e.g. current_menu could still point to a previous
menu when starting to parse a new one, with unpredictable results.

Let's use a context struct when parsing, and consistently initialize
it when beginning to build a new menu.

Lightly tested with:

- default menus (no menu.xml)
- example static menu from labwc.github.io/getting-started.html
- an added "client-list-combined-menu" sub-menu
- pipe menu generated by `labwc-menu-generator -p`

v2: style fix
2025-07-24 15:35:29 +09:00
tokyo4j
cb79eccea1 cursor: prevent hi-res mice triggering scroll actions too often
Hi-res mice produces mulitple scroll events with `delta_discrete` != 0
during a single "click". This patch makes them trigger `Scroll` actions
only when the accumulated `delta_discrete` exceeds 120 (= 1 click).

See https://lists.freedesktop.org/archives/wayland-devel/2019-April/040377.html
for how hi-res scroll events are reported.
2025-07-22 19:31:55 +09:00
John Lindgren
1747d9e961 buf: avoid 'new' as variable name
It's just good practice to avoid C++ keywords, in case someone
someday wants to compile this code as C++.
2025-07-21 16:51:10 +02:00
John Lindgren
7d2b5150e8 session-lock: eliminate pointless compound literal
In C++, this would have caused a use-after-free. In C, the unnamed
array remains in scope longer, so it's okay, but still pointless.
2025-07-21 16:51:10 +02:00
John Lindgren
4afbfac528 src: put designated initializers in member order
Out-of-order named initializers are allowed in C (unlike in C++) but
are still surprising - I don't see a reason not to put them in order.
2025-07-21 16:51:10 +02:00
John Lindgren
a802d6b20a src: avoid tentative definitions of static data
Having multiple declarations of the same static data (where one is
considered "tentative") is kind of an obscure C feature -- I didn't
even know the name of it until today. It's also forbidden in C++.

In the case of circular dependencies between static data <-> function,
the more typical pattern is to forward-declare the function, then the
data, then provide the function definition. Let's follow that pattern.
2025-07-21 16:51:10 +02:00
John Lindgren
407a29aa23 string-helpers: remove restrict qualifier
'restrict' is harmful as it encourages the compiler to make dangerous
assumptions while increasing cognitive load on the human programmer.

The extra 1% (or whatever) of performance here is not worth the cost.
2025-07-21 16:51:10 +02:00
John Lindgren
681f9e9a7b src: add braces to switch cases containing declarations
This limits the scope of the declarations to avoid accidents.
2025-07-21 16:51:10 +02:00
John Lindgren
b48c250177 src: prefer 'if' over 'goto' where convenient
'goto' should not be used for normal control flow.

v2 add comment in lieu of goto label
2025-07-21 16:51:10 +02:00
John Lindgren
8b7ae52a91 src: avoid implicit int/bool -> enum conversions
Use the defined enum constants instead.
2025-07-21 16:51:10 +02:00
John Lindgren
cd8a8c2bf6 keybind: pointer to string literal should be const
Assigning to (char*) creates a mutable string literal, which was
likely not intended here and wasn't necessary.
2025-07-21 16:51:10 +02:00
John Lindgren
ac47be3019 menu: do not modify literal string constants
Mutable string literals are a "legacy" C feature best avoided.

v2: move string_truncate_at_pattern() outside fill_item()
2025-07-21 16:51:10 +02:00
lynxy
2bcd8277c4 comments: added short description to view_edge enum 2025-07-19 12:29:55 +09:00
lynxy
254f526f71 actions: prevent users entering invalid direction=any value 2025-07-19 12:29:55 +09:00
lynxy
13ff64f6e4 actions: added query tiled=any comparison for rc.xml simplification 2025-07-19 12:29:55 +09:00
John Lindgren
359dd8f3c7 img: fix apparent double-free in img_svg_render() failure path
img_svg_render() calls g_object_unref() on the RsvgHandle in its
error path, but the handle is owned by the shared lab_img_data
struct and will be double-freed later by lab_img_destroy().

The double-free was introduced when img_svg_load() was split from
img_svg_render(). The g_object_unref() should have been removed from
img_svg_render() but was missed.

Fixes: 16dbdc64e5
("ssd: rework titlebar button rendering")
2025-07-13 16:43:56 +09:00
John Lindgren
bb2d34a5c1 xwayland: fix swapped width/height in _NET_WM_ICON stride calculation
Probably slipped through since most window icons are square anyway.
2025-07-13 03:51:40 +02:00
Johan Malm
4beee3851f build: bump version to 0.9.0 2025-07-11 21:52:18 +01:00
Johan Malm
101180bef4 NEWS.md: update notes for 0.9.0 2025-07-11 21:47:52 +01:00