]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
14 months agosrc/server.c: delete a comment which was missed to erase
tokyo4j [Sat, 4 Jan 2025 08:37:52 +0000 (17:37 +0900)]
src/server.c: delete a comment which was missed to erase

14 months agoimg: apply padding around window icon only horizontally
tokyo4j [Sat, 4 Jan 2025 07:50:21 +0000 (16:50 +0900)]
img: apply padding around window icon only horizontally

16dbdc64 changed the padding around the app icon in the titlebar to be
applied both vertically and horizontally rather than only horizontally
because it was more natural from a developer's perspective, but some users
complained about the smaller icons in certain configurations.

So let's undo the change in 16dbdc64 and apply the icon padding only
horizontally for now.

We can add configurations for the icon padding (or icon size independent
from window.button.{width,height}?) later.

14 months agoimg: fix UAF on Reconfigure by refcounting
tokyo4j [Fri, 3 Jan 2025 15:05:12 +0000 (00:05 +0900)]
img: fix UAF on Reconfigure by refcounting

Before this commit, there was a use-after-free bug on Reconfigure:
- theme_finish() destroys lab_imgs for titlebar icons
- For some reason, undecorate() calls _create_buffer() in
  scaled-img-buffer.c, which calls img_render() on a destroyed lab_img.

So in this commit, the lifetime of lab_img is expanded to when the
scaled_img_buffers referencing it are all destroyed. This is achieved by
calling lab_img_copy() when setting a lab_img to scaled_img_buffer and
calling lab_img_destroy() when clearing a lab_img.

Now that scaled_img_buffer.img are always different, lab_img_equal() is
added to compare the content of scaled_img_buffer.img.

14 months agoimg: remove "theme" member from lab_img
tokyo4j [Fri, 3 Jan 2025 14:57:40 +0000 (23:57 +0900)]
img: remove "theme" member from lab_img

lab_img.theme member was referenced by "modifier" functions when drawing a
hover effect on button buffers or rounding the button buffer for corner
buttons, but this can be prone to use-after-free and was not very clean
because theme and lab_img were referencing each other.

Instead, let's just reference rc.theme in the modifier functions and
remove theme from lab_img.

14 months agomenu: support pipemenu with the toplevel <menu> element
Johan Malm [Mon, 14 Oct 2024 18:46:03 +0000 (19:46 +0100)]
menu: support pipemenu with the toplevel <menu> element

For example:

    <?xml version="1.0"?>
    <openbox_menu>
      <menu id="root-menu" label="" execute="obmenu-generator"/>
    </openbox_menu>

Fixes: #2238
Co-Authored-By: @Consolatis
14 months agoAdd default Alt-Shift-Tab keybind for PreviousWindow
tokyo4j [Tue, 31 Dec 2024 02:02:24 +0000 (11:02 +0900)]
Add default Alt-Shift-Tab keybind for PreviousWindow

14 months agoosd: make window switcher more Openbox-like in terms of key precessing
tokyo4j [Tue, 31 Dec 2024 01:17:05 +0000 (10:17 +0900)]
osd: make window switcher more Openbox-like in terms of key precessing

Before this commit, keystrokes were interpreted based on following
hard-coded rules while the window switcher is active:

  1. Up/Left arrow keys cycle the window forward.
  2. Down/Right arrow keys cycle the window backward.
  3. Other keystrokes cycle the window in the initial direction specified
     by NextWindow/PreviousWindow actions. But while Shift key is pressed,
     the direction is inverted.

...and keybind actions were never executed.

However, this lead to a counter-intuitive behavior for new, especially
pre-Openbox users. For example, in the following keybinds, after the user
activates the window switcher with Super+n, Super+p cycles the window
_forward_:

  <keybind key="W-n">
    <action name="NextWindow" />
  </keybind>
  <keybind key="W-p">
    <action name="PreviousWindow" />
  </keybind>

This is because the key 'n' is recognized just as a normal key in the
third hard-coded rule.

So this commit changes the rules to be more Openbox-like:

  1. Up/Left arrow keys cycles the window forward.
  2. Down/Right arrow keys cycles the window backward.
  3. Other keystrokes are matched against keybinds and execute their
     actions. If they include NextWindow/PreviousWindow action, it cycles
     the selected window forward/backward even while the window switcher
     is active.

14 months agoTranslation updates from weblate
Weblate [Wed, 1 Jan 2025 21:01:21 +0000 (22:01 +0100)]
Translation updates from weblate

Co-authored-by: NorwayFun <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ka/
Translation: Labwc/labwc

14 months agooutput: ignore wlr_output_state.mode/custom_mode except for client request
John Lindgren [Wed, 1 Jan 2025 10:18:41 +0000 (05:18 -0500)]
output: ignore wlr_output_state.mode/custom_mode except for client request

The wlr_output_state passed to the new_output signal sometimes has a
non-preferred mode set, which we were ignoring before 03be489eb973.
Ignore it again to prevent the wrong mode from being set.

