Commit graph

3329 commits

Author SHA1 Message Date
John Lindgren
35b3980a5b xwayland: hide content tree at re-map if shaded 2025-11-27 01:26:55 -05:00
John Lindgren
8bd20f19dc view: add defensive checks for null content_tree 2025-11-27 01:26:55 -05:00
John Lindgren
b1e7282995 xwayland-unmanaged: remove obsolete workaround 2025-11-27 01:26:55 -05:00
John Lindgren
b9da216bde xwayland: associate/dissociate/map/unmap cleanups
- connect/disconnect map handlers in set_surface()
- call set_surface() at time of associate/dissociate

This separates the concepts of "associate" and "map" more clearly.

It's no longer necessary to listen for wlr_surface "destroy" event,
because dissociate is always received first.

Also, view->content_tree is now destroyed and set to NULL at unmap.
Previously, we relied on wlr_scene to destroy it automatically when
the surface was destroyed, but kept a potentially dangling pointer in
view->content_tree until next map. Similar change for unmanaged.

v2: comment updates
2025-11-27 01:26:55 -05:00
tokyo4j
4b0903cfa9 view: deduplicate foreign-toplevel creation code 2025-11-27 01:26:55 -05:00
tokyo4j
3c0e010c58 Remove view_impl->map and view_impl->unmap
jlindgren: data parameter to handle_unmap() is NULL
2025-11-27 01:26:55 -05:00
John Lindgren
e96f4a032b output: avoid use of wlr_scene_output.WLR_PRIVATE.index
We were only using it to allow quick bitset comparisons of sets of
outputs (such as view->outputs). We can maintain our own bit IDs for
this purpose and avoid using the private wlroots field.

Note: from my reading of wlr_scene_output_create(), it appears to
always take the lowest unused index, resulting in aggressive re-use of
index values when outputs are disconnected and reconnected. I've tried
to make re-use as infrequent as possible. This could theoretically
reduce the chance of a mix-up in view_update_outputs(), although I'm
not aware of any practical scenario where it matters.

v2: prevent adding more than 64 outputs
2025-11-26 06:49:17 +01:00
Consolatis
6521067171 CI: add pcre2 dep for FreeBSD to work around git error 2025-11-23 03:50:11 +01:00
John Lindgren
b5e2eb216e view: separate (un)minimize and (un)map logic
Map/unmap logic is currently re-used for minimize/unminimize, but lots
of it doesn't actually apply in that case. This is both confusing and
creates some extra complexity, such as:

 - extra "client_request" parameter to unmap(), in which case it has to
   still do some cleanup even if view->mapped is already false

 - various "view->mapped || view->minimized" checks when we really just
   mean "is the view mapped"

To clean this all up, let's put the logic that really is common into
a new view_update_visiblity() function, and stop using map/unmap for
minimize/unminimize.

Note that this changes the meaning of "view->mapped", which used to
mean "mapped and not minimized" but now really just means "mapped".
I left some "view->mapped" conditions as-is (rather than changing to
"view->mapped && !view->minimized") where it seemed to make sense.

v2: add view_update_visibility() as suggested by tokyo4j
2025-11-21 14:01:48 +09:00
John Lindgren
20087e89b2 wlr-foreign: set all initial states correctly
Two were missing: "minimized" and "activated".

At least "minimized" can be set before map, so the initial state needs
to be read and set on the foreign-toplevel.

I think in the current code, the foreign-toplevel is always created
before a view is activated, but for future-proofing, let's not rely
on this, and set "activated" as well. There's no harm since wlroots
optimizes away any redundant state changes.
2025-11-18 07:06:07 +01:00
Johan Malm
077a5c970a NEWS.md: interim update 2025-11-16 19:14:11 +00:00
John Lindgren
8ced055cb9 xwayland: remove obsolete (since wlroots 0.17) NULL check
Since d7dc6e01b4 ("Chase wlroots: Unified mapping"), the map event
is emitted by the wlr_surface itself, thus it cannot be NULL.

