Commit graph

2884 commits

Author SHA1 Message Date
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
tokyo4j
4ef881bb3e osd: support app icons in window switcher
Example configuration:

  <windowSwitcher>
    <fields>
      <field content="icon" width="5%" />
      <field content="title" width="95%" />
    </fields>
  </windowSwitcher>
2025-03-17 01:22:24 +09:00
Tomi Ollila
84ba60f453 string-helpers: rtrim() with just char *s, call it later in string_strip
char **s not needed to get trailing whitespace trimmed,
and rtrim() does not return anything

if there is leading whitespace in *s in call to string_strip(),
there is less chars left to scan in rtrim().
2025-03-16 11:18:39 +00:00
tokyo4j
75eb370d31 osd: draw window switcher with scene-nodes
...rather than drawing it onto a single texture.
2025-03-16 11:15:00 +00:00
tokyo4j
2be149064e osd: make osd_update() private 2025-03-16 11:15:00 +00:00
tokyo4j
140e913c44 project wide: clean up event listeners on shutdown (part 2) 2025-03-13 20:08:59 +00:00
John Lindgren
b8568c3258 data: center logo vertically
The current logo has asymmetrical 62/19 px top/bottom padding. Let's
center it (40/41 px top/bottom) so it looks better in the titlebar.
2025-03-13 20:01:53 +00:00
Consolatis
9e6aaa689a project wide: clean up event listeners on shutdown
This ensures all event listeners are removed before the emitting
wlroots object is being destroyed. This will be enforced with asserts
in wlroots 0.19 but there is no reason to not do it right now either.

This change in wlroots 0.19 is implemented via commit
8f56f7ca43257cc05c7c4eb57a0f541e05cf9a79
"Assert (almost all) signals have no attached listeners on destroy"
2025-03-13 17:33:51 +09:00
Hiroaki Yamamoto
4750214d42
Merge pull request #2598 from tokyo4j/refactor-magnifier
magnifier: refactor
2025-03-13 15:20:34 +09:00
tokyo4j
e517b6808d menu: show app icons in client-list-combined-menu 2025-03-11 20:25:09 +00:00
tokyo4j
54186e5152 menu: dynamically generate top-level pipemenus
This eliminates code duplications and aligns the behavior of top-level
pipemenus with sub-pipemenus.
2025-03-10 19:42:03 +00:00
tokyo4j
40dfee7bd5 menu: don't fill default items in empty menus
This is needed to prevent pipemenus which usually contains no items
from being filled with default items in follow-up commits.
2025-03-10 19:42:03 +00:00
tokyo4j
ea4ea84499 menu: use item->parent->id for client-list-combined-menu
...instead of item->id.
2025-03-10 19:42:03 +00:00
tokyo4j
12f95543f0 menu: lazily generate menu scenes
This removes the need to call update_client_list_combined_menu()
and update_client_send_to_menu() every time a root menu is opened.

This commit also fixed the incorrect menu position with following
configuration:
  <menu id="foo" label="foo">
    <item label="aaaaaa"/>
    <item label="bbbbbb"/>
  </menu>
  <menu id="root-menu">
    <menu id="foo" />
    <menu id="foo" />
  </menu>
2025-03-10 16:16:20 +09:00
tokyo4j
514f1d4fc4 menu: assert server->menu_current != NULL in menu_close_root() 2025-03-10 16:16:20 +09:00