Commit graph

23 commits

Author SHA1 Message Date
Gergő Sályi
decaa33752 Format code 2025-04-23 15:21:51 +02:00
Gergő Sályi
5fd6cbe114 Add implementation to upload and serve wallpapers from GPU memory using Vulkan
Add handling for the Linux DMA-BUF Wayland protocol
Refactor Wayland code for image loading and image equivalence
Add Vulkan code using the ash crate dependency targeting Vulkan 1.1
For image DMA-BUF exporting use EXT_image_drm_format_modifier if available,
fall back to linear images otherwise
Add --gpu command line option
Add Vulkan packages as optional dependencies to Arch Linux PKGBUILD
2025-04-21 17:46:48 +02:00
Gergő Sályi
3ded435028 Share identical wallpaper images across workspaces and outputs if possible
Load and keep around wallpaper images as a reference counted object
usable by multiple outputs and workspaces to reduce memory use

Equality of wallpapers are determined by
equal wallpaper image file and equal output width, height and transform

Equality of wallpaper image files are determined by
equal canonical path and equal modification time

Change wl_shm based wl_buffers to use per-wallpaper raw shm pools
instead of per-output slot pools of the smithay_client_toolkit dependency
This allows freeing memory when a reference counted wallpaper is destroyed
at the expense of having to keep open a file descriptor for every wallpaper

Tries to address the suggestions from issue:
https://github.com/gergo-salyi/multibg-sway/issues/13
2025-04-17 17:38:09 +02:00
Gergő Sályi
8b8d2cbaf7 Refactor the handling of image color transform parameters 2025-04-16 14:49:02 +02:00
Gergő Sályi
0972f05b6c Refactor image loading
Start separating image loading logic from wl_shm buffer handling
Add fast path decoding directly to wl_shm buffers if possible
Add auto-vectorized RGB to BGRA swizzling
2025-04-15 23:02:38 +02:00
Gergő Sályi
b06204360d Refactor, move application state struct to main.rs 2025-04-13 14:11:09 +02:00
Gergő Sályi
1fdbd7ffb0 Add support to the niri Wayland compositor
Implement niri support
Try to autodetect running compositor based on environment variables
XDG_SESSION_DESKTOP, XDG_CURRENT_DESKTOP, SWAYSOCK, NIRI_SOCKET in this order
Add the --compositor command line option
Add niri as optional dependency to the Arch Linux PKGBUILD
Update README and --help to include niri support

Merges the changes from
https://github.com/gergo-salyi/multibg-sway/pull/12
Thanks to the co-author for the contribution

Co-authored-by: Florian Finkernagel <finkernagel@imt.uni-marburg.de>
2025-04-08 19:09:00 +02:00
Gergő Sályi
5c4fdf7735 Fix sometimes disappearing mouse cursor above wallpapers
Disable receiving pointer, touch, and tablet events
by setting an empty input region for our surfaces.
This prevents a sometimes disappearing or hidden cursor when a normal window
closes below the pointer leaving it above our surface.
2024-11-16 21:30:31 +01:00
Gergő Sályi
a34ee177d0 Support output transforms having 90 degree rotations
Swap the physical width and height of an output for our calculations
if the output has a transform that includes a 90 degree rotation

This tries to fix the issue with broken wallpapers on rotated outputs
https://github.com/gergo-salyi/multibg-sway/issues/9
2024-10-09 16:09:33 +02:00
Gergő Sályi
b203a15222 Anchor the wlr_layer_surface to all 4 edges
Attempt to fix a crash with wayland protocol error reported in
https://github.com/gergo-salyi/multibg-sway/issues/8
2024-09-30 21:09:04 +02:00
Gergő Sályi
1f253ac3f9 Formatting only - apply added editorconfig to all files 2024-09-30 20:29:09 +02:00
Gergő Sályi
0749c9df34 Add missing check if updated output has a positive resolution 2024-09-30 20:13:20 +02:00
Gergő Sályi
77552b9426 Update dependencies, fix incompatibilities 2024-09-30 19:54:21 +02:00
Gergő Sályi
abb85692e4 Add --pixelformat cli argument
Enables setting --pixelformat=baseline
to force wl_buffers to use the wayland default xrgb8888
2024-05-11 00:55:54 +02:00
Gergő Sályi
2711872a53 Add support for outputs with fractional scale factor
Hopefully this will help displaying the wallpapers correctly
on outputs with fractional scale factor:
https://github.com/gergo-salyi/multibg-sway/issues/5
2024-03-25 14:09:44 +01:00
Gergő Sályi
8e20b360ae Consider integer scale factor for LayerSurface and WlSurface
Hopefully this will help displaying the wallpapers correctly
on outputs with higher than 1 integer scale factor:
https://github.com/gergo-salyi/multibg-sway/issues/4
2024-01-02 20:51:14 +01:00
Gergő Sályi
3fc86cbf96 Update dependencies, fix incompatibilities 2024-01-02 18:42:50 +01:00
Gergő Sályi
71dc725ec7 Create shm slot pools per output instead of using one in the global state
This allows the release of graphics memory per output when an output is
destroyed, unlike when we had only one shm slot pool that cannot shrink

Hopefully this will help with a claimed leak of graphics memory:
https://github.com/gergo-salyi/multibg-sway/issues/2
2023-08-31 17:35:35 +02:00
Gergő Sályi
54809851d9 Before drawing a background check if the buffer to use is already active 2023-08-31 16:43:37 +02:00
Gergő Sályi
7681beecba Log shm slot pool size on new/destroyed output
This might help to keep better track on our graphics memory use
2023-08-31 16:17:41 +02:00
Gergő Sályi
a2471bda0b Implement image resizing 2023-04-26 23:22:46 +02:00
Gergő Sályi
fbfd7e722e Update 2023-04-07 21:49:13 +02:00
Gergő Sályi
3eedfa1eb5 Initial commit 2023-04-07 17:25:48 +02:00