]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
5 months agoRemove unused function lab_xml_get_node()
Johan Malm [Thu, 25 Sep 2025 18:36:37 +0000 (19:36 +0100)]
Remove unused function lab_xml_get_node()

5 months agoRemove unused function trim_last_field()
Johan Malm [Thu, 25 Sep 2025 18:35:22 +0000 (19:35 +0100)]
Remove unused function trim_last_field()

5 months agoRemove unused function node_layer_popup_from_node()
Johan Malm [Thu, 25 Sep 2025 18:33:55 +0000 (19:33 +0100)]
Remove unused function node_layer_popup_from_node()

5 months agoRemove unused function output_max_scale()
Johan Malm [Thu, 25 Sep 2025 18:27:01 +0000 (19:27 +0100)]
Remove unused function output_max_scale()

5 months agoRemove unused function scaled_font_buffer_set_max_width()
Johan Malm [Thu, 25 Sep 2025 18:25:51 +0000 (19:25 +0100)]
Remove unused function scaled_font_buffer_set_max_width()

5 months agoRemove unused function menu_call_actions()
Johan Malm [Thu, 25 Sep 2025 18:24:52 +0000 (19:24 +0100)]
Remove unused function menu_call_actions()

5 months agorcxml.h: minor tweaks to order of variables
Johan Malm [Wed, 24 Sep 2025 19:16:37 +0000 (20:16 +0100)]
rcxml.h: minor tweaks to order of variables

5 months agolabwc-config(5): document <promptCommand>
Johan Malm [Tue, 23 Sep 2025 18:26:52 +0000 (19:26 +0100)]
labwc-config(5): document <promptCommand>

5 months agoconfig: add `<core><promptCommand>`
Johan Malm [Mon, 22 Sep 2025 17:32:42 +0000 (18:32 +0100)]
config: add `<core><promptCommand>`

...to enable configuration of the action prompt command.

Also set some better defaults for labnag.

The new default command is:

    labnag \
        --message '%m' \
        --button-dismiss '%n' \
        --button-dismiss '%y' \
        --background '%b' \
        --text '%t' \
        --border '%t' \
        --border-bottom '%t' \
        --button-background '%b' \
        --button-text '%t' \
        --border-bottom-size 1 \
        --button-border-size 3 \
        --timeout 0

...where the conversion specifiers are defined as follows:

    %m: the `<prompt>` message option
    %n: _("No")
    %y: _("Yes")
    %b: osd.bg.color
    %t: osd.label.text.color

This config options also enables the use of a different dialog client, for
example like this:

    <core>
      <promptCommand>zenity --question --text="%m"</promptCommand>
    </core>

5 months agolabnag: fix segfault caused by providing --timeout as long option
Johan Malm [Tue, 23 Sep 2025 18:27:45 +0000 (19:27 +0100)]
labnag: fix segfault caused by providing --timeout as long option

5 months agofont: remove 4px padding on the right
tokyo4j [Sun, 21 Sep 2025 11:40:49 +0000 (20:40 +0900)]
font: remove 4px padding on the right

Added `menu.items.padding.x` padding between item text and arrow instead.

Replaced `if (!string)` with `if (string_null_or_empty(string))` in
`font_extents()` just as a minor optimization.

5 months agoREADME.md: remove high-level scope summary
Johan Malm [Fri, 19 Sep 2025 19:50:03 +0000 (20:50 +0100)]
README.md: remove high-level scope summary

...as it is very old and not relevant anymore.

5 months agodefault-bindings.h: set combine="yes" for SnapToEdge keybinds
tokyo4j [Wed, 17 Sep 2025 07:25:32 +0000 (16:25 +0900)]
default-bindings.h: set combine="yes" for SnapToEdge keybinds

5 months agoaction: allow SnapToEdge to combine two cardinal directions
tokyo4j [Fri, 5 Sep 2025 03:14:52 +0000 (12:14 +0900)]
action: allow SnapToEdge to combine two cardinal directions

