summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Only submit opaque (XRGB8888) buffersManuel Stoeckl2024-10-202-2/+2
| | | | | This lets the compositor avoid needing to clear and blend the pixels behind the background surface made by swaybg.
* Set default background color to blackManuel Stoeckl2024-10-201-21/+11
| | | | | | | | | | | | | | | | | This ensures that the background is always opaque. This is a significant change; before, if no background color was specified, images were drawn onto an initially transparent buffer, leaving some of the content behind swaybg visible if the image was alpha transparent or if the 'fit' or 'center' scaling modes were used and the image aspect ratio did not match, or the image was not large enough. As the purpose of a wallpaper/background program is to draw the pixels behind all other interface items, this transparency is neither a required nor a very useful behavior. Sway version >= 1.9 by default clears frames with black, so this change should have no visible impact. Users of other compositors may need to adjust their images or specify the --color flag.
* readme: drop note about packagingSimon Ser2024-10-171-3/+0
|
* build: avoid git repository discovery when determining versionJames Knight2024-08-031-2/+2
| | | | | | | | | | | | | | | | | When attempting to use Git to populate commit/branch information in a version string, it is possible through repository discovery that it uses Git information not relevant to project. For example, if repository content is extract into an interim build location when using an embedded build framework (e.g. Buildroot), the project will not have its Git repository to refer to. When it cannot find its repository, it will look into its parent folders and may find the Git repository of another project and use its branch/commit information. This commit provides an explicit path to the project's Git repository when consider commit/branch information. This will prevent any repository discovery from occurring. Signed-off-by: James Knight <james.d.knight@live.com>
* build: include swaybg version in version string when using gitJames Knight2024-08-031-3/+7
| | | | | | | Update the version population to always include the swaybg fixed version string in the final version. Signed-off-by: James Knight <james.d.knight@live.com>
* Fix crash when new output addedManuel Stoeckl2024-05-211-6/+8
| | | | | | Calling get_buffer_size on a newly created swaybg_output, before a config is assigned to a swaybg_output, is unnecessary and yields a null pointer dereference.
* Fix fractional scale detectionManuel Stoeckl2024-04-291-1/+2
| | | | | | | | | | | The fractional scale protocol does not guarantee that a preferred fractional scale value is provided before the surface is mapped. Therefore, use the (integral) output scale value until a fractional scale is available. Also: wl_output.scale is not guaranteed to be sent if the initial output scale is 1 (although Sway always sends it). Set the default output scale value.
* Estimate output size with wp-fractional-scale-v1Manuel Stoeckl2024-04-292-2/+40
| | | | | And if available, use wp-viewporter to submit buffers whose size exactly matches the "physical" pixel dimensions of the output.
* Decouple wl_buffer creation and wl_surface configManuel Stoeckl2024-04-291-48/+74
| | | | | | | | This commit introduces a new `draw_buffer` function which handles both the creation of single-pixel and wl_shm buffers, and a `get_buffer_size` to give the required buffer size in both cases. This reorganization will it easier in the future to support shm buffers in conjunction with wp_viewport, for use with wp_fractional_scale_v1.
* build: define _POSIX_C_SOURCE globallySimon Ser2024-04-284-3/+2
|
* build: use cc.get_supported_arguments() for warning optionsSimon Ser2024-04-281-10/+8
|
* build: bump version to 1.2.1Simon Ser2024-04-281-1/+1
|
* Correct for image orientation when loading imageManuel Stoeckl2024-04-161-1/+5
| | | | | | | | JPEG and other image formats may include an EXIF orientation tag which indicates in what orientation (rotation and mirroring) the image should be displayed. libgdk-pixbuf does not correct for this when loading an image, but provides a function to apply the transform after the fact, which this commit uses.
* Document option arguments in command line usageManuel Stoeckl2024-04-161-4/+4
|
* wayland-protocols min. version to 1.26Mike Kot (Михаил Кот)2024-01-131-1/+1
| | | | | In Ubuntu 22.04, default wayland-protocols version is 1.25, `single-pixel-buffer` feature is missing there
* Unify color validation and parsing functionsManuel Stoeckl2023-12-202-31/+20
| | | | | | | | | | Before this change, parse_color() and is_valid_color() behaved slightly differently: parse_color() accepted both colors with and without alpha, with optional leading #, while is_valid_color() forbade alpha and required a leading # character. This commit merges the two functions into one simpler function that forbids alpha and allows an optional leading #. (Alpha values are forbidden because backgrounds should be opaque; a leading # is optional to make shell scripts easier to write.)
* main.c: fix build against gcc-14 (-Walloc-size)Sergei Trofimovich2023-11-021-2/+2
| | | | | | | | | | | | | | `gcc-14` added a new `-Walloc-size` warning that makes sure that size of an individual element matches size of a pointed type: https://gcc.gnu.org/PR71219 `swaybg` triggers it on `calloc()` calls where member size is used as `1` (instead of member count): ../main.c:492:32: error: allocation of insufficient size '1' for type 'struct swaybg_output_config' with size '48' [-Werror=alloc-size] 492 | config = calloc(sizeof(struct swaybg_output_config), 1); | ^
* build: drop intermediate protocols librarySimon Ser2022-12-041-37/+20
|
* build: find native wayland-scanner programSimon Ser2022-12-041-2/+1
|
* build: bump to version 1.2.0Simon Ser2022-12-041-1/+1
|
* Fix build on Debian Stablenerdopolis2022-11-271-0/+5
|
* Use shm_open instead of mkstemp for anon filesManuel Stoeckl2022-11-241-46/+28
|
* Optimize solid color with single-pixel-buffer-v1Simon Ser2022-09-162-0/+42
| | | | References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/104
* man: fix background color input formatManuel Stoeckl2022-07-031-1/+1
|
* Replace xdg_output with wl_output v4Simon Ser2022-06-033-102/+57
|
* build: stop using sh for scdocSimon Ser2022-03-111-7/+6
|
* build: stop using join_pathsSimon Ser2022-03-111-8/+7
|
* readme: drop mention of xdg-shell requirementSimon Ser2022-03-101-1/+0
| | | | We don't actually need xdg-shell support.
* Check wl_display_roundtrip return valueSimon Ser2022-03-101-1/+4
| | | | References: https://github.com/swaywm/swaybg/issues/35
* build: bump version to 1.1.1Simon Ser2022-03-101-1/+1
|
* Fix memory leak when using image tile modeManuel Stoeckl2022-03-051-0/+1
| | | | | | | cairo_pattern_t and cairo_surface_t are both reference counted; before this change, `pattern` being leaked kept alive an extra reference to the image to which it referred, thereby leaking the image as well.
* build: set check arg in run_command callSimon Ser2022-03-051-2/+2
| | | | | | | | | Fixes the following Meson warning: WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300
* Add editorconfigJason Nader2021-11-191-0/+22
|
* Only render a new frame when the buffer size changesManuel Stoeckl2021-10-011-1/+25
| | | | | | | | | | | The contents of the buffer associated to an output depend only on the output config (which does not change at runtime), and the buffer dimensions. When the compositor changes the output scale, it often sends a configure event which exactly compensates for the scale change, so that the size of the buffer needed for the surface remains the same. Thus no new frame needs to be rendered.
* build: bump to v1.1Simon Ser2021-07-191-1/+1
|
* build: mark build-time deps as nativeSimon Ser2021-07-191-5/+5
|
* build: find wayland-scanner with pkg-configSimon Ser2021-07-191-9/+5
|
* build: use add_project_arguments instead of configuration_dataSimon Ser2021-07-193-8/+5
| | | | No need to include config.h anymore.
* build: don't align dep equal signsSimon Ser2021-07-191-2/+2
|
* readme: mark git dep as optionalSimon Ser2021-07-191-1/+1
|
* readme: append / to dirname in compilation instructionsSimon Ser2021-07-191-3/+3
| | | | | Makes it more obvious that build/ is a directory, not a sub-command.
* readme: cleanup dep listSimon Ser2021-07-191-4/+2
|
* readme: update PGP keySimon Ser2021-07-191-1/+1
|
* ci: add .build.ymlSimon Ser2021-07-191-0/+17
|
* Load images on every frame renderManuel Stoeckl2021-07-191-16/+39
| | | | | | | | | | | | | | This change keeps the full-size cairo_surface_t objects unloaded until they are needed to produce buffers for the outputs' surfaces. This can slow down background rendering when output scales or sizes change, or when a new output is created; in exchange, it significantly reduces the amount of memory that swaybg must retain while it is not rendering something. To reduce peak memory usage, dirty outputs are redrawn drawn in batches grouped by which image they use. This ensures at most one image is loaded at a time.
* Create/destroy a new shm buffer per frameManuel Stoeckl2021-07-193-60/+13
| | | | | | | | | Caching these actually increased memory usage after startup; compositors like Sway tend to release the buffer on receipt (since they have already copied the shm buffer to an OpenGL equivalent) so the shm buffer is no longer needed after being used. Outputs (when not in nested mode) are generally only configured/drawn once, so there is no point in caching data for the future.
* Deduplicate loads of the same image fileManuel Stoeckl2021-07-191-14/+64
| | | | | This reduces memory usage and startup time when different configs load the same image.
* React only to most recent configure eventManuel Stoeckl2021-06-221-4/+19
| | | | | | | When outputs are dynamically resized, as can happen when sway is run nested with its wayland or x11 backend, layer shell programs receive a stream of configure events. In such cases, only rendering a frame for the last configure event avoids wasted computation.
* cairo: Replace <cairo/cairo.h> by <cairo.h>Issam E. Maghni2021-05-107-10/+10
| | | | Same as https://github.com/swaywm/sway/pull/6262
* Fix typoElyes HAOUAS2021-04-121-1/+1
| | | | Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>