Commit graph

3048 commits

Author SHA1 Message Date
tokyo4j
f1c4720218 menu: guard against negative sizes
For example, the size of a scene_rect for a menu item background could be
negative with:

  menu.width.max: 0
  menu.width.min: 0
2025-05-19 06:51:42 +09:00
Consolatis
568bc71ca2 xwayland.c: support both axis for client side maximize requests 2025-05-18 05:03:06 +02:00
Orfeas
05ff914cfe keyboard.c: don't broadcast modifiers from virtual keyboards
Fixes: #2723
2025-05-15 23:49:54 +02:00
Consolatis
3bd5964e34 CI: verify early exit on missing fonts 2025-05-09 20:20:54 +01:00
tokyo4j
ca287de584 Gracefully exit when no fonts are installed
...rather than emitting ugly errors like:

labwc: ../src/buffer.c:85: buffer_adopt_cairo_surface: Assertion
`cairo_image_surface_get_format(surface) == CAIRO_FORMAT_ARGB32' failed.
2025-05-09 20:20:54 +01:00
tokyo4j
ab8b25c9b1 ssd-shadow: flip top-right/bottom-left corner instead of rotating
This simplifies corner_scale_crop().
2025-05-07 03:56:03 +09:00
Jens Peters
32585cce7e docs: document scroll wheel emulation actions 2025-05-07 03:47:37 +09:00
Jens Peters
5a1e377f43 cursor: add scroll emulation for cursor motion 2025-05-07 03:47:37 +09:00
Jens Peters
829fedb94a cursor: introduce cursor_emulate_axis() 2025-05-07 03:47:37 +09:00
Jens Peters
3331fcba6f action: add scroll-wheel-emulation actions 2025-05-07 03:47:37 +09:00
tokyo4j
cb58156904 rcxml: validate total osd field width
Before this patch, window switcher fields could overflow if the sum of
<windowSwitcher><fields><field width=""> exceeds 100%.
2025-05-05 00:05:24 +09:00
Jens Peters
706f7bc03c cursor: relocate cursor_emulate functions 2025-05-03 05:34:05 +09:00
Jens Peters
c99d53688e cursor: remove unused parameter
This makes msec() also unused.
2025-05-03 05:34:05 +09:00
Jens Peters
cec2e03954 cursor: use CONNECT_SIGNAL macro
Rename functions accordingly.
2025-05-03 05:34:05 +09:00
Johan Malm
9af441ecd3 build: bump version to 0.8.4 2025-05-02 16:41:57 +01:00
Johan Malm
f0aa5d89c5 NEWS.md: update notes for 0.8.4 2025-05-02 15:58:35 +01:00
Weblate
5cfc68cc14 Translation updates from weblate
Co-authored-by: Syahmin Sukhairi <kuimax@yahoo.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/id/
Translation: Labwc/labwc
2025-05-02 15:56:47 +01:00
Weblate
9255d35cce Translation updates from weblate
Co-authored-by: knm100 <ckdeneon@163.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/zh_CN/
Translation: Labwc/labwc
2025-04-30 21:39:36 +01:00
Simon Long
b97b2973df Parse touch configs in reverse order to enable overriding
Also reverse searching of default configs
2025-04-29 21:30:17 +01:00
Johan Malm
58d22d05e2 font: use PangoStyle enum 2025-04-23 20:20:29 +01:00
Johan Malm
94ead35227 font: use PangoWeight enum
No change in functionality.

Suggested-by: @spl237
2025-04-23 20:20:29 +01:00
John Lindgren
5148c2aa31 view: handle initially minimized views (minimal fix)
The view->impl functions do not directly support mapping a view while
minimized. Instead, mark it as not minimized, map it, and then minimize
it again.

Fixes: #2627
2025-04-23 20:18:22 +01:00
Consolatis
f0c7277c4a docs: list all supported font weights 2025-04-23 19:35:40 +01:00
Simon Long
6a810ad762
Add support for all Pango font weight options 2025-04-23 18:03:02 +02:00
tokyo4j
44295c0c13 osd: suppress errors with null window switcher fields
Fixes a regression in 75eb370 that emits errors like:

[../labwc/src/common/scaled-font-buffer.c:26] font_buffer_create() failed

...when osd_field_get_content() doesn't set non-null text.
2025-04-22 22:12:36 +02:00
Johan Malm
579dca9768 labwc-config(5): add mousebind direction example
Helped-by: @Consolatis
Related-to: #2677
2025-04-23 04:07:11 +09:00
Tomi Ollila
24c199aeef docs: rc.xml.all: Fix reference to labwc-config manpage. Unwefify.
There is no "labwc" manpage in section 5 (man 5 labwc may fail or
show e.g. labwc-action manpage).

Replaced one 'we' with passive form, to match the common style in docs/.
2025-04-21 07:57:29 +01:00
tokyo4j
34a078294e menu: refactor handle_menu_element() (part 2)
I believe !current_menu is equivalent to
is_toplevel_static_menu_definition().
2025-04-18 14:20:54 +01:00
Johan Malm
518839aff1 labwc-menu(5): fix incorrect statement on label attribute 2025-04-18 14:16:11 +01:00
Johan Malm
85d2d144be keyboard: remove code duplication 2025-04-18 08:01:59 +09:00
tokyo4j
8c0bd2a7f0 menu: refactor handle_menu_element() (part 1)
Also, show an error message when <menu> without 'id' is encountered
2025-04-16 19:49:03 +01:00
Dmitry
4f42b7a12b osd: add osd.workspace-switcher.boxes.border.width 2025-04-14 20:06:38 +01:00
Dmitry
79b92d821f osd: fix boxes size and alignment in workspace switcher
Workspace switcher boxes height was 2px more than supposed,
e.g. theme defaults of 20x20 resulted in 20x22 boxes.

The middle of the boxes list was also 1px to the left of the middle
of the osd window.
2025-04-14 20:06:38 +01:00
tokyo4j
96a3a576a9 rcxml: fix broken OSD layout with multiple <fields> entries
Before this commit, all <field> entries inside different <fields> entires
were inserted to the same list. Suppose we have following configuration:

  <windowSwitcher>
    <fields><field content="title" width="100%" /></fields>
  </windowSwitcher>
  <windowSwitcher>
    <fields><field content="identifier" width="100%" /></fields>
  </windowSwitcher>

In this case, both two <field> entries were inserted to
rc.window_switcher.fields, making the OSD content overflow.

This commit fixes by clearing rc.window_switcher.fields when the parser
encounters <windowSwitcher><fields>.
2025-04-12 21:27:41 +01:00
tokyo4j
fcf230e692 rcxml: fix broken titlebar layout with multiple <layout> entries
Before this commit, when we have multiple <theme><titlebar><layout>
entries like below, duplicated button types can be inserted to
rc.title_buttons_{left,right} and the button could go outside of the
window:
    <theme>
      <titlebar><layout>icon:iconify,max,close</layout></titlebar>
      <titlebar><layout>icon:iconify,max,close</layout></titlebar>
    </theme>

This commit fixes by clearing those lists when the parser encounters
<theme><titlebar><layout>.
2025-04-12 21:27:41 +01:00
Weblate
be3ca8df7a Translation updates from weblate
Co-authored-by: Qayyum Yazid <purrnama@proton.me>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ms/
Translation: Labwc/labwc
2025-04-10 21:52:14 +01:00
tokyo4j
44146487b2 osd: update the default window switcher layout
The default window switcher layout is updated from:

  <windowSwitcher>
    <fields>
      <field content="type" width="25%" />
      <field content="trimmed_identifier" width="25%" />
      <field content="title" width="50%" />
    </fields>
  </windowSwitcher>

to:

  <windowSwitcher>
    <fields>
      <field content="icon" width="5%" />
      <field content="desktop_entry_name" width="30%" />
      <field content="title" width="65%" />
    </fields>
  </windowSwitcher>

Only desktop entry name and title are shown when libsfdo is not linked.
2025-04-02 20:49:38 +01:00
tokyo4j
fdc8537eee desktop-entry: localize application names
This commit localizes application names in the window switcher set via
'desktop_entry_name' or '%n' specifier.
2025-04-02 20:43:45 +01:00
tokyo4j
885919fc5f cursor: let followMouse update focus only when cursor enters a surface
Before this patch, when followMouse and followMouseRequiresMovement are
both yes, we set the keyboard focus when the cursor moves within an
unfocused surface. However, kwin, xfwm4 and openbox all set keyboard focus
only when the cursor enters a surface.
2025-04-02 20:42:07 +01:00
tokyo4j
6a04c5f0dd osd: add osd.window-switcher.item.icon.size
This allows users to make the icon in window switcher bigger (or smaller)
than the font size, which enables more Openbox-like appearance.

Example configuration:
  osd.window-switcher.item.icon.size: 50

This commit also makes the icon smaller than the font size if the width
allocated with <windowSwitcher><fields><field width=""> is smaller than
that.
2025-04-01 21:14:20 +01:00
tokyo4j
d8bd8c5a3e osd: consider item.padding.y when centoring workspace name 2025-04-01 21:14:20 +01:00
tokyo4j
81204b0537 xwayland: notify correct window stacking order to xwayland
Before this commit, when a normal window is raised, xwayland thought it's
above always-on-top (AOT) windows even though it's actually below AOT
windows in the scene. This means mouse scroll events may be unexpectedly
sent to normal windows below AOT windows even when the cursor is hovering
over a AOT window.

So this commit fixes it by notifying the correct stacking order (where AOT
windows are placed above normal windows) to xwayland every time the
stacking order is updated.

Other benefits of this commit are:
- It makes the code more readable and predictable by aggregating logic
  about stacking order management in xwayland (e.g. shaded windows or
  windows in other workspaces should be notified to xwayland as being
  placed at the bottom).
- As server->last_raised_view is removed in the previous commit, we were
  notifying the stacking order to xwayland every time a window with dialog
  windows is clicked (not when clicking a topmost window without dialogs,
  due to some optimization in wlroots). This commit fixes this by caching
  the window stacking order in xwayland_view->stacking_order and notifying
  it to xwayland only when it's updated.
2025-04-01 16:48:40 +09:00
tokyo4j
de49054d75 view: remove server->last_raised_view
We were skipping in view_move_to_front() if the raised view is already
cached as server->last_raised_view. But this was prone to bugs that
windows cannot be raised even though they are actually not placed at the
top in the scene.

This happened when a window is mapped but view_move_to_front() is not
called in view_impl_map() for some reason. Example cases were:
- a window is minimized before being mapped (#2627)
- a window is mapped while window switcher is active (#2629)

Also, this problem was the root cause of #1640 and #2582, though they are
already fixed.

Therefore, this commit removes server->last_raised_view. In order to
eliminate unnecessary communications between labwc and xwayland (ref:
db591d1), I'll introduce another caching mechanism in the next commit.
2025-04-01 16:48:40 +09:00
Tomi Ollila
2404297f2d docs: labwc-actions.5.scd style updates
- some newlines to dedent and separate content
- comma (,) before respectively
- reflowd some lines to fit in 80 columns
2025-03-31 21:26:56 +01:00
tokyo4j
3f56814497 magnifier: show magnifier only in one output
This may slightly degrade UX, but this prevents the temporary buffer from
being reallocated for every frame when the magnifier spans multiple
outputs with different scales/transforms.
2025-03-31 21:19:12 +01:00
tokyo4j
6dc8e279ec magnifier: scale/transform the magnifier
Before this commit, the magnifier wasn't scaled, and caused visual
artifacts when the output is transformed.
2025-03-31 21:19:12 +01:00
Consolatis
9f53d7ed25 src/magnifier: fix compile on ancient GCC versions
Fixes
```
../src/magnifier.c:153:3: error: missing initializer for field ‘clip’ of ‘struct wlr_render_rect_options’ [-Werror=missing-field-initializers]
  153 |   };
      |   ^
In file included from ../subprojects/wlroots/include/wlr/render/wlr_renderer.h:14,
                 from ../subprojects/wlroots/include/wlr/types/wlr_output.h:17,
                 from ../src/magnifier.c:5:
../subprojects/wlroots/include/wlr/render/pass.h:115:27: note: ‘clip’ declared here
  115 |  const pixman_region32_t *clip
```
2025-03-30 00:30:05 -04:00
Weblate
9479742f46 Translation updates from weblate
Co-authored-by: Davidmp <opensusecatala@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ca/
Translation: Labwc/labwc
2025-03-29 12:11:28 +00:00
Weblate
7afe61340e Translation updates from weblate
Co-authored-by: Hiroaki Yamamoto <hrak1529@gmail.com>
Co-authored-by: UTUMI Hirosi <utuhiro78@yahoo.co.jp>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ja/
Translation: Labwc/labwc
2025-03-27 14:52:52 +09:00
Jens Peters
d6edb8b273 action: Add HideCursor action 2025-03-24 21:23:55 +00:00