14 months agooutput: add debugging output to output_test_mode()
John Lindgren [Wed, 1 Jan 2025 09:23:48 +0000 (04:23 -0500)]
output: add debugging output to output_test_mode()

14 months agoCI: add non-feature (svg, libsfdo, xwayland) build for arch
Consolatis [Tue, 31 Dec 2024 00:12:23 +0000 (01:12 +0100)]
CI: add non-feature (svg, libsfdo, xwayland) build for arch

14 months agorcxml: add core.autoEnableOutputs option
John Lindgren [Fri, 27 Dec 2024 20:13:12 +0000 (15:13 -0500)]
rcxml: add core.autoEnableOutputs option

Currently, labwc automatically enables outputs at startup and when new
outputs are connected. Make this behavior optional (but still enabled by
default).

With autoEnableOutputs disabled, tools such as kanshi can be used to
give finer-grained control of which outputs are enabled and when.

14 months agooutput: handle outputs that are enabled but not yet added
John Lindgren [Fri, 27 Dec 2024 21:05:40 +0000 (16:05 -0500)]
output: handle outputs that are enabled but not yet added

output_config_apply() currently assumes that any enabled outputs have
already been added to the wlr_output_layout. However, at startup,
wlroots will report that outputs are enabled if they were previously in
use by e.g. the Linux console - but they are not yet in the layout.

output_config_apply() never encountered this case before now because the
initial modeset was performed by another code path, but now with the new
autoEnableOutputs option (next commit), it needs to be able to handle
the initial modeset as well.

14 months agooutput: auto-select mode when enabling output by client request
John Lindgren [Sun, 20 Oct 2024 18:17:19 +0000 (14:17 -0400)]
output: auto-select mode when enabling output by client request

If e.g. kanshi requests us to enable an output but does not specify the
mode, and the output has not previously been modeset, then the width +
height + refresh rate will all be zero. In this case, we should select
the best mode just as when auto-configuring a new output.

We need to do the mode auto-selection in both the test & commit stages
for consistency, so factor out a new output_test_auto() function to help
with this.

Remove a guard against a refresh rate of zero, which was a workaround
for wlroots 0.17 and is no longer needed -- it is incompatible with mode
auto-selection since the refresh rate is zero in that case.

14 months agokeyboard: do not set numlock by default
Johan Malm [Tue, 31 Dec 2024 15:25:31 +0000 (15:25 +0000)]
keyboard: do not set numlock by default

Only force on|off if users specifically requests it in the config file.

Related-to: #2463
14 months agoMake enum three_state public
Johan Malm [Tue, 31 Dec 2024 15:21:47 +0000 (15:21 +0000)]
Make enum three_state public

14 months agokeyboard: cancel keybind_repeat on reconfigure
Consolatis [Mon, 30 Dec 2024 23:52:55 +0000 (00:52 +0100)]
keyboard: cancel keybind_repeat on reconfigure

Currently we may end up in an endless loop of Reconfigure requests
if the Reconfigure action was called by a keybind. If the reconfigure
takes too long (which may happen on slow systems with libsfdo full
debug logging for example) the reconfigure might be triggered again
and again.

To prevent that, simply cancel all keybind_repeat timers on reconfigure.

14 months agoRemove cruft related to window switcher and keyboard focus
tokyo4j [Tue, 31 Dec 2024 04:00:32 +0000 (13:00 +0900)]
Remove cruft related to window switcher and keyboard focus

This commit cleans up the comments and cruft from e45fe08.

Background:

- With e45fe08, the keyboard focus is always moved to the switched window
  on finishing window switcher, even with <focus followMouse="yes">.
  Since followMouseRequiresMovement was not implemented at that time
  (behaved like it was always "no"), e45fe08 was necessary to allow users
  users who use followMouse="yes" to move the keyboard focus with window
  switcher.
9a9e20d added followMouseRequiresMovement, but it kept the behavior
  described above even with followMouse="yes" and
  followMouseRequiresMovement="no".
398b80b accidentally invalidated e45fe08, which means the keyboard focus
  is now always moved to the window below the cursor on finishing window
  switcher with followMouse="yes" and followMouseRequiresMovement="no".

Although the invalidation was a accident, I think always setting the
keyboard focus on the window below the cursor is what users expect from
followMouse="yes" and followMouseRequiresMovement="no".

14 months agodesktop-entry: demote libsfdo error-logging
Johan Malm [Fri, 27 Dec 2024 22:19:35 +0000 (22:19 +0000)]
desktop-entry: demote libsfdo error-logging

...to WLR_INFO to avoid logging issues with .desktop files as errors, for
example:

    [sfdo-desktop] 1:1: Name is unset
    [sfdo-desktop] Failed to load /usr/share/applications/lxqt-panel.desktop
    [sfdo-desktop] 1:1: Exec is unset while DBusActivatable is unset or false
    [sfdo-desktop] Failed to load /usr/share/applications/qemu.desktop

