Commit graph

29 commits

Author SHA1 Message Date
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
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
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
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
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
Tomi Ollila
c78a0fe1b4 windowswitcher: show 's' as "state" for shaded views
While at it sorted the code to show 'm' before 's' and 's' before 'M'
- from the least visible to the most visible state.
2025-10-13 22:57:23 +02:00
Consolatis
364a1d5207 osd: allow window switcher to temporary unshade windows
This can be configured with a new unshade="yes|no"
argument for windowSwitcher in rc.xml

Fixes: #3111
2025-10-13 19:45:46 +02:00
tokyo4j
babd7af8f8 view: store title/app_id in view
This simplifies our codes and eliminates duplicated
`view.events.new_{title,app_id}` events. This should not change any
behaviors.
2025-10-14 02:27:13 +09:00
tokyo4j
27cc738985 osd-thumbnail: make sure item->{normal,active}_title are non-null
The if-statement doesn't make sense, because `view_get_string_prop()`
never returns NULL. And if it did, it would cause segfault in
`osd_thumbnail_update()`.
2025-10-14 02:27:13 +09:00
John Lindgren
40eed3915a osd,ssd: don't cast away const 2025-10-12 14:15:19 -04:00
tokyo4j
5e8df27f84 osd-classic: add theme options for selected window item
This commit adds new theme options:
- osd.window-switcher.style-classic.item.active.border.color
- osd.window-switcher.style-classic.item.active.bg.color

These theme options configures the border/background of selected window
item in the `classic` style window switcher. Their default values are
identical to `thumbnail` style window switcher, which means the default
border color is now `osd.label.text.color` with 50% opacity and the
default background color is now `osd.label.text.color` with 15% opacity.
2025-10-13 01:46:43 +09:00
John Lindgren
072d45d4b2 osd-thumbnail: put designated initializers in order 2025-09-13 12:06:52 +01:00
John Lindgren
d2ce31fcc9 tree-wide: use forward declarations for wlr types 2025-09-07 19:34:30 +09:00
John Lindgren
b00873a988 src: remove unused #includes (via include-what-you-use) 2025-09-07 19:34:30 +09:00
John Lindgren
7c185c1a85 include: reduce unnecessary #includes 2025-09-07 19:34:30 +09:00
John Lindgren
1188534876 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.
2025-09-06 16:00:20 -04:00
tokyo4j
074b27fd47 scaled-scene-buffer: restructure source files
Some checks failed
labwc.github.io / notify (push) Has been cancelled
- 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.
2025-09-02 21:31:19 +01:00
tokyo4j
78d47c5c37 overlay.h: reduce included headers 2025-08-31 13:24:51 +01:00
tokyo4j
2e9292b7a3 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
2025-08-29 20:42:01 +01:00
tokyo4j
6e2805f692 theme: move osd.window-switcher.* to osd.window-switcher.style-classic.*
Backward compatibility is preserved.
2025-08-29 20:42:01 +01:00
tokyo4j
92ee5083f0 osd: split to osd.c and osd-classic.c 2025-08-29 20:42:01 +01:00
tokyo4j
57a1ea6cb5 Move osd.c and osd-field.c into src/osd 2025-08-29 20:42:01 +01:00