]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
6 months agowindow-rules: fix window rules not being applied
tokyo4j [Mon, 25 Aug 2025 09:54:22 +0000 (18:54 +0900)]
window-rules: fix window rules not being applied

In 943f5751, I initialized heap-allocated `view_query` used for
`If` actions with `decoration=LAB_SSD_MODE_INVALID`, but I forgot to do
that for stack-allocated `view_query` used for window rules.

6 months agoview: respect client-initiated resize of non-maximized axis
John Lindgren [Sat, 23 Aug 2025 14:44:26 +0000 (10:44 -0400)]
view: respect client-initiated resize of non-maximized axis

When implementing single-axis maximize some time ago, I made the
simplifying assumption that a view couldn't be resized while maximized
(even in only one axis). And indeed for compositor-initiated resize,
we always unmaximize the view first.

However, I didn't account for the client resizing the non-maximized
axis, which we can't (and shouldn't) prevent. When this happens, we
should also update the natural geometry of that single axis so that we
don't undo the resize when un-maximizing.

P.S. xdg-shell clients resizing the *maximized* axis is still an
unsolved problem, exacerbated by the fact that xdg-shell protocol
doesn't allow clients to even know about single-axis maximize.

P.P.S. the view_invalidate_last_layout_geometry() logic may need
similar updates, I'm not sure.

6 months agossd: allow hiding titlebar on maximization
tokyo4j [Thu, 21 Aug 2025 04:56:37 +0000 (13:56 +0900)]
ssd: allow hiding titlebar on maximization

<core disableMaximizedServerDecor="yes"> hides the titlebar when a window
is maximized.

Co-authored-by: @CosmicFusion
6 months agoview: unify ssd_enabled and ssd_titlebar_hidden to ssd_mode
tokyo4j [Thu, 21 Aug 2025 04:45:58 +0000 (13:45 +0900)]
view: unify ssd_enabled and ssd_titlebar_hidden to ssd_mode

6 months agoAdd common/edge.c
tokyo4j [Thu, 21 Aug 2025 08:57:29 +0000 (17:57 +0900)]
Add common/edge.c

6 months agodocs/labnag.1.scd: fix typo
01micko [Thu, 21 Aug 2025 10:03:33 +0000 (20:03 +1000)]
docs/labnag.1.scd: fix typo

6 months agoconfig: add comment to enum lab_motion
John Lindgren [Thu, 21 Aug 2025 04:23:07 +0000 (00:23 -0400)]
config: add comment to enum lab_motion

6 months agoinclude: add config/types.h
John Lindgren [Sun, 17 Aug 2025 20:01:50 +0000 (16:01 -0400)]
include: add config/types.h

6 months agodesktop-entry: fix partial string matching
Marvin Dostal [Sat, 16 Aug 2025 10:31:45 +0000 (12:31 +0200)]
desktop-entry: fix partial string matching

Use the base instead of the full string for the comparison.

6 months agoclients/labnag.c: add newline to color errors.
01micko [Wed, 20 Aug 2025 12:26:22 +0000 (22:26 +1000)]
clients/labnag.c: add newline to color errors.

6 months agodocs/rc.xml.all: clean up libinput section.
01micko [Tue, 19 Aug 2025 09:50:07 +0000 (19:50 +1000)]
docs/rc.xml.all: clean up libinput section.
- add alternative accepted values for [yes|no]
- re #3006

6 months agoseat.c: reset libinput device config on reconfigure
tokyo4j [Tue, 19 Aug 2025 05:15:01 +0000 (14:15 +0900)]
seat.c: reset libinput device config on reconfigure

Before this commit, setting empty values in <libinput> entires and
executing Reconfigure left libinput devices with old configurations.

This commit makes sure that default values are set in libinput devices
on every Reconfigure to make rc.xml more declarative.

6 months agorcxml: allow empty values in <libinput>
tokyo4j [Tue, 19 Aug 2025 05:13:35 +0000 (14:13 +0900)]
rcxml: allow empty values in <libinput>

This restores the old behavior prior to a0d2e6a6.