Also make libsfdo debug/info logging depend on environment variable
LABWC_DEBUG_LIBSFDO being set to avoid disproportionately verbose logging
by default for one particular sub-system.

Add an 'ENVIRONMENT VARIABLES' section to labwc(1) to describe the above
as well as other hitherto undocumented env vars with prefix LABWC_DEBUG_.

14 months agosrc/debug.c: fix inverted string_null_or_empty() check
Consolatis [Mon, 30 Dec 2024 22:32:09 +0000 (23:32 +0100)]
src/debug.c: fix inverted string_null_or_empty() check

Reported-By: Domo via IRC
14 months agoosd: make desktop_cycle_view() private in osd.c
tokyo4j [Sun, 29 Dec 2024 19:57:39 +0000 (04:57 +0900)]
osd: make desktop_cycle_view() private in osd.c

14 months agoosd: refactor to not write server->osd_state outside osd.c
tokyo4j [Sun, 29 Dec 2024 16:05:17 +0000 (01:05 +0900)]
osd: refactor to not write server->osd_state outside osd.c

14 months agosrc/seat.c: small refactor
tokyo4j [Sun, 29 Dec 2024 15:45:43 +0000 (00:45 +0900)]
src/seat.c: small refactor

The condition server->input_mode != LAB_INPUT_STATE_PASSTHROUGH is enough
to catch when window switcher is active.

14 months agosrc/osd.c: make osd_preview_restore() private in osd.c
tokyo4j [Sun, 29 Dec 2024 15:44:12 +0000 (00:44 +0900)]
src/osd.c: make osd_preview_restore() private in osd.c

14 months agosrc/desktop.c: remove osd_review_restore() call in desktop_cycle_view()
tokyo4j [Sun, 29 Dec 2024 15:38:43 +0000 (00:38 +0900)]
src/desktop.c: remove osd_review_restore() call in desktop_cycle_view()

It was a cruft from days when we used to walk scene-nodes to get the next
view to cycle.

14 months agokeyboard: set numlock to off by default
Johan Malm [Sun, 29 Dec 2024 17:32:23 +0000 (17:32 +0000)]
keyboard: set numlock to off by default

...to avoid surprises on Acer Aspire One laptops where the numeric
keyboard does not physically exist but "overlaps" the qwerty keyboard.

Reported-by: staryvyr on IRC
Note: We do not like changing defaults, but feel that there is a good
reason for this one.

14 months agowlr-foreign-toplevel: send initial pre-map state
Consolatis [Sun, 29 Dec 2024 00:43:04 +0000 (01:43 +0100)]
wlr-foreign-toplevel: send initial pre-map state

Fixes: #2460
14 months agoproject wide: adapt to new non-NULL value of view_get_string_prop()
Consolatis [Sun, 29 Dec 2024 01:18:27 +0000 (02:18 +0100)]
project wide: adapt to new non-NULL value of view_get_string_prop()

14 months agoview: fix NULL string_prop crash
Johan Malm [Fri, 27 Dec 2024 22:37:35 +0000 (22:37 +0000)]
view: fix NULL string_prop crash

...when app_id is NULL.

Make sure view_get_string_prop() never returns NULL because it is so easy
to misuse. Same for the respective xwayland/xdg impl methods in case
anyone decides to (incorrectly) call them directly in future.

Fixes: #2453
14 months agoClear keyboard/pointer focus on Move/Resize, window switcher and menu
tokyo4j [Sat, 28 Dec 2024 15:48:55 +0000 (00:48 +0900)]
Clear keyboard/pointer focus on Move/Resize, window switcher and menu

The previous revert fixed the problem of stuck modifier keys with
keybinds in Blender, but made Firefox show its menu bar with Alt-*
keybinds. This is fundamentally inevitable due to the limitation of
wayland protocol, but at least for the default Alt-Tab keybind for
window switcher, we can mitigate this problem by clearing the keyboard
focus when the window switcher is activated. This is what KWin does, and
we decided to follow that.

So in this commit, keyboard and pointer focus are temporarily cleared
while Move/Resize, window switcher and menu interactions and restored
after them. We slightly deviate from KWin as KWin doesn't clear the
keyboard focus while Move/Resize, but it solves our existing problem
that Firefox shows its menu bar after dragging it with default Alt-Drag
mousebind, and this is what Mutter does.

We considered other solutions, but they don't work well:
1. Send wl_keyboard.{leave,enter} every time keybinds/mousebinds are
   triggered. This solves the Firefox's menu bar problem, but that
   sounds like a workaround and sending unnecessary events every time is
   not desirable.
2. Send release events for both modifiers and keys even when they are
   bound to keybinds. This is what Mutter is doing, but it looks like an
   implementation issue and violates wayland protocol.