Change the "if" to an "assert" accordingly.
2025-11-15 12:19:31 +01:00
Hiroaki Yamamoto
b35b935ab1
cursor: remove unneeded process_cursor_motion_out_of_surface() 2025-11-15 12:14:26 +01:00
John Lindgren
9f4178955a xdg: make use of xdg_toplevel_view_get_parent() 2025-11-13 00:07:11 +01:00
John Lindgren
5543affe35 view: factor out view_impl_init_foreign_toplevel() 2025-11-13 00:07:11 +01:00
John Lindgren
51c2003ed8 xdg: remove unnecessary cast 2025-11-13 00:07:11 +01:00
David Turner
d15152b27b seat: Call configure_libinput() for keyboards
Call configure_libinput() for keyboards in new_keyboard() and
seat_reconfigure().

This allows the use of the sendEventsMode configuration option on
keyboards in order to disable keyboard input, for example:

    <libinput>
        <device category="  RPI Wired Keyboard 1">
            <sendEventsMode>no</sendEventsMode>
        </device>
    </libinput>
2025-11-12 23:59:29 +01:00
tokyo4j
366cf3c995 src/osd/osd.c: fix indentations for switch-case 2025-11-11 20:10:58 +09:00
Samet Aylak
d65caf8bfd
osd: add multi-monitor support
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Adds `output` attribute to control which monitor(s) display the window
switcher OSD. Supports three modes:
- "all": display on all monitors (default)
- "pointer": display on monitor with mouse cursor
- "keyboard": display on monitor with keyboard focus

The configuration structure is also refactored to nest OSD-specific
settings (show, style, output, thumbnailLabelFormat) under an <osd>
element within <windowSwitcher>, improving logical organization.
2025-11-10 05:16:26 +01:00
John Lindgren
79fbb611e0 view: less hacky support for minimize-before-map
The previous "minimal fix" (5148c2aa31) worked but was a bit of a
hack, as it basically un-minimized and then immediately minimized the
view again at map. It's not actually too difficult to make the map
handlers aware of minimized views, eliminating the need for the hack.