This patch adds `combine` argument to (Toggle)SnapToEdge actions.
This allows to snap a window to e.g. up-left by running two actions:
- `<action name="SnapToEdge" direction="left" combine="yes" />`
- `<action name="SnapToEdge" direction="up" combine="yes" />`

Then running `<action name="SnapToEdge" direction="down" combine="yes" />`
snaps it to left again. This behavior is almost the same as KWin, except
that snapping a up-right-tiled window to right doesn't move it to the
right-adjacent output, but makes it right-tiled first.

5 months agoview: remove an obsolete code in view_snap_to_edge()
tokyo4j [Sun, 14 Sep 2025 18:54:40 +0000 (03:54 +0900)]
view: remove an obsolete code in view_snap_to_edge()

We no longer need to call view_apply_tiled_geometry() there, since we now
clear view->tiled when dragging a tiled window since 9f51384.

5 months agolibsfdo.wrap: update revision to v0.1.4
Johan Malm [Thu, 18 Sep 2025 20:39:30 +0000 (21:39 +0100)]
libsfdo.wrap: update revision to v0.1.4

5 months agoREADME.md: remove yambar reference as discontinued
Johan Malm [Wed, 17 Sep 2025 20:12:08 +0000 (21:12 +0100)]
README.md: remove yambar reference as discontinued

5 months agoUpdate labwc-actions.5.scd
cunlem [Tue, 16 Sep 2025 18:48:20 +0000 (18:48 +0000)]
Update labwc-actions.5.scd

5 months agoNEWS.md: interim update
Johan Malm [Mon, 15 Sep 2025 18:31:05 +0000 (19:31 +0100)]
NEWS.md: interim update

5 months agoview: fix <query monitor="current|left|right" />
tokyo4j [Sun, 14 Sep 2025 18:31:56 +0000 (03:31 +0900)]
view: fix <query monitor="current|left|right" />

Before this commit, <else> branch was always executed with
monitor="current", monitor="left" or monitor="right" queries.

For example:

<action name="If">
  <query monitor="current" />
  <then>
    <action />
  </then>
  <else>
    <action />
  </else>
</action>

5 months agoclang-format: tweak to match existing code a little better
John Lindgren [Tue, 9 Sep 2025 00:34:27 +0000 (20:34 -0400)]
clang-format: tweak to match existing code a little better

"clang-format -i src/view.c" before:
  1 file changed, 204 insertions(+), 169 deletions(-)

"clang-format -i src/view.c" after:
  1 file changed, 181 insertions(+), 146 deletions(-)

5 months agorcxml: use const char* for string literals
John Lindgren [Tue, 9 Sep 2025 00:10:42 +0000 (20:10 -0400)]
rcxml: use const char* for string literals

5 months agoosd-thumbnail: put designated initializers in order
John Lindgren [Sun, 7 Sep 2025 03:31:38 +0000 (23:31 -0400)]
osd-thumbnail: put designated initializers in order

5 months agointeractive: add braces around case containing declaration
John Lindgren [Sun, 7 Sep 2025 03:31:00 +0000 (23:31 -0400)]
interactive: add braces around case containing declaration

5 months agorcxml: use fixed arrays for rc.title_buttons_*
John Lindgren [Tue, 9 Sep 2025 02:35:23 +0000 (22:35 -0400)]
rcxml: use fixed arrays for rc.title_buttons_*

These are just lists of enum lab_node_type, with a bounded size and
no middle-insertions/removals, so linked lists are overkill.

Also, the use of wl_list_for_each[_reverse] just to access the first or
last entry in the list (corner button) was weird.