14 months agoRevert "keyboard: include pressed modifiers in bound set"
tokyo4j [Sun, 22 Dec 2024 15:05:22 +0000 (00:05 +0900)]
Revert "keyboard: include pressed modifiers in bound set"

This reverts commit 98bf316ee6632f62ec205904d74eabd8b3e9d15b.

14 months agoRevert "keyboard: add window rule to send release-events (#2377)"
tokyo4j [Sun, 22 Dec 2024 13:04:15 +0000 (22:04 +0900)]
Revert "keyboard: add window rule to send release-events (#2377)"

This reverts commit 2f8afb2376cfa8eeb89fc5afffa869be68d3988e.

14 months agoimg: fix scaling for rendering large image in non-square rectangle
tokyo4j [Tue, 24 Dec 2024 04:39:25 +0000 (13:39 +0900)]
img: fix scaling for rendering large image in non-square rectangle

16dbdc6 caused a regression that the vscode icon (1024x1024) in the
titlebar is cut off with following configuraion:

  window.button.width: 26
  window.button.height: 16

14 months agosrc/output.c: remove output_usable_area_scaled()
tokyo4j [Mon, 23 Dec 2024 10:09:26 +0000 (19:09 +0900)]
src/output.c: remove output_usable_area_scaled()

14 months agoDon't open menu or start window switching while other server interaction
tokyo4j [Sat, 28 Dec 2024 08:03:26 +0000 (17:03 +0900)]
Don't open menu or start window switching while other server interaction

This should make the transition of the server state more predictable and
prevent potential bugs.

14 months agoCheck input_mode to see whether window switcher is active or not
tokyo4j [Sat, 28 Dec 2024 08:42:26 +0000 (17:42 +0900)]
Check input_mode to see whether window switcher is active or not

...rather than "if (server->osd_state.cycle_view){..}".

14 months agoAdd LAB_INPUT_STATE_WINDOW_SWITCHER
tokyo4j [Sat, 28 Dec 2024 07:09:05 +0000 (16:09 +0900)]
Add LAB_INPUT_STATE_WINDOW_SWITCHER

14 months agoaction: add WarpCursor action
Orfeas [Sun, 22 Dec 2024 12:48:47 +0000 (14:48 +0200)]
action: add WarpCursor action

14 months agotheme: demote padding.height warning
Johan Malm [Mon, 23 Dec 2024 21:29:46 +0000 (21:29 +0000)]
theme: demote padding.height warning

...from WLR_ERROR to WLR_INFO to avoid 'false' logging when Openbox themes
contain the padding.height settings. Whilst this option is not supported,
the visual appearance is very close to that of Openbox with common themes.

The background to this is that Labwc theme specification has diverged
slightly from that of Openbox with respect to titlebar padding to support
more contemporary looks whilst avoiding breaking changes. For full details
see commit: e16e78e7a4a6e40c8184edd7bb483b0f395482d0

Suggested-by: @Consolatis
14 months agossd: rework titlebar button rendering
tokyo4j [Thu, 28 Nov 2024 10:21:18 +0000 (19:21 +0900)]
ssd: rework titlebar button rendering

- fix that icons for normal/hovered/rounded buttons are not placed
  exactly the same position
- fix blurry window button icons in scaled outputs

This commit introduces lab_img and scaled_img_buffer and uses them for
rendering icons in the window titlebar. Now the process of rendering
button icons are split into 2 phases: loading with lab_img_load() and
creating scene-nodes for them with scaled_img_buffer_create(). This
might incur some additional overhead since we no longer preload icon
textures, but the rendering of icon only happens for the first window
as backing buffers are shared and the overhead won't be noticeable.
This commit also simplifies the process of centering icon buffer in the
button, by creating icon buffers in a fixed geometry via
lab_img_render().

14 months agonode: add node_scaled_scene_buffer_from_node
tokyo4j [Thu, 28 Nov 2024 12:34:24 +0000 (21:34 +0900)]
node: add node_scaled_scene_buffer_from_node

14 months agoext-workspace protocol integration
Consolatis [Tue, 10 Dec 2024 05:26:19 +0000 (06:26 +0100)]
ext-workspace protocol integration

14 months agoext-workspace protocol implementation
Consolatis [Mon, 18 Nov 2024 20:16:10 +0000 (21:16 +0100)]
ext-workspace protocol implementation

14 months agocursor: fix focus when menu is closed by clicking its border
tokyo4j [Thu, 19 Dec 2024 08:04:10 +0000 (17:04 +0900)]
cursor: fix focus when menu is closed by clicking its border

Before this commit, the pointer focus is cleared when a menu is closed
by clicking its border. This is because get_cursor_context() returns
type=LAB_SSD_NONE when the cursor is on the menu border and
cursor_update_common() clears the pointer focus. This commit fixes this
by replacing cursor_update_common() with cursor_update_focus(), which
calls get_cursor_context() again after the menu scene-node is hidden.