Note: this depends on the previous commit ("xwayland: connect commit
and surface_destroy handlers together") otherwise the xwayland map
handler registers the commit handler twice, leading to a crash.
2025-11-09 18:27:39 +00:00
John Lindgren
b6f7bacdde xwayland: connect commit and surface_destroy handlers together
Factor out set_surface() which consolidates connecting/disconnecting
the wlr_surface event listeners in one place.

In theory, this means we can receive commit events for minimized views.
However, with a test app that resizes itself, I didn't see any change,
i.e. the commits still don't come through until un-minimize. It's
possible they are being filtered at wlroots or protocol level.

Also remove an old, semi-related TODO from view.c.
2025-11-09 18:27:39 +00:00
elviosak
0501f0ac9e
osd: make empty string "" in thumbnailLabelFormat to not show any text (#3196) 2025-11-09 19:20:08 +09:00
John Lindgren
87da3f6588 output: factor out output_set_has_fullscreen_view() 2025-11-09 06:46:59 +01:00
John Lindgren
6de18b9afd view: update top layer visiblity at unmap instead of destroy
It's possible for a fullscreen xwayland view to be unmapped without
being destroyed. In this case, we need to update top layer visibility,
otherwise panels and the like will remain hidden.

Since unmap is always called before destroy, it's sufficient to do the
update only in view_impl_unmap() and not in view_destroy().

Adaptive sync logic needs work still, but I tried to minimize changes
to it since I don't have hardware to test it.
2025-11-09 06:46:59 +01:00
elviosak
c8167c8ee0
osd: add thumbnailLabelFormat to windowSwitcher (#3187)
Some checks failed
labwc.github.io / notify (push) Has been cancelled
This commit adds `<windowSwitcher thumbnailLabelFormat="%T">` to configure the label text in each item in the thumbnail-style window switcher. Its format follows `<fields><field content="custom" format="">`.
2025-11-05 18:23:15 +09:00
elviosak
8b950350ed docs: remove repeated words 2025-11-04 23:07:50 +01:00
tokyo4j
9197eb468a osd: allow clicking an osd item to focus the window 2025-11-04 21:29:13 +00:00
tokyo4j
00f0a46ef7 osd: generalize osd_{classic,thumbnail}_item
This allows us to share common codes for dealing with osd items.
For example:
- Get the clicked osd item to focus its associated window
- Scroll the items when their total height is taller than output height
2025-11-04 21:29:13 +00:00
tokyo4j
747163fa3e osd: rename *_scene_item to *_item 2025-11-04 21:29:13 +00:00
tokyo4j
2c0552004a osd: move end_cycling() into osd_finish()
...so that we can use `osd_finish()` to support clicking an osd item to
focus its associated window.
2025-11-02 21:30:35 +00:00
tokyo4j
7223056ffc osd-classic: substitute theme->osd_border_width+switcher_theme->padding 2025-11-02 04:32:12 +01:00
tokyo4j
9ce57c5f36 workspaces: place osd at the center of output rather than usable area 2025-11-02 04:27:39 +01:00
tokyo4j
9b6e2b71e6 osd: place osd at the center of output rather than usable area 2025-11-02 04:27:39 +01:00
tokyo4j
0f62648d39 osd: use wlr_output_effective_resolution() to get output geometry
Before this commit, output transformations were not taken into account for
parcent-based osd widths like:

osd.window-switcher.style-classic.width: 80%
osd.window-switcher.style-thumbnail.width.max: 80%
2025-11-01 17:03:37 +00:00
Weblate
ef01ebe187 Translation updates from weblate
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: sudoasd <asdwasd@meiliboxi.fi>
Co-authored-by: zenfas <zenfas66@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fi/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/he/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/vi/
Translation: Labwc/labwc
2025-11-01 16:04:17 +00:00
tokyo4j
2d7e87ea75 osd-classic: fix miscalculation for osd width in percentage
Fixes a regression in 75eb370.
2025-11-01 16:01:58 +00:00
tokyo4j
24b9bd93fb osd-thumbnail: fix miscalculation for item geometries 2025-11-01 16:00:20 +00:00
tokyo4j
43c6e1dc22 osd-thumbnail: s/thumb_theme/switcher_them/
Just to align with other parts of the codebase.
2025-11-01 16:00:20 +00:00
tokyo4j
cd1a823fee seat: use CONNECT_SIGNAL() for new_virtual_pointer event 2025-10-25 20:41:38 +02:00
elviosak
4cdc6c435b
input/cursor.c: avoid consuming scroll on client mousebind 2025-10-24 22:26:18 +02:00
Johan Malm
df8e3d819c docs/: remove XML declarations in .xml files
...because we don't like them anymore and libxml2 does not consider them
mandatory.
2025-10-21 12:30:32 +09:00
John Lindgren
28cd504067 desktop: work around client-side rounding issues at right/bottom pixel
This also avoids a similar server-side rounding issue with some
combinations of wlroots and libwayland versions. See:

- https://gitlab.freedesktop.org/wayland/wayland/-/issues/555
- https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5159

Tested with qmpanel (similar to lxqt-panel) at 1x and 2x output scale.
Does not help if scaling is done client-side, e.g. QT_SCALE_FACTOR=2.

Fixes: #2379
Fixes: #3099
2025-10-20 20:11:08 +01:00
Johan Malm
1e406dd649 labnag: use overlay layer by default
Some checks failed
labwc.github.io / notify (push) Has been cancelled
...so that the dialog is still visible when some client is using
fullscreen mode.
2025-10-20 01:24:31 +02:00
Johan Malm
df3ed58d5b NEWS.md: interim update 2025-10-19 20:23:02 +01:00
tokyo4j
261ec3c509 scripts/check: run style check for test files
Co-authored-by: @johanmalm
2025-10-20 04:12:38 +09:00
tokyo4j
d8260feef2 CI: also run on t/ changes 2025-10-20 04:12:38 +09:00
tokyo4j
be44991def tests: remove placeholders for arguments 2025-10-20 04:12:38 +09:00
tokyo4j
7f67b9c866 Don't remove newlines when parsing config, menu and XBM
Removing newlines in rc.xml and menu.xml caused parser error with
following content:

<!--
 -
 - Some comments
 -
-->

...though it is a valid XML.

Let's not do that. I moved `grab_file()` to `buf.c` and renamed it to
`buf_from_file()`, because it now directly touches `struct buf` and
I don't like having a source file only for one function.
2025-10-17 22:08:41 +09:00
Weblate
eebf5b3e4e Translation updates from weblate
Co-authored-by: alvaroelpob <alvaropobladoresteban9@gmail.com>
Co-authored-by: p-bo <pavel.borecki@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ca/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/cs/
Translation: Labwc/labwc
2025-10-14 21:48:28 +01:00
tokyo4j
89fab2d449 theme: replace THEME_(IN)ACTIVE with SSD_(IN)ACTIVE
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-10-14 07:48:27 +02:00