5 months agoCONTRIBUTING.md: fix some typos, lots of Oxford commas
thatonecoder (formerly Coccocoa's Helper) [Thu, 11 Sep 2025 07:47:31 +0000 (08:47 +0100)]
CONTRIBUTING.md: fix some typos, lots of Oxford commas

The primary change is “Github”/“github” ⇾ “GitHub”, but there are plenty of others.

5 months agolabwc-config(5): add example for autoEnableOutputs
Johan Malm [Tue, 9 Sep 2025 20:21:04 +0000 (21:21 +0100)]
labwc-config(5): add example for autoEnableOutputs

...with inspiration from example in #3059 by @jlindgren90

5 months agodesktop: refactor get_cursor_context()
tokyo4j [Mon, 8 Sep 2025 17:56:37 +0000 (02:56 +0900)]
desktop: refactor get_cursor_context()

This patch should not change any behaviors.

This clarifies the semantics of cursor_context returned by
get_cursor_context() as I described in cursor.h; when cursor is on a
subsurface (e.g. xdg/x11/layer/session-lock), the returned ctx.surface
and ctx.node points to the subsurface rather than its parent.

5 months agodesktop: let get_cursor_context() return layer-popup subsurface
tokyo4j [Mon, 8 Sep 2025 17:53:31 +0000 (02:53 +0900)]
desktop: let get_cursor_context() return layer-popup subsurface

With this change, when a layer-popup has a subsurface and cursor is on
it, wl_pointer.enter/motion events are sent to the subsurface rather
than its parent layer-popup surface. I think this follows wayland spec
more closely.

Tested with my demo: https://github.com/tokyo4j/wayland-demo/tree/layer-popup

5 months agodesktop: don't use LAB_NODE_LAYER_SUBSURFACE node type
tokyo4j [Mon, 8 Sep 2025 17:51:33 +0000 (02:51 +0900)]
desktop: don't use LAB_NODE_LAYER_SUBSURFACE node type

Instead, set ctx.type = LAB_NODE_LAYER_SURFACE for both layer-surfaces
and layer-subsurfaces.

This patch preserves the existing behaviors:
- Pressing a subsurface of an on-demand layer-surface gives pointer
  focus to the subsurface, but gives keyboard focus to the parent
  layer-surface (related: a5fcbfaf).
- Pressing a subsurface of a layer-surface doesn't close a popup
  (related: a89bcc3c).

5 months agossd: attach LAB_NODE_SSD_ROOT to ssd->tree
tokyo4j [Sun, 7 Sep 2025 12:48:51 +0000 (21:48 +0900)]
ssd: attach LAB_NODE_SSD_ROOT to ssd->tree

This doesn't change any behaviors.

Attaching LAB_NODE_NONE node-descriptor to ssd->tree looks strange, this
patch uses new LAB_NODE_SSD_ROOT instead. The node-descriptor attached to
ssd->tree is needed for get_cursor_context() to detect cursor hovering on
borders/extents.

I also updated get_cursor_context() to make my intent clearer.

5 months agooutput: remove node descriptors
tokyo4j [Sun, 7 Sep 2025 12:47:08 +0000 (21:47 +0900)]
output: remove node descriptors

5 months agoscaled-buffer: remove *_from_node() functions
tokyo4j [Sun, 7 Sep 2025 12:45:29 +0000 (21:45 +0900)]
scaled-buffer: remove *_from_node() functions

5 months agodesktop.c: don't print errors when cursor is on resize-indicator
tokyo4j [Sun, 7 Sep 2025 13:10:27 +0000 (22:10 +0900)]
desktop.c: don't print errors when cursor is on resize-indicator

In f347a81, I thought there are only window contents and SSD under
`view->scene_tree` and forgot about the resize-indicator.

I also refactored the logic around it:
- Remove `ret.node->type == WLR_SCENE_NODE_BUFFER` check since it's
  already done by `lab_wlr_surface_from_node()`
- Eliminate duplicated call to `lab_wlr_surface_from_node()`

5 months agosrc/output.c: restore drm lease include
Consolatis [Sun, 7 Sep 2025 14:47:58 +0000 (16:47 +0200)]
src/output.c: restore drm lease include

Introduced in #3062.

Its usage is guarded by a wlroots version check
which prevented the CI to detect the issue.

When compiled with a wlroots version > 0.19.0
(like the chase 0.20 PR) the error shows up.

5 months agotree-wide: use forward declarations for wlr types
John Lindgren [Sun, 7 Sep 2025 00:06:32 +0000 (20:06 -0400)]
tree-wide: use forward declarations for wlr types

5 months agosrc: remove unused #includes (via include-what-you-use)
John Lindgren [Wed, 3 Sep 2025 03:19:38 +0000 (23:19 -0400)]
src: remove unused #includes (via include-what-you-use)

5 months agoinclude: reduce unnecessary #includes
John Lindgren [Wed, 3 Sep 2025 03:02:27 +0000 (23:02 -0400)]
include: reduce unnecessary #includes

5 months agoarray: use die_if_null() from common/mem.c
John Lindgren [Wed, 3 Sep 2025 04:00:01 +0000 (00:00 -0400)]
array: use die_if_null() from common/mem.c

5 months agoidle_manager: remove unused parameter and field
John Lindgren [Thu, 21 Aug 2025 04:26:27 +0000 (00:26 -0400)]
idle_manager: remove unused parameter and field

wlr_seat isn't used anywhere.

5 months agoTranslation updates from weblate
Weblate [Sat, 6 Sep 2025 04:27:30 +0000 (06:27 +0200)]
Translation updates from weblate

Co-authored-by: virtual-hand <handvirtual@tutamail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt_BR/
Translation: Labwc/labwc

5 months agossd: update comments referencing ssd_part/ssd_part_type
John Lindgren [Sat, 6 Sep 2025 18:04:21 +0000 (14:04 -0400)]
ssd: update comments referencing ssd_part/ssd_part_type

5 months agossd: unify struct ssd_part with struct node_descriptor
John Lindgren [Wed, 3 Sep 2025 09:32:44 +0000 (05:32 -0400)]
ssd: unify struct ssd_part with struct node_descriptor

struct ssd_part and struct node_descriptor seem to have essentially the
same purpose: tag a wlr_scene_node with some extra data indicating what
we're using it for.

Also, as with enum ssd_part_type (now lab_node_type), ssd_part is used
for several types of nodes that are not part of SSD.

So instead of the current chaining (node_descriptor -> ssd_part), let's
flatten/unify the two structs.

In detail:

- First, merge node_descriptor_type into lab_node_type.
- Add a separate view pointer in node_descriptor, since in the case of
  SSD buttons we need separate view and button data pointers.
- Rename ssd_part_button to simply ssd_button. It no longer contains
  an ssd_part as base.
- Add node_try_ssd_button_from_node() which replaces
  node_ssd_part_from_node() + button_try_from_ssd_part().
- Factor out ssd_button_free() to be called in node descriptor destroy.
- Finally, get_cursor_context() needs a little reorganization to handle
  the unified structs.

Overall, this simplifies the code a bit, and in my opinion makes it
easier to understand. No functional change intended.

5 months agossd: eliminate ssd_hover_state (addressing a FIXME)
John Lindgren [Wed, 3 Sep 2025 05:20:53 +0000 (01:20 -0400)]
ssd: eliminate ssd_hover_state (addressing a FIXME)

5 months agocommon: add node-type.c/h (renaming ssd_part_type to lab_node_type)
John Lindgren [Wed, 3 Sep 2025 09:08:52 +0000 (05:08 -0400)]
common: add node-type.c/h (renaming ssd_part_type to lab_node_type)

ssd_part_type contains several node types that are not actually part of
server-side decorations (ROOT, MENU, OSD, etc.)

Rename it accordingly and move it to a common location, along with some
related conversion/comparison functions.

5 months agotheme: fix spelling of LAB_BS_HOVERED
John Lindgren [Sat, 6 Sep 2025 15:43:48 +0000 (11:43 -0400)]
theme: fix spelling of LAB_BS_HOVERED

5 months agossd-titlebar: don't bind ssd_part to ssd->tree
tokyo4j [Sat, 6 Sep 2025 18:42:50 +0000 (03:42 +0900)]
ssd-titlebar: don't bind ssd_part to ssd->tree

Fixes up f347a81. This mistake didn't cause misbehaviors because the
ssd_part bound to ssd->tree is just a placeholder to let
get_cursor_context() call ssd_get_resizing_type() when the cursor is on
border/extents.

6 months agoview.c: remove cruft in view_apply_maximized_geometry()
tokyo4j [Thu, 4 Sep 2025 09:44:38 +0000 (18:44 +0900)]
view.c: remove cruft in view_apply_maximized_geometry()

6 months agodefault-bindings.h: focus & raise on border press
Johan Malm [Mon, 1 Sep 2025 19:56:51 +0000 (20:56 +0100)]
default-bindings.h: focus & raise on border press

...because it is probably what most people expect and it makes the
behavior consistent with that of Openbox.

Fixes: #3039
6 months agolabnag: s/nag/labnag/ in usage string
Johan Malm [Wed, 3 Sep 2025 19:30:22 +0000 (20:30 +0100)]
labnag: s/nag/labnag/ in usage string

Fixes #3051

6 months agoscaled-scene-buffer: restructure source files
tokyo4j [Tue, 2 Sep 2025 08:47:01 +0000 (17:47 +0900)]
scaled-scene-buffer: restructure source files

- Rename `scaled_scene_buffer` to `scaled_buffer`. This makes it clear
  that `scaled_{font,img,icon}_buffers` are implementations of it.
- Move the files from `src/common` to `src/scaled-buffer` as
  `scaled_icon_buffer` heavily depends on `server` and `view` etc.

6 months agomousebind: support `Border` context
tokyo4j [Mon, 1 Sep 2025 23:32:23 +0000 (08:32 +0900)]
mousebind: support `Border` context

This new context includes `Top`...`BRCorner` and makes it easier to modify
the mousebinds bound to them.

6 months agoNEWS.md: link from TOC to each section
Johan Malm [Mon, 1 Sep 2025 19:47:05 +0000 (20:47 +0100)]
NEWS.md: link from TOC to each section

6 months agointeractive: un-maximize only axes that are being resized
John Lindgren [Mon, 1 Sep 2025 16:07:52 +0000 (12:07 -0400)]
interactive: un-maximize only axes that are being resized

When resizing in only one axis (horizontal/vertical), there's no reason
to un-maximize the other axis.

Supporting logic was landed in the previous commit and in ebd39dfe0d1d
(which fixed the client-initiated resize case), so all that remains is
to make a small change in interactive_begin().

6 months agoview: expose view_set_maximized() instead of view_restore_to()
John Lindgren [Mon, 1 Sep 2025 15:49:24 +0000 (11:49 -0400)]
view: expose view_set_maximized() instead of view_restore_to()

view_restore_to() (which is just set_maximized() + view_move_resize())
hasn't aged well and doesn't line up with typical usage anymore:

 - it's missing view_set_untiled(), which has to be called separately
 - it always forces view_move_resize() even when that's not needed
 - it doesn't allow un-maximizing only one axis (see next commit)
 - the fullscreen check is unnecessary (already checked in callers)

Eliminate it and just expose view_set_maximized() instead.

No functional change intended in this commit.

6 months agoview: restore initially-maximized window position after unplug/plug
tokyo4j [Mon, 1 Sep 2025 08:52:06 +0000 (17:52 +0900)]
view: restore initially-maximized window position after unplug/plug

`update_last_layout_geometry()` stores `view->natural_geometry` in
`view->last_layout_geometry`, but it's empty for initially-maximized
windows, so their positions were not restored after outputs are
unplugged and plugged (also when VT switching in wlroots 0.19.0).

This commit sets the fallback natural geometry (at the center of the
output) so that initially-maximized windows reappears in the same output.

6 months agoview: let `view_set_fallback_natural_geometry()` return wlr_box
tokyo4j [Mon, 1 Sep 2025 08:04:41 +0000 (17:04 +0900)]
view: let `view_set_fallback_natural_geometry()` return wlr_box

6 months agoview: use fixed default window width
tokyo4j [Mon, 1 Sep 2025 08:29:24 +0000 (17:29 +0900)]
view: use fixed default window width

Now it's not very reasonable to determine the default window width based
on the titlebar geometry, as the titlebar can be shrunk to 1px.

Let's use the fixed value of 100px for simplification.

6 months agoview.c: remove outdated comment
tokyo4j [Mon, 1 Sep 2025 08:16:53 +0000 (17:16 +0900)]
view.c: remove outdated comment

Since a5d89a2, xdg-shell views can request very small window geometry.

6 months agooverlay: refactor
tokyo4j [Sat, 30 Aug 2025 19:41:08 +0000 (04:41 +0900)]
overlay: refactor

- Use a single `lab_scene_rect` for both overlay background and outlines,
  like I described in the TODO comment in ffd4005.
- Simplify the resource management by destroying the overlay tree when
  it's hidden. I think its overhead is pretty minimal.
- Share a single `lab_scene_rect` for both region/edge overlays.

6 months agooverlay.h: reduce included headers
tokyo4j [Sat, 30 Aug 2025 19:38:36 +0000 (04:38 +0900)]
overlay.h: reduce included headers

6 months agodocs/labnag.1.scd: fix missed escape
01micko [Sat, 30 Aug 2025 11:51:14 +0000 (21:51 +1000)]
docs/labnag.1.scd: fix missed escape

6 months agodocs/labnag.1.scd: add a labnag example
01micko [Sat, 30 Aug 2025 10:17:43 +0000 (20:17 +1000)]
docs/labnag.1.scd: add a labnag example

6 months agomeson.build: move lab-sensible-terminal install routine.
01micko [Sat, 30 Aug 2025 10:09:31 +0000 (20:09 +1000)]
meson.build: move lab-sensible-terminal install routine.
Moved to clients/meson.build as per the comment in meson.build.

6 months agoscaled-icon-buffer: fix large client-side icon not being loaded
tokyo4j [Sat, 30 Aug 2025 05:13:59 +0000 (14:13 +0900)]
scaled-icon-buffer: fix large client-side icon not being loaded

This commit fixes that client-side icons were not loaded when the rendered
icon size is larger than icon sizes from the client. This bug has become
more likely to happen due to the new thumnail-style window switcher.

The cause was `abs(INT_MIN)` becomes `INT_MIN` due to integer overflow.

6 months agoosd: support window switcher with thumbnails
tokyo4j [Fri, 8 Aug 2025 05:53:34 +0000 (14:53 +0900)]
osd: support window switcher with thumbnails

The new-style window switcher can be enabled with
<windowSwitcher style="thumbnail">.

New theme entries:

osd.window-switcher.style-thumbnail.width.max: 80%
osd.window-switcher.style-thumbnail.padding: 4
osd.window-switcher.style-thumbnail.item.width: 300
osd.window-switcher.style-thumbnail.item.height: 250
osd.window-switcher.style-thumbnail.item.padding: 10
osd.window-switcher.style-thumbnail.item.active.border.width: 2
osd.window-switcher.style-thumbnail.item.active.border.color: #589bda
osd.window-switcher.style-thumbnail.item.active.bg.color: #c7e2fc
osd.window-switcher.style-thumbnail.item.icon.size: 60

6 months agotheme: move osd.window-switcher.* to osd.window-switcher.style-classic.*
tokyo4j [Fri, 8 Aug 2025 03:42:41 +0000 (12:42 +0900)]
theme: move osd.window-switcher.* to osd.window-switcher.style-classic.*

Backward compatibility is preserved.

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.