6 months agoTranslation updates from weblate
Weblate [Mon, 18 Aug 2025 20:01:19 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Qayyum Yazid <purrnama@proton.me>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ms/
Translation: Labwc/labwc

6 months agokeybind: refactor update_keycodes_iter() to reduce nesting
John Lindgren [Sat, 16 Aug 2025 17:17:36 +0000 (13:17 -0400)]
keybind: refactor update_keycodes_iter() to reduce nesting

update_keycodes_iter() currently has 4(!) levels of nested loops, which
makes the logic (especially the break/continue statements) difficult to
understand. The logic also appears to continue looping uselessly after
a given keycode has already been added to a keybind.

Refactor by adding some small utility functions:

- keybind_contains_keycode()
- keybind_contains_keysym()
- keybind_contains_any_keysym()

No functional change intended.

6 months agoTranslation updates from weblate
Weblate [Sat, 16 Aug 2025 20:01:20 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/de/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/uk/
Translation: Labwc/labwc

6 months agolabwc-menu(5): reflect use of client-send-to-menu in client menu
Johan Malm [Wed, 13 Aug 2025 20:38:40 +0000 (21:38 +0100)]
labwc-menu(5): reflect use of client-send-to-menu in client menu

6 months agomenu: fix leak in update_client_send_to_menu()
Johan Malm [Wed, 13 Aug 2025 20:37:51 +0000 (21:37 +0100)]
menu: fix leak in update_client_send_to_menu()

6 months agomenu: use client-send-to-menu as 'Workspace' submenu
Johan Malm [Wed, 13 Aug 2025 19:34:07 +0000 (20:34 +0100)]
menu: use client-send-to-menu as 'Workspace' submenu

...because that is more flexible and how it is in openbox.

I have had in mind that we should do this since the original
implementation, and #2994 just jogged my memory.

6 months agomenu: fix use-after-free at exit with sub-menu selected
John Lindgren [Fri, 15 Aug 2025 05:29:15 +0000 (01:29 -0400)]
menu: fix use-after-free at exit with sub-menu selected

Sequence of events:

- menu_finish() frees the sub-menu first
- the selection.menu of the parent menu is now dangling
- menu_finish() frees the parent menu
- menu_free() calls menu_close_root() on the parent menu
- menu_close_root() tries to close the (freed) sub-menu
- boom

Extending nullify_item_pointing_to_this_menu() avoids the crash.

6 months agoinput/cursor: fix assignment/equality mix-up
John Lindgren [Thu, 14 Aug 2025 18:35:44 +0000 (14:35 -0400)]
input/cursor: fix assignment/equality mix-up

6 months agomenu: allow overwriting submenu icon
tokyo4j [Thu, 14 Aug 2025 17:38:02 +0000 (02:38 +0900)]
menu: allow overwriting submenu icon

Allow overwriting the icon of item linking to another menu like below
(the icon for "krita" should be shown):

<openbox_menu>
  <menu id="static-menu" label="Static Menu" icon="mpv" />
  <menu id="root-menu" label="Root">
    <menu id="static-menu" icon="krita" />
  </menu>
</openbox_menu>

This commit also fixes my mistake in 17d66e5 (s/parent->icon/menu->icon/)
that showed incorrect icon in an item linking to another menu.

6 months agomenu: fix client-send-to-menu
tokyo4j [Wed, 13 Aug 2025 15:08:06 +0000 (00:08 +0900)]
menu: fix client-send-to-menu

Fixes 17d66e5

6 months agomenu: allow client-{list-combined,send-to}-menu as submenu of static menu
tokyo4j [Wed, 13 Aug 2025 14:52:24 +0000 (23:52 +0900)]
menu: allow client-{list-combined,send-to}-menu as submenu of static menu

Also, their labels are changed to "Windows" and "Send to desktop" which
are the same as Openbox.

6 months agoTranslation updates from weblate
Weblate [Mon, 11 Aug 2025 00:27:15 +0000 (02:27 +0200)]
Translation updates from weblate

Co-authored-by: Oliver Chiasson <olivierchiasson@hotmail.fr>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fr/
Translation: Labwc/labwc

6 months agodocs/menu.xml: adjust labnag example
Narrat [Tue, 12 Aug 2025 21:25:45 +0000 (23:25 +0200)]
docs/menu.xml: adjust labnag example

It was missing the respective closing tag

6 months agolabnag: return special value on timeout
Johan Malm [Sat, 9 Aug 2025 14:15:35 +0000 (15:15 +0100)]
labnag: return special value on timeout

...to avoid taking either of the <then> or <else> branches on timeout.

6 months agoosd: add null-check for output->osd_scene.tree
tokyo4j [Sat, 9 Aug 2025 10:53:10 +0000 (19:53 +0900)]
osd: add null-check for output->osd_scene.tree

`wlr_scene_node_destroy(&output->osd_scene.tree->node);` does nothing
for null pointer, but ASAN is unhappy about accessing (NULL)->node.

6 months agoaction: fix labnag button order
Johan Malm [Sat, 9 Aug 2025 09:54:06 +0000 (10:54 +0100)]
action: fix labnag button order

6 months agolabnag: fix FreeBSD signalfd() build error
Johan Malm [Fri, 8 Aug 2025 18:17:22 +0000 (19:17 +0100)]
labnag: fix FreeBSD signalfd() build error

6 months agolabwc-action(5): describe If action <prompt>
Johan Malm [Tue, 24 Jun 2025 19:44:32 +0000 (20:44 +0100)]
labwc-action(5): describe If action <prompt>

6 months agoAdd labnag
Johan Malm [Mon, 28 Apr 2025 19:38:19 +0000 (20:38 +0100)]
Add labnag

Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag)

Copied at commit:
https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a

Contains the following modifiations:

- Some functional changes including:
  - Disable exclusive-zone by default (Written-by: @Consolatis) and add
    command line option -x|--exclusive-zone
  - Add close timeout (Written-by: @Consolatis) and -t|--timeout option
  - Use index of button (from right-to-left) for exit code
  - Disable reading from config file and remove associated --type option
- Refactoring including:
  - Use wlr_log() instead of the log.{c,h} functions
  - Use wl_list instead of sway's list.c implementation
  - In the pango wrapper functions, use glib's g_strdup_vprintf() rather
    than the original stringop.c functions
- Align with labwc coding style to pass checkpatch.pl
- Re-licenced from MIT to GPL-2.0, and add Copyright notices for original
  authors

v2

- Remove option -s|--dismiss-button and the default "X" button. To get
  such a button, "-Z X :"
- Remove options -b and -z because there is no requirement to run
  in a terminal.
- Remove *-no-terminal from options --button and --button-dismiss because
  commands are now always run directly without a terminal.

v3

- Allow -B/-Z options without action-argument
- Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z`
  results in three buttons with "x" furthest to the left, and "z" on the
  right (rather than the other way around).
- Use signalfd() to prevent race conditions on SIGTERM

v4

- Limit number of stdin lines to 200 to avoid hogging CPU

Co-Authored-by: tokyo4j
6 months agobuild: refactor in preparation for man page not beginning with 'labwc-'
Johan Malm [Mon, 28 Apr 2025 19:33:50 +0000 (20:33 +0100)]
build: refactor in preparation for man page not beginning with 'labwc-'

No functional change intended.

6 months agoaction: add support for <prompt> in 'If' actions
Consolatis [Fri, 20 Dec 2024 09:14:32 +0000 (10:14 +0100)]
action: add support for <prompt> in 'If' actions

...and allow If Action without activator view.

For example:

    <action name="If">
      <prompt message="Toggle maximize?"/>
      <then>
        <action name="ToggleMaximize" />
      </then>
    </action>

Also revert the change in b9c84f9 that <else> branch is always taken when
no window is focused.

Co-Authored-by: johanmalm
Co-Authored-by: tokyo4j
6 months agoscaled-icon-buffer: prevent accidental downcasting of scale
Consolatis [Sat, 9 Aug 2025 02:48:39 +0000 (04:48 +0200)]
scaled-icon-buffer: prevent accidental downcasting of scale

This causes blurry icons on non-integer scales and triggers
an assert within cairo when using a output scale < 1.

Fixes: #2983
6 months agoime: fix segfault when IME is killed
tokyo4j [Thu, 7 Aug 2025 08:45:30 +0000 (17:45 +0900)]
ime: fix segfault when IME is killed

Fixes up e530f43.

When IME (e.g. fcitx5) is killed, relay->input_method is destroyed and
then relay->input_method->keyboard_grab is destroyed, which causes null
pointer dereference and crashes labwc.

Possible solutions are:
- Let wlroots keep emitting keyboard grab as `data` from keyboard grab's
  destroy handler just like before
- Let wlroots destroy keyboard grab before input method
- Let compositor store keyboard grab as relay->keyboard_grab

But let's just revert the change in e530f43 for now.

6 months agoforeign-toplevel: simplify and fully separate ext-foreign/wlr-foreign
John Lindgren [Fri, 8 Aug 2025 00:30:59 +0000 (20:30 -0400)]
foreign-toplevel: simplify and fully separate ext-foreign/wlr-foreign

Currently, the dependencies between foreign-toplevel[-internal],
ext-foreign, and wlr-foreign are cyclical and a bit complex.

I suggest we reorganize it into a simpler hierarchy:

  foreign-toplevel/
    -> foreign.c/h
      -> (depends on) ext-foreign.c/h
      -> (depends on) wlr-foreign.c/h

The refactored code is smaller and (IMO) easier to follow.

In detail:

- Add include/foreign-toplevel folder mirroring src/foreign-toplevel
- Split foreign-toplevel-internal.h to ext-foreign.h and wlr-foreign.h
- Eliminate ext-/wlr-foreign.c -> foreign.c reverse dependencies
  (including internal signals and foreign_request* functions)
- Make struct foreign_toplevel private to foreign.c

Lightly tested with qmpanel (which uses wlr-foreign-toplevel).

v2: reorder foreign-toplevel internal API funcs

6 months agoforeign-toplevel: disconnect internal signals from handle_handle_destroy()
John Lindgren [Thu, 7 Aug 2025 19:27:12 +0000 (15:27 -0400)]
foreign-toplevel: disconnect internal signals from handle_handle_destroy()

If the handle gets destroyed from the wlroots side before the view
is destroyed, the internal signals (emitted from the view) are not
disconnected and will assert() if invoked.

7 months agocommon/xml.c: fix memory leak in lab_xml_get_bool()
Johan Malm [Wed, 6 Aug 2025 20:05:28 +0000 (21:05 +0100)]
common/xml.c: fix memory leak in lab_xml_get_bool()

7 months agoxdg: try to keep view on the same output in timeout case
John Lindgren [Wed, 6 Aug 2025 04:30:54 +0000 (00:30 -0400)]
xdg: try to keep view on the same output in timeout case

7 months agoxdg: don't try to reposition unmapped view in timeout handler
John Lindgren [Wed, 6 Aug 2025 04:23:40 +0000 (00:23 -0400)]
xdg: don't try to reposition unmapped view in timeout handler

7 months agoime: don't use data argument in some signal handlers
tokyo4j [Sun, 6 Jul 2025 20:15:46 +0000 (05:15 +0900)]
ime: don't use data argument in some signal handlers

In wlroots 0.20, the those data argument will be just NULL.

7 months agoview: assert internal signals are disconnected before destroy
John Lindgren [Tue, 5 Aug 2025 00:55:16 +0000 (20:55 -0400)]
view: assert internal signals are disconnected before destroy

If they are not empty, then we are headed for use-after-free shortly.
An assert() failure is easier to debug than UAF, so let's fail early.

Inspired by:
https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/8f56f7ca43257cc05c7c4eb57a0f541e05cf9a79

7 months agooutput: make autoEnableOutputs=no apply only to drm outputs
John Lindgren [Tue, 5 Aug 2025 00:28:25 +0000 (20:28 -0400)]
output: make autoEnableOutputs=no apply only to drm outputs

It is not really useful for other output backends and just results
in no outputs being enabled at all. (This is mainly an annoyance for
developers normally running with drm but occasionally nested.)

7 months agomenu: refactor parser
tokyo4j [Mon, 4 Aug 2025 03:55:13 +0000 (12:55 +0900)]
menu: refactor parser

...with the same approach as rcxml.c

- `If` actions now works for menus
- `name` argument no longer have to be the first argument of <action>
- `label` argument no longer have to be the first argument of <item>

7 months agoMake append_actions() public
tokyo4j [Mon, 4 Aug 2025 03:54:29 +0000 (12:54 +0900)]
Make append_actions() public

Also rename it to append_parsed_actions()

7 months agointeractive: allow snapping to corner edges
tokyo4j [Sat, 2 Aug 2025 12:35:51 +0000 (21:35 +0900)]
interactive: allow snapping to corner edges

In addition to <snapping><range>, <snapping><cornerRange> configures the
distance from the screen corner to trigger quater window snapping.

Also, new values "up-left", "up-right", "down-left" and "down-right" are
allowed for <action name="(Toggle)SnapToEdge" direction="[value]"> and
<query tiled="[value]">.

7 months agosrc/overlay.c: minor refactor
tokyo4j [Sat, 2 Aug 2025 12:35:34 +0000 (21:35 +0900)]
src/overlay.c: minor refactor

7 months agoview: don't use bitset for VIEW_EDGE_ALL
tokyo4j [Sat, 2 Aug 2025 12:11:12 +0000 (21:11 +0900)]
view: don't use bitset for VIEW_EDGE_ALL

We will use bitset for views snapped to corner (e.g. top-left = TOP|LEFT)

7 months agoview: refactor view_edge_parse()
tokyo4j [Sat, 2 Aug 2025 12:16:40 +0000 (21:16 +0900)]
view: refactor view_edge_parse()

7 months agomenu: fix segfault with toplevel <separator>
tokyo4j [Sun, 3 Aug 2025 07:55:59 +0000 (16:55 +0900)]
menu: fix segfault with toplevel <separator>

Before this patch, labwc crashed menu.xml like this:

<openbox_menu>
  <separator />
</openbox_menu>

7 months agocommon/xml: parse CDATA as text
tokyo4j [Sun, 3 Aug 2025 07:09:18 +0000 (16:09 +0900)]
common/xml: parse CDATA as text

Before this patch, <![CDATA[xxx]]> was ignored in many cases.

For example, this didn't work:

  <core>
    <gap><![CDATA[10]]></gap>
  </core>

7 months agocommon/xml: let LAB_XML_FOR_EACH() skip first child text nodes
tokyo4j [Sat, 2 Aug 2025 15:02:02 +0000 (00:02 +0900)]
common/xml: let LAB_XML_FOR_EACH() skip first child text nodes

Before this patch, first text nodes like the spaces between <a> and <b>
below were also travered by LAB_XML_FOR_EACH():

  <a>  <b>foo</b></a>

7 months agoaction: allow if-action without activator view
tokyo4j [Fri, 1 Aug 2025 07:15:00 +0000 (16:15 +0900)]
action: allow if-action without activator view

..in preparation for If/ForEach action with <prompt>, which should be
executed whether or not any window is focused.

This patch makes <If> actions execute <else> branch if no window is
focused or hovered.

7 months agoaction.c: split actions_run()
tokyo4j [Fri, 1 Aug 2025 07:06:58 +0000 (16:06 +0900)]
action.c: split actions_run()

7 months agoNEWS.md: update notes for 0.9.1
Johan Malm [Thu, 31 Jul 2025 20:37:03 +0000 (21:37 +0100)]
NEWS.md: update notes for 0.9.1

7 months agoTranslation updates from weblate
Weblate [Sat, 2 Aug 2025 08:01:19 +0000 (10:01 +0200)]
Translation updates from weblate

Co-authored-by: Dimitrios Glentadakis <dglent@free.fr>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: 이정희 <daemul72@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/el/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ko/
Translation: Labwc/labwc

7 months agooverlay: take into account <core><gap> for region overlay
tokyo4j [Sat, 5 Jul 2025 07:07:04 +0000 (16:07 +0900)]
overlay: take into account <core><gap> for region overlay

7 months agooverlay: take into account <core><gap> for edge overlay
tokyo4j [Sat, 5 Jul 2025 07:06:38 +0000 (16:06 +0900)]
overlay: take into account <core><gap> for edge overlay

This also deduplicates get_edge_snap_box() in interactive.c and
view_get_edge_snap_box() in view.c.

7 months agocursor: fix Scroll mousebinds not inhibited with ToggleKeybinds
tokyo4j [Sat, 2 Aug 2025 11:10:09 +0000 (20:10 +0900)]
cursor: fix Scroll mousebinds not inhibited with ToggleKeybinds

fixup for 024ab280

7 months agoinclude/edges.h: remove unimplemented function
tokyo4j [Sat, 2 Aug 2025 07:25:36 +0000 (16:25 +0900)]
include/edges.h: remove unimplemented function

7 months agoTranslation updates from weblate
Weblate [Wed, 30 Jul 2025 08:01:19 +0000 (10:01 +0200)]
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

7 months agoinclude: move a few types from labwc.h to better locations
John Lindgren [Sat, 26 Jul 2025 20:23:02 +0000 (16:23 -0400)]
include: move a few types from labwc.h to better locations

7 months agoinclude: reduce global includes in labwc.h
John Lindgren [Mon, 28 Jul 2025 05:22:10 +0000 (01:22 -0400)]
include: reduce global includes in labwc.h

7 months agoinclude: split output.h from labwc.h
John Lindgren [Sat, 26 Jul 2025 19:34:45 +0000 (15:34 -0400)]
include: split output.h from labwc.h

7 months agorcxml: simplify the logic to traverse xml tree
tokyo4j [Fri, 11 Apr 2025 19:20:02 +0000 (04:20 +0900)]
rcxml: simplify the logic to traverse xml tree

7 months agostring-helper: add str_space_only()
tokyo4j [Fri, 11 Apr 2025 20:06:08 +0000 (05:06 +0900)]
string-helper: add str_space_only()

7 months agorcxml: rewrite <tablet><map> parser
tokyo4j [Fri, 11 Apr 2025 18:21:13 +0000 (03:21 +0900)]
rcxml: rewrite <tablet><map> parser

7 months agorcxml: rewrite <theme><font> parser
tokyo4j [Fri, 11 Apr 2025 18:09:14 +0000 (03:09 +0900)]
rcxml: rewrite <theme><font> parser

7 months agorcxml: reorder functions
tokyo4j [Fri, 11 Apr 2025 17:50:05 +0000 (02:50 +0900)]
rcxml: reorder functions

7 months agorcxml: rewrite <windowRules> parser
tokyo4j [Fri, 11 Apr 2025 17:40:31 +0000 (02:40 +0900)]
rcxml: rewrite <windowRules> parser

7 months agorcxml: rewrite <windowSwitcher><fields> parser
tokyo4j [Fri, 11 Apr 2025 17:08:45 +0000 (02:08 +0900)]
rcxml: rewrite <windowSwitcher><fields> parser

7 months agorcxml: rewrite <region> parser
tokyo4j [Fri, 11 Apr 2025 16:48:11 +0000 (01:48 +0900)]
rcxml: rewrite <region> parser

7 months agorcxml: rewrite <libinput> parser
tokyo4j [Fri, 11 Apr 2025 16:40:39 +0000 (01:40 +0900)]
rcxml: rewrite <libinput> parser

7 months agorcxml: rewrite <touch> parser
tokyo4j [Fri, 11 Apr 2025 16:33:28 +0000 (01:33 +0900)]
rcxml: rewrite <touch> parser

7 months agorcxml: rewrite <margin> parser
tokyo4j [Fri, 11 Apr 2025 16:27:49 +0000 (01:27 +0900)]
rcxml: rewrite <margin> parser

7 months agorcxml: rewrite <mousebind> parser
tokyo4j [Fri, 11 Apr 2025 18:41:27 +0000 (03:41 +0900)]
rcxml: rewrite <mousebind> parser

7 months agorcxml: rewrite <keybind> parser
tokyo4j [Fri, 11 Apr 2025 18:32:37 +0000 (03:32 +0900)]
rcxml: rewrite <keybind> parser

7 months agorcxml: rewrite action parser
tokyo4j [Fri, 11 Apr 2025 15:57:03 +0000 (00:57 +0900)]
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.

7 months agocommon/xml: add helpers to parse rc.xml
tokyo4j [Fri, 11 Apr 2025 11:25:12 +0000 (20:25 +0900)]
common/xml: add helpers to parse rc.xml

7 months agorcxml: convert dotted properties into nested nodes before processing
tokyo4j [Wed, 9 Apr 2025 15:43:21 +0000 (00:43 +0900)]
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.

7 months agoCONTRIBUTING.md: add section on include order
John Lindgren [Tue, 29 Jul 2025 05:59:40 +0000 (01:59 -0400)]
CONTRIBUTING.md: add section on include order

7 months agoCONTRIBUTING.md: minor updates
John Lindgren [Tue, 29 Jul 2025 05:17:42 +0000 (01:17 -0400)]
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

7 months agosrc: include primary header first
John Lindgren [Mon, 28 Jul 2025 05:02:01 +0000 (01:02 -0400)]
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).

7 months agoinclude: add missing header dependencies
John Lindgren [Mon, 28 Jul 2025 05:03:22 +0000 (01:03 -0400)]
include: add missing header dependencies

Ensure that headers compile correctly regardless of include order.

7 months agoNEWS.md: update with notes on wlroots changes
Johan Malm [Mon, 28 Jul 2025 19:48:56 +0000 (20:48 +0100)]
NEWS.md: update with notes on wlroots changes

7 months agoFix some warnings from clang-tidy
tokyo4j [Mon, 28 Jul 2025 04:54:10 +0000 (13:54 +0900)]
Fix some warnings from clang-tidy

Notably this fixes a possible null pointer dereference in warp_cursor()
when output_nearest_to_cursor() returns null.

7 months agoTranslation updates from weblate
Weblate [Sat, 19 Jul 2025 18:47:42 +0000 (20:47 +0200)]
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

7 months agocursor: also toggle mousebinds with ToggleKeybinds
tokyo4j [Thu, 24 Jul 2025 02:08:03 +0000 (11:08 +0900)]
cursor: also toggle mousebinds with ToggleKeybinds

Mousebinds can still be applied when the cursor is over their decoration

7 months agoRemove seat->nr_inhibited_keybind_views
tokyo4j [Wed, 23 Jul 2025 16:18:36 +0000 (01:18 +0900)]
Remove seat->nr_inhibited_keybind_views

7 months agosrc/xdg.c: prevent interacting with un-initialized xdg toplevels after unmap
Consolatis [Sun, 27 Jul 2025 13:55:43 +0000 (15:55 +0200)]
src/xdg.c: prevent interacting with un-initialized xdg toplevels after unmap

Fixes: #2937
Fixes: #2944
Originally-Reported-By: tranzystorekk via IRC
7 months agostyle: remove newlines after wl_list_for_each_reverse()
tokyo4j [Sat, 26 Jul 2025 23:00:10 +0000 (08:00 +0900)]
style: remove newlines after wl_list_for_each_reverse()

7 months agomenu: add struct menu_parse_context to reduce static vars
John Lindgren [Sat, 19 Jul 2025 03:06:20 +0000 (23:06 -0400)]
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

7 months agocursor: prevent hi-res mice triggering scroll actions too often
tokyo4j [Mon, 21 Jul 2025 15:19:22 +0000 (00:19 +0900)]
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.

7 months agobuf: avoid 'new' as variable name
John Lindgren [Fri, 4 Jul 2025 04:17:18 +0000 (00:17 -0400)]
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++.

7 months agosession-lock: eliminate pointless compound literal
John Lindgren [Fri, 4 Jul 2025 04:45:59 +0000 (00:45 -0400)]
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.

7 months agosrc: put designated initializers in member order
John Lindgren [Fri, 4 Jul 2025 04:40:15 +0000 (00:40 -0400)]
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.

7 months agosrc: avoid tentative definitions of static data
John Lindgren [Fri, 4 Jul 2025 04:12:21 +0000 (00:12 -0400)]
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.

7 months agostring-helpers: remove restrict qualifier
John Lindgren [Fri, 4 Jul 2025 04:15:56 +0000 (00:15 -0400)]
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.

7 months agosrc: add braces to switch cases containing declarations
John Lindgren [Fri, 4 Jul 2025 04:42:25 +0000 (00:42 -0400)]
src: add braces to switch cases containing declarations

This limits the scope of the declarations to avoid accidents.