summaryrefslogtreecommitdiff
path: root/main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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-191-9/+8
| | | | | | | | | 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-101-1/+1
| | | | Same as https://github.com/swaywm/sway/pull/6262
* Default to all outputs when no output specifiedCaleb Bassi2019-04-261-14/+4
| | | | | | | Before, `--output "*"` had to be specified on the cli before any appearance options if trying to configure all outputs. However, the manpage states that all outputs would be used by default if none were specified.
* Split swaybg into a standalone projectDrew DeVault2019-04-251-14/+31
|
* swaybg: one instance for all outputsBrian Ashworth2019-04-041-127/+325
| | | | | | | | | This makes it so there will only be one swaybg instance running instead of one per output. swaybg's cli has been changed to a xrandr like interface, where you select an output and then change properties for that output and then select another output and repeat. This also makes it so swaybg is only killed and respawned when a background changes or when reloading.
* Replace wlr_log with sway_logM Stoeckl2019-01-211-7/+7
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* swaybg: use wl_surface_damage_bufferemersion2019-01-171-2/+2
|
* swaybg: use output names instead of output indexesemersion2019-01-171-33/+108
|
* Sway clients: Exit gracefully when compositor is unavailableRyan Dwyer2018-10-151-1/+6
|
* swaybg: fix increasingly smaller bg on hotplugBrian Ashworth2018-09-231-0/+4
| | | | | | | | | | | | | | | | render_background_image alters the scale that cairo uses. Depending on the image mode, resolution, and image size, this may cause the surface to be rendered increasingly smaller. By calling cairo_save and cairo_restore, any changes to the cairo settings by the function are not kept as a side effect. The surface that swaybg uses is also now cleared before rendering a frame. This is needed to avoid artifacts on resolution or scale changes with certain combinations of image modes, resolutions, and image sizes. This was also part of the increasingly smaller background visual since it made it so it was not obvious the region being rendered to was smaller and caused an increasing number of smaller images to be appear for each hotplug.
* Allow a fallback color to be specified for swaybgBrian Ashworth2018-08-081-1/+12
| | | | | | This allows for a color to be set when the wallpaper does not fill the entire output. If specified, the fallback color is also used when the image path is inaccessible.
* swaybar/bg: Fix crash on DPMS offminus2018-07-141-0/+3
| | | | | When turning off displays via DPMS, swaybar and swaybg still tried to render, but did not get a valid buffer, causing them to crash.
* Update for swaywm/wlroots#1126emersion2018-07-091-3/+3
|
* swaybg: remove assertions with side-effectsemersion2018-05-071-5/+8
|
* Initial swaylock portDrew DeVault2018-04-041-20/+8
|
* Move swaybg background rendering into common/Drew DeVault2018-04-041-107/+6
| | | | swaylock will use it too
* Merge pull request #1710 from emersion/swaybg-empty-input-regionDrew DeVault2018-04-031-0/+5
|\ | | | | swaybg: set an empty input region
| * swaybg: set an empty input regionemersion2018-04-031-0/+5
| |
* | swaybg: rename w{width,height} to buffer_{width,height}emersion2018-04-031-15/+16
| |
* | swaybg: add HiDPI supportemersion2018-04-031-6/+42
|/
* Set exclusive zone to -1 for swaybgDrew DeVault2018-03-301-0/+1
|
* Address review commentsDrew DeVault2018-03-281-31/+13
|
* Refactor configure/ack configure/commit flowDrew DeVault2018-03-281-10/+5
|
* s/scaling_mode/background_mode/gDrew DeVault2018-03-281-24/+24
| | | | Since it now includes SOLID_COLOR this is a more appropriate name.
* Implement image backgroundsDrew DeVault2018-03-281-2/+112
|
* Add solid-color rendering to swaybgDrew DeVault2018-03-281-0/+187
|
* Add client protocols and swaybg skeletonDrew DeVault2018-03-281-182/+7
|
* swaybg: check that background can be loadedLinus Heckemann2017-07-031-0/+8
|
* Add client support for HiDPIDrew DeVault2016-09-051-15/+19
| | | | This adds HiDPI support to swaybar, swaybg, and swaylock.
* implement solid color rendering for swaybgZandr Martin2016-07-301-95/+121
|
* Turn swaybg into a shell surfaceDrew DeVault2016-07-171-0/+1
|
* Revert "swaybg: Make swaybg a shell surface"David Eklov2016-07-141-1/+0
| | | | | | | This reverts commit 99bda4afe27d9e5723ab6b0ebe5eabb0caaa8eeb. It turned out that code to handle swaybg as shell surface was broken so we don't want to make swaybg a shell surface until this has been fixed.
* swaybg: Make swaybg a shell surfaceDavid Eklov2016-07-041-0/+1
|
* Correctly exit sway on errors.Mikkel Oscar Lyderik2016-02-261-2/+2
| | | | | | | | Calling `exit` in sway_terminate prevents sway from correctly shutting down (freeing data, cleanly terminating the ipc server, etc.). A better way is to exit straight away if the failure occurs before `wlc_run` and use sway_abort as usual if it occur when wlc is running.
* make gdk-pixbuf dependency really optionalprogandy2015-12-201-0/+4
|
* Copy+paste swaybg code to swaylock for testingDrew DeVault2015-12-101-2/+2
|
* Discover swaylock extension in registryDrew DeVault2015-12-101-1/+0
|
* Refactor gdk pixbuf code into shared client libDrew DeVault2015-12-101-107/+2
|
* Style enforcementDrew DeVault2015-12-081-1/+1
|
* swaybg: load more image formats with gdk-pixbuf2progandy2015-12-071-1/+118
| | | | travis: added gdk-pixbuf2 dependency
* Add swaybar basicsDrew DeVault2015-11-291-3/+1
| | | | | This should make the bar open and appear as the panel, once sway supports panels. Right now it crashes sway!
* Use macros for exit valuesChristoph Gysin2015-11-281-1/+1
|
* Rearrange logging headersDrew DeVault2015-11-281-0/+1
| | | | Ref #270
* Style fixes in swaybgDrew DeVault2015-11-271-39/+39
| | | | | CONTRIBUTING.md's code example is sourced from this file, so I updated it as well.
* Fix build warningsDrew DeVault2015-11-271-1/+1
|
* Style enforcementDrew DeVault2015-11-271-59/+58
|