]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
6 months agoosd: split to osd.c and osd-classic.c
tokyo4j [Fri, 8 Aug 2025 03:29:08 +0000 (12:29 +0900)]
osd: split to osd.c and osd-classic.c

6 months agoMove osd.c and osd-field.c into src/osd
tokyo4j [Fri, 6 Dec 2024 10:08:27 +0000 (19:08 +0900)]
Move osd.c and osd-field.c into src/osd

6 months agossd: clean up scene management
tokyo4j [Wed, 13 Aug 2025 12:00:11 +0000 (21:00 +0900)]
ssd: clean up scene management

Our codebase for ssd scenes has grown with a lot of technical debts:
- We needed to call `ssd_get_part()` everywhere to get the scene node of a
  ssd part. We then needed to cast it to `wlr_scene_rect` and
  `wlr_scene_buffer`. This bloated our codebase and even blocked
  duplicated button types in `<titlebar><layout>`.
- `ssd_get_part_type()` was a dirty hack. It compared parent, grandparent
  and grandgrandparent of a node with each subtree in the ssd to get the
  part type of the node.

To resolve this issues, this commit changes how ssd scenes are managed:
- Access scene rects and scene buffers just as a member of `struct ssd`.
- `ssd_part` is now a attachment to a scene node that can be accessed via
  node_descriptor->data, with a new node-descriptor type
  `LAB_NODE_DESC_SSD_PART`. `LAB_NODE_DESC_SSD_BUTTON` is unified into it.

Now the scene graph under ssd->tree looks like below. The parentheses
indicate the type of ssd_part attached to the node:

ssd->tree (LAB_SSD_NONE)
+--titlebar (LAB_SSD_PART_TITLEBAR)
|  +--inactive
|  |  +--background bar
|  |  +--left corner
|  |  +--right corner
|  |  +--title (LAB_SSD_PART_TITLE)
|  |  +--iconify button (LAB_SSD_BUTTON_ICONIFY)
|  |  |  +--normal close icon image
|  |  |  +--hovered close icon image
|  |  |  +--...
|  |  +--window icon (LAB_SSD_BUTTON_WINDOW_ICON)
|  |  |  +--window icon image
|  |  +--...
|  +--active
|     +--...
+--border
|  +--inactive
|  |  +--top
|  |  +--...
|  +--active
|     +--top
|     +--...
+--shadow
|  +--inactive
|  |  +--top
|  |  +--...
|  +--active
|     +--top
|     +--...
+--extents
   +--top
   +--...

When hovering on SSD, `get_cursor_context()` traverses this scene node
from the leaf. If it finds a `ssd_part` attached to the node, it returns
`ssd_part_type` that represents the resizing direction, button types or
`Title`/`Titlebar`.

6 months agossd-extents: factor out resize_extent_within_usable()
tokyo4j [Wed, 13 Aug 2025 11:22:48 +0000 (20:22 +0900)]
ssd-extents: factor out resize_extent_within_usable()

6 months agossd-titlebar: create title buffer in ssd_titlebar_create()
tokyo4j [Wed, 13 Aug 2025 11:17:43 +0000 (20:17 +0900)]
ssd-titlebar: create title buffer in ssd_titlebar_create()

6 months agoNEWS.md: interim update
Johan Malm [Mon, 25 Aug 2025 15:11:50 +0000 (16:11 +0100)]
NEWS.md: interim update

6 months agoseat: improve debug logging when configuring input devices
John Lindgren [Wed, 27 Aug 2025 17:04:52 +0000 (13:04 -0400)]
seat: improve debug logging when configuring input devices

I needed to debug an input configuration issue and found the debug
output not-super-helpful, so I made some improvements:

- Print the name and "sysname" (e.g. event11) of the device being
  configured. Note that the name alone isn't enough since there can
  be multiple identically-named devices.

- Print the config category matched for each device.

- Print the config values (if any) being applied. For enums, only the
  numeric value is printed since I'm lazy.

- Don't print "pointer acceleration configured" if neither a pointer
  speed nor acceleration profile is configured (it's confusing).

6 months agotree-wide: use enum types/constants where appropriate
John Lindgren [Wed, 27 Aug 2025 03:48:05 +0000 (23:48 -0400)]
tree-wide: use enum types/constants where appropriate

- add LAB_WINDOW_TYPE_INVALID in place of literal -1
- document more clearly that enum lab_view_criteria is a bitset
- other one-off replacements of integer values/types for consistency

Note: variables of type enum lab_view_criteria are already used
extensively throughout the code to contain combinations of the declared
enum values. I am not introducing any new usage here, just changing the
single uint32_t to be consistent with all the other usages.

6 months agocommon: flesh out enum lab_edge and prefer over wlr_edges/wlr_direction
John Lindgren [Wed, 27 Aug 2025 00:27:34 +0000 (20:27 -0400)]
common: flesh out enum lab_edge and prefer over wlr_edges/wlr_direction

I like the new common/edge.h. I don't like how inconsistently we use it.

Current situation:

 - enum wlr_edges and wlr_direction are designed to be used as bitset,
   and are defined compatibly

 - enum lab_edge is *also* designed to be used as bitset, but
   incompatible with the others (LEFT/RIGHT come before UP/DOWN)

 - we use an inconsistent mix of all three *AND* uint32_t (usually with
   the WLR_EDGE constants rather than the LAB_EDGE constants), and
   convert between them on an ad-hoc basis, sometimes implicitly

Let's clean this up:

 - reorder enum lab_edge to be compatible with the two wlr enums
   (check this by static_assert)

 - use TOP/BOTTOM naming rather than UP/DOWN (matches wlr_edges)

 - add constants for the remaining possible combinations of the 4 edges

 - use lab_edge for all internal edge/direction fields, consistently

 - add lab_edge_is_cardinal() as a sanity check before casting to
   enum wlr_direction, and then eliminate all of direction.c/h

Instead of "enum wlr_edges direction", we now have
"enum lab_edge direction" which is not that much better. At least we
are now clear that we're overloading one enum with two meanings.

6 months agomenu: add brackets around minimised window titles in client-list menu (#3002)
David Barr [Tue, 26 Aug 2025 20:08:31 +0000 (21:08 +0100)]
menu: add brackets around minimised window titles in client-list menu (#3002)

6 months agoaction: add toggle for GoToDesktop
Rainer Kuemmerle [Sat, 8 Mar 2025 18:28:57 +0000 (19:28 +0100)]
action: add toggle for GoToDesktop

Adds an option "toogle" to GoToDesktop.
In case the target is already where we are, we go back to the last desktop
instead.

Example of rc.xml

<keybind key="C-F1">
  <action name="GoToDesktop">
    <to>1</to>
    <toggle>yes</toggle>
  </action>
</keybind>

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