14 months agolayer: update pointer focus on popup destruction
tokyo4j [Thu, 19 Dec 2024 10:01:08 +0000 (19:01 +0900)]
layer: update pointer focus on popup destruction

Same as previous commit

14 months agoxdg-popup: update pointer focus on popup destruction
tokyo4j [Tue, 17 Dec 2024 17:13:10 +0000 (02:13 +0900)]
xdg-popup: update pointer focus on popup destruction

Before this commit, closing a popup didn't move the pointer focus to the
main toplevel until the cursor is moved.

14 months agomenu: put menu_tree above overlay layer
Johan Malm [Mon, 1 Jul 2024 20:47:19 +0000 (21:47 +0100)]
menu: put menu_tree above overlay layer

14 months agomenu: slightly slide menus opened with atCursor="no"
tokyo4j [Wed, 18 Dec 2024 16:06:48 +0000 (01:06 +0900)]
menu: slightly slide menus opened with atCursor="no"

This is reland of 2ade6a1e which was reverted with 21bd5b00, but this
prevents the x-position of the menu from being negative and slides menus
opened with Alt-Space too.

14 months agostring-helpers.c: add str_starts_with()
Johan Malm [Tue, 20 Aug 2024 16:59:46 +0000 (17:59 +0100)]
string-helpers.c: add str_starts_with()

14 months agoscaled-scene-buffer: reduce unnecessary renderings
tokyo4j [Tue, 3 Dec 2024 07:18:52 +0000 (16:18 +0900)]
scaled-scene-buffer: reduce unnecessary renderings

Prior to this commit, a backing buffer with scale 1 was always created for
a scaled_scene_buffer before showing it, and backing buffers for specific
scales were created on output_enter events.

This commit removes this redundant re-renderings by calling
wlr_scene_buffer_set_dest_size() upon scaled_scene_buffer creation just to
receive output_enter events and delaying the first rendering to the first
output_enter event.

I needed to add font_get_buffer_size() to obtain the size of a font buffer
without actually creating it.

14 months agos/xmlParseMemory/xmlReadMemory/
Johan Malm [Sun, 8 Dec 2024 17:21:11 +0000 (17:21 +0000)]
s/xmlParseMemory/xmlReadMemory/

...as xmlParseMemory() is deprecated

14 months agoIME: don't forward key-release without correspinding key-press
tokyo4j [Tue, 17 Dec 2024 03:06:05 +0000 (12:06 +0900)]
IME: don't forward key-release without correspinding key-press

After commit e2189903 in wlroots, when ctrl-f is pressed in firefox with
a IME client running, the following key-release event for "f" is not
sent, thus "f" is repeated like "ffffffffff..." in the input box of
firefox. This is because the key-release event for "f" is firstly
forwarded to the IME client and then sent via the virtual keyboard created
by the IME client while the key-press event is sent via physical
keyboard, and with e2189903, key-release events without a corresponding
key-press event on the same keyboard is not emitted to the compositor.

So this commit fixes this problem by not forwarding the key-release event
to the IME client unless the corresponding key-press event was also
forwarded.

14 months agocosmic-workspaces: remove workspace_set_hidden() calls
Consolatis [Tue, 10 Dec 2024 05:10:22 +0000 (06:10 +0100)]
cosmic-workspaces: remove workspace_set_hidden() calls

It is a concept that labwc does not support.

14 months agocosmic-workspaces: add cosmic_ prefix
Consolatis [Mon, 18 Nov 2024 19:45:11 +0000 (20:45 +0100)]
cosmic-workspaces: add cosmic_ prefix

In preperation for a future ext-workspace integration.

14 months agolabwc-config(5): describe how keys are processed
Johan Malm [Mon, 16 Dec 2024 20:13:58 +0000 (20:13 +0000)]
labwc-config(5): describe how keys are processed

...when matching against keybinds.

Copied from:

https://github.com/labwc/labwc/blob/63dc609085d42d16401e23079bb50e2f07e31de5/src/input/keyboard.c#L215-L238

14 months agocosmic-workspaces: abstract transaction-addon
Consolatis [Mon, 18 Nov 2024 17:38:42 +0000 (18:38 +0100)]
cosmic-workspaces: abstract transaction-addon

This allows to use it for a future ext-workspace implementation.
It is also more generalized so can be used for other protocol
implementation in the future in case the protocols require some
kind of transaction management.

14 months agoTranslation updates from weblate
Weblate [Sun, 15 Dec 2024 01:13:10 +0000 (02:13 +0100)]
Translation updates from weblate

Co-authored-by: vTT <vttfreebsd@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fr/
Translation: Labwc/labwc

14 months agoREADME.md: add "lightweight and box-inspired"
Johan Malm [Sat, 14 Dec 2024 21:01:24 +0000 (21:01 +0000)]
README.md: add "lightweight and box-inspired"

14 months agomenu: improve algorithm for menu placement with xdg-positioner
tokyo4j [Mon, 25 Nov 2024 21:42:08 +0000 (06:42 +0900)]
menu: improve algorithm for menu placement with xdg-positioner

This commit delegates the calculation for menu position into wlroots
utilities for xdg_positioner.

Notable functional changes are:
- Slide the menu to fit in the output when it's opened out of the output
  (e.g. top-left window menu is opened when the window is overflowing to
  the left), rather than not updating the menu at all.
- The horizontal alignment of menus is now determined based on the size of
  each (sub)menu alone rather than the total width of entire menu tree.
  This means submenus can now overlap with is parents, but this is no
  longer a problem since we recently added support for menu borders.
- Fixed that pipemenus always follow the alignment of its parent even when
  it overflows from the output.

14 months agolabwc-actions(5): add missing position option to ShowMenu
Johan Malm [Sun, 8 Dec 2024 17:24:32 +0000 (17:24 +0000)]
labwc-actions(5): add missing position option to ShowMenu

14 months agoREADME.md: add gammastep
Johan Malm [Fri, 1 Dec 2023 22:23:41 +0000 (22:23 +0000)]
README.md: add gammastep

14 months agoquery: extend "monitor" query & add missing docs
Orfeas [Thu, 5 Dec 2024 18:24:41 +0000 (20:24 +0200)]
query: extend "monitor" query & add missing docs

14 months agofont: remove arrow character from font buffer
tokyo4j [Tue, 3 Dec 2024 07:09:40 +0000 (16:09 +0900)]
font: remove arrow character from font buffer

Arrow signs are specific to submenu items, so they would be more natural
to be handled in menu.c rather than accepting "arrow" in
font_buffer_create().

Also I allowed non-positive numbers for max_width in font_buffer_create(),
in which case the natural font width is used as the buffer width.

14 months agomenu: some refactor
tokyo4j [Tue, 3 Dec 2024 06:58:07 +0000 (15:58 +0900)]
menu: some refactor

- Don't store font/background buffers in menuitem struct since we no
  longer dynamically update buffers of existing menuitems.
- Factor out the duplicated codes for creating menu item scenes for each
  unselected/selected states.

14 months agoCONTRIBUTING.md: update package maintainer list
Consolatis [Fri, 13 Dec 2024 22:29:11 +0000 (23:29 +0100)]
CONTRIBUTING.md: update package maintainer list

14 months agoview: s/scene_node/content_node/
tokyo4j [Fri, 13 Dec 2024 08:22:54 +0000 (17:22 +0900)]
view: s/scene_node/content_node/

14 months agobuild: bump version to 0.8.2
Johan Malm [Fri, 13 Dec 2024 19:12:14 +0000 (19:12 +0000)]
build: bump version to 0.8.2

14 months agoNEWS.md: update for 0.8.2
Johan Malm [Wed, 4 Dec 2024 21:10:05 +0000 (21:10 +0000)]
NEWS.md: update for 0.8.2

14 months agodocs/environment: remove example MOZ_ENABLE_WAYLAND=1
Johan Malm [Thu, 12 Dec 2024 19:56:20 +0000 (19:56 +0000)]
docs/environment: remove example MOZ_ENABLE_WAYLAND=1

...because it has not been relevant since before firefox v121 and even
firefox-esr on Debian bullseye is now at v128.

Suggested-by: cry0xen
14 months agoconfig: only default to xwayland persistence on old wlroots versions
Andrew J. Hesford [Wed, 11 Dec 2024 19:57:07 +0000 (14:57 -0500)]
config: only default to xwayland persistence on old wlroots versions

This is a compile-time check, so it will be too conservative if somebody
updates wlroots after building labwc, but that is still better than the
alternatives.

14 months agoscripts: add wl_compcheck.py
Consolatis [Mon, 9 Dec 2024 22:06:58 +0000 (23:06 +0100)]
scripts: add wl_compcheck.py

Simple utility to allow protocol and version comparison between different
running compositors. This can be used to detect missing protocols or
versions in labwc. See for example this result when running against the
current labwc master and sway 1.10 (nested, results on DRM may differ):

  Protocols missing from labwc @ wayland-0
  ext_transient_seat_manager_v1                   1
  wl_compositor                                   6  (has version 5)
  wp_alpha_modifier_v1                            1
  wp_content_type_manager_v1                      1
  xdg_wm_base                                     5  (has version 3)
  zwp_keyboard_shortcuts_inhibit_manager_v1       1

  Protocols missing from sway @ wayland-1
  wl_drm                                          2
  zcosmic_workspace_manager_v1                    1

14 months agoTranslation updates from weblate
Weblate [Tue, 10 Dec 2024 02:04:35 +0000 (03:04 +0100)]
Translation updates from weblate

Co-authored-by: 이정희 <daemul72@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ko/
Translation: Labwc/labwc

14 months agoconfig: temporarily set xwaylandPersistence to 'yes' by default (#2414)
Johan Malm [Sun, 8 Dec 2024 18:36:59 +0000 (18:36 +0000)]
config: temporarily set xwaylandPersistence to 'yes' by default (#2414)

...to avoid a bug that is present in wlroots <0.18.2 and which has the
potential to crash the compositor when performing a drag-and-drop action
at the same time as the XWayland server is shutting down.

This will be reverted when wlroots-0.18.2 can be linked with.

Related-to: #2371
14 months agolabwc-config(5): add <xwaylandPersistence> to "core" section example
Johan Malm [Sun, 8 Dec 2024 18:21:28 +0000 (18:21 +0000)]
labwc-config(5): add <xwaylandPersistence> to "core" section example

14 months agoTranslation updates from weblate
Weblate [Sun, 8 Dec 2024 21:01:19 +0000 (22:01 +0100)]
Translation updates from weblate

Co-authored-by: unabomberlive <7alinchik@mail.ru>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ru/
Translation: Labwc/labwc

14 months agolabwc-config(5): reflow some paragraphs to stay within 80 columns
Johan Malm [Sun, 8 Dec 2024 17:49:33 +0000 (17:49 +0000)]
labwc-config(5): reflow some paragraphs to stay within 80 columns

14 months agolabwc-config(5): add XML examples at start of some sections
Johan Malm [Sun, 8 Dec 2024 17:48:16 +0000 (17:48 +0000)]
labwc-config(5): add XML examples at start of some sections

14 months agoconfig/rcxml.c: fix crash in <touch> section
Johan Malm [Sun, 8 Dec 2024 17:31:23 +0000 (17:31 +0000)]
config/rcxml.c: fix crash in <touch> section

...when options are specified as elements leading to hitting the assert()
in xstrdup().

Reproduce by using this rc.xml:

```
<?xml version="1.0"?>
<labwc_config>
  <touch>
    <deviceName>foo</deviceName>
    <mapToOutput>bar</mapToOutput>
  </touch>
</labwc_config>
```

It is likely that <touch> was only tested with options as attributes.

14 months agoaction: fix menu position with "x"/"y" arguments in multi-monitor setup
tokyo4j [Sun, 8 Dec 2024 08:59:56 +0000 (17:59 +0900)]
action: fix menu position with "x"/"y" arguments in multi-monitor setup

Prior to this commit, output-relative coordinate was passed to
menu_open_root() as the menu position when it's designated via "x"/"y"
arguments in ShowMenu action, so menu can be misplaced to the output other
than the one in which the cursor is in.

14 months agoRevert "menu: slightly slide menus opened from buttons"
tokyo4j [Sun, 8 Dec 2024 07:05:53 +0000 (16:05 +0900)]
Revert "menu: slightly slide menus opened from buttons"

With 2ade6a1, negative x-values can be passed to menu_configure() when the
window menu is opened from top-left button in a maximized window, but
wlr_output_layout_output_at() couldn't find the output for the coordinate
since it's out of the output layout, thus it just opened the menu without
updating its position.

As the next release is close and the visual improvement by 2ade6a1 is not
very impactful for UX, let's revert it for now.

15 months agomenu: slightly slide menus opened from buttons
tokyo4j [Fri, 6 Dec 2024 04:57:50 +0000 (13:57 +0900)]
menu: slightly slide menus opened from buttons

This commit slides menus opened from buttons (with atCursor="no") to the
left by menu.border.width. This makes the location of the window menu
look more natural, especially when it's opened from the window icon in
the left corner of the titlebar.

15 months agoAdd support for xdg-foreign-v1 and xdg-foreign-v2 (#2400)
Consolatis [Tue, 3 Dec 2024 20:23:57 +0000 (21:23 +0100)]
Add support for xdg-foreign-v1 and xdg-foreign-v2 (#2400)

15 months agoserver.c: block privileged protocols for sandboxed clients
Consolatis [Mon, 2 Dec 2024 02:44:57 +0000 (03:44 +0100)]
server.c: block privileged protocols for sandboxed clients

In the longer term we want this to be user-configurable (and also depend
on the sandbox engine, app_id and instance).

But dropping privileged protocols for sandboxed clients in the meantime
seems like a sensible thing to do and matches user expectations.

Related: #2392

15 months agoNEWS.md: interim update
Johan Malm [Sun, 1 Dec 2024 20:04:23 +0000 (20:04 +0000)]
NEWS.md: interim update

15 months agodocs: simplify description of shell wildcard patterns
Johan Malm [Sun, 1 Dec 2024 16:35:57 +0000 (16:35 +0000)]
docs: simplify description of shell wildcard patterns

...to align with glob(7) language

Reported-by: @vyivel
15 months agossd: fix pixman error when SSD is created for tiny windows
tokyo4j [Mon, 18 Nov 2024 22:18:36 +0000 (07:18 +0900)]
ssd: fix pixman error when SSD is created for tiny windows

set_squared_corners(false) was always called when titlebar is created.
However, set_squared_corners(false) sets the width of the titlebar
background buffer to (view width) - (corner radius), which causes pixman
errors due to the negative width set for titlebar background buffer when
the view is so small.

15 months agoCI: disable clang for Debian until they get wayland 1.23.1
Consolatis [Sun, 1 Dec 2024 18:46:24 +0000 (19:46 +0100)]
CI: disable clang for Debian until they get wayland 1.23.1

15 months agoscaled-rect-buffer: add missing cairo_surface_flush()
tokyo4j [Thu, 28 Nov 2024 09:49:04 +0000 (18:49 +0900)]
scaled-rect-buffer: add missing cairo_surface_flush()

15 months agobuffer: remove buffer->cairo
tokyo4j [Wed, 27 Nov 2024 21:58:17 +0000 (06:58 +0900)]
buffer: remove buffer->cairo

It's more common for cairo_t to have a temporary lifetime and it will
prevent accidentally reusing its previous state.

15 months agobuffer: always set buffer->{cairo,surface} for simplification
tokyo4j [Wed, 27 Nov 2024 05:17:28 +0000 (14:17 +0900)]
buffer: always set buffer->{cairo,surface} for simplification

15 months agoAdd lsan.supp
Johan Malm [Tue, 12 Nov 2024 17:50:58 +0000 (17:50 +0000)]
Add lsan.supp

...so suppress errors from ASAN with EGL renderer.

Also add a script to simplify running with sanitizer and this suppression
file.

Related-to: #2331
15 months agokeyboard: add window rule to send release-events (#2377)
Johan Malm [Tue, 26 Nov 2024 20:02:36 +0000 (20:02 +0000)]
keyboard: add window rule to send release-events (#2377)

...of modifiers which are part of keybinds. This supports clients (for
example blender) that want to see modifier-release-events even if they are
part of a keybinds.

Most clients (including those using Qt and GTK) are setup to not see these
modifier release events and actually misbehave if they do.  For example
Firefox shows the menu bar if alt is pressed and then released, whereas if
only pressed (because the release is absorbed) nothing happens. So, if
Firefox saw bound modifier-release-events it would show the menu bar every
time the window-switcher is used with alt-tab.

    <windowRules>
      <windowRule identifier="blender" wantAbsorbedModifierReleaseEvents="yes"/>
    </windowRules>

Issue #1507

15 months agoCI: make the smoke test start foot
Consolatis [Tue, 26 Nov 2024 03:30:38 +0000 (04:30 +0100)]
CI: make the smoke test start foot

15 months agoCI: switch runtime tests to Arch to reduce total runtime
Consolatis [Tue, 26 Nov 2024 05:02:29 +0000 (06:02 +0100)]
CI: switch runtime tests to Arch to reduce total runtime

15 months agoCI: add address sanitizer to Debian runtime tests
Consolatis [Tue, 26 Nov 2024 02:08:07 +0000 (03:08 +0100)]
CI: add address sanitizer to Debian runtime tests

15 months agoCI: re-enable Debian build job
Consolatis [Tue, 26 Nov 2024 01:24:38 +0000 (02:24 +0100)]
CI: re-enable Debian build job

15 months agoCI: move comment to the right place
Consolatis [Tue, 26 Nov 2024 01:19:38 +0000 (02:19 +0100)]
CI: move comment to the right place

15 months agoCI: reduce job timeout to 10 minutes
Consolatis [Tue, 26 Nov 2024 01:17:10 +0000 (02:17 +0100)]
CI: reduce job timeout to 10 minutes

Since GitHub runners now support hardware virtualization,
the maximal runtime of the FreeBSD runner is somewhere
around 3 to 6 minutes. It may still fail sometimes so
keep the timeout parameter around.

15 months agographic-helpers: fix segfault when medium-size icon file is loaded
tokyo4j [Tue, 26 Nov 2024 01:56:10 +0000 (10:56 +0900)]
graphic-helpers: fix segfault when medium-size icon file is loaded

lab_data_buffer->logical_{width,height} are not the actual size of the
backing buffer, so wlr_buffer.{width,height} should be used when
duplicating it in get_cairo_surface_from_lab_data_buffer().

This mistake caused segfault when an icon file 1~2 times larger than
window.button.{width,height} is loaded, because the buffer for the raw
icon file is reused by setting lab_data_buffer->logical_{width,height}
with the size for display which is different from
wlr_buffer.{width,height} (see buffer_convert_cairo_surface_for_icon()),
and it is duplicated with get_cairo_surface_from_lab_data_buffer() for
hovered/rounded variants of titlebar button.

15 months agomenu: don't include menu.border.width for menu title height
tokyo4j [Tue, 26 Nov 2024 00:44:27 +0000 (09:44 +0900)]
menu: don't include menu.border.width for menu title height

It was a cruft from my experiment of adding borders around titles.

It even caused an integer overflow because theme->menu_border_width can be
INT_MIN when menu_header_height is calculated.