summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2024-11-28ipc-server: Force modeset if needed after executing commandsKenny Levinsen-0/+1
IPC clients generally expect executed commands to have taken effect when the command completes, while delayed modeset means that it can take several milliseconds more before e.g. an output is enabled. However, modesetting on every output command in the IPC call could on systems with already slow modesetting behavior lead to an unresponsive system for a not insignificant period of time. To strike a balance, force modeset once all the commands of this IPC call have executed if a modeset is pending. (cherry picked from commit a2c73c9b8b426417e0253ea0420b98298af1c963)
2024-11-28config: Force modeset before running deferred configsKenny Levinsen-0/+1
Some commands require outputs to be enabled. These commands are deferred to allow outputs to be discovered, but the delayed modeset might only run some time later. Force a modeset to occur before running deferred commands. Fixes: https://github.com/swaywm/sway/issues/8433 (cherry picked from commit 6111297d91faf5f2820acaa14d76d6389b469b77)
2024-09-29desktop/output: Expose request_modesetKenny Levinsen-0/+2
We remove the struct sway_server argument for consistency with the rest of our internal APIs which rely on the global server instance. (cherry picked from commit b73f54a966a30c2253818b89fefda16477531c14)
2024-09-21ext-session-lock: Do not use commit listener to arrangeKenny Levinsen-0/+6
Arranging lock surfaces rely on the sway_output width and height being updated, but these are only updated after the commit has been completed and all commit listeners have executed. This means that the lock surfaces will not be appropriately scaled to match a change in output dimensions, and may reveal what is under the lock background. Replace the implicit arrange through the output commit listener with an explicit arrange after the output configuration is finalized. This might have regressed by other transition away from output commit listeners for other arrange tasks, but even then it would have erroneously relied on signalling order. (cherry-picked from 785a459a55d8b55b4bed1fdc55b04c32be5b450c)
2024-09-21config/output: Rename to apply_stored_output_configsKenny Levinsen-1/+1
(cherry-picked from d7a76d381bbe4321578bc3a95fbc82d76b67ef05)
2024-09-21config/output: Accept a list of output_configs to useKenny Levinsen-13/+2
Instead of using a single finalized output config per output, accept a regular list of output configs like the one ultimately stored for configuration purposes. This allows the output management code to test an augmented configuration while still using the same output config logic, without having to mutate the stored configuration. This in turn allows us to make a few APIs private. A bug note about an existing issue with derade to off is added as well. (cherry picked from 29b3f00e6fd99296cde7e94b7063acfd075c559c)
2024-09-21(desktop|tree)/output: Do not use layout listener to arrangeKenny Levinsen-4/+0
Output layout changes originate from the centralized modeset infrastructure and request_state which already takes care of arranging and updating outputs as needed. (cherry picked from af28ac04a4d523aecd74dacc94a91f7d9e537982)
2024-09-21desktop/output: Do not use commit listener to arrangeKenny Levinsen-0/+2
The reasoning for using a commit handler is to ensure that all paths for output changes are correctly handled. With the centralized modeset infrastructure in place, we can move the logic there. This allows us to be smarter and avoid extraneous arranges, output manager updates and transaction commits. The side-effect is a minor duplication for the special-case request_state, but the shared path will be relied upon further in future commits to justify this duplication. (cherry picked from commit b83e5aaa546792336ecc60d2e61708f3cd6b1f5d)
2024-09-20text_input: Properly handle map/unmap eventsAlexander Orzechowski-0/+2
The last implementation would ignore these and get it could get into a bad state where it would start crashing sway. (cherry picked from commit 74e507962e32ec8d6606d28383ac109fbf2370e4)
2024-09-20text_input: Move popup placement to own functionAlexander Orzechowski-0/+1
(cherry picked from commit 1537c9dae53eebea4926321aa9f7fd982375859f)
2024-09-20config/output: Add support for 6-bit render fmtKenny Levinsen-0/+1
GUD devices uses RGB565 by default for performance reasons. Allow specifying render_bit_depth 6 to pick this format. The definition works out if you consider the maximum number of bits per channel instead of the average. (cherry picked from commit 034d02f8a5099ad1283ce3bd1ced524a17f8ba2f)
2024-09-20move title_format to containerNorbert Bolanowski-2/+4
(cherry picked from commit be840f730e747a24106c8366ecb89e6b982cfa38)
2024-09-20Add support for tearing-control-v1Ricardo Steijn-0/+22
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3871 Adds option to allow tearing per output, as well as an option to force enable or disable tearing for a specific application using a window rule. Only works with fullscreen applications. (cherry picked from commit 9a1c411abd8261c121dcd50dfe54132718768084)
2024-07-04Implement clickfinger_button_map support.TarcĂ­sio Eduardo Moreira Crocomo-0/+2
2024-07-03tree/container: drop decl for container_update_textures_recursive()Simon Ser-2/+0
This function doesn't exist anymore.
2024-07-03desktop/output: Debounce modesetsKenny Levinsen-0/+2
Output changes often happen in rapid succession. Instead of doing the modesets one by one, set a 10 millisecond debounce timer.
2024-06-07sway/commands/output: Add command to set color profileManuel Stoeckl-0/+6
This makes it possible to render output buffers in a different color space, by specifying an ICC profile for the output.
2024-05-27Drop server.h include from input/input-manager.hSimon Ser-1/+6
The only reason it's included there is for a declaration of struct sway_server, but we can just forward-declare it. This avoids rebuilding almost all of Sway when touching server.h. All other server.h includes are from source files, not headers.
2024-05-27server: hide xdg_output from unprivileged clientsSimon Ser-0/+2
Regular Wayland clients shouldn't care about the position or size of outputs. Hide xdg_output from unprivileged clients to make sure they're not doing shenanigans with this information.
2024-05-21build: drop xwayland optionSimon Ser-12/+13
Instead of having a build-time option to enable/disable xwayland support, just use the wlroots build config: enable xwayland in Sway if it was enabled when building wlroots. I don't see any use-case for disabling xwayland in Sway when enabled in wlroots: Sway doesn't pull in any additional dependency (just pulls in dependencies that wlroots already needs). We have a config command to disable xwayland at runtime anyways. This makes it so xwayland behaves the same way as other features such as libinput backend and session support. This also reduces the build matrix (less combinations of build options). I think we originally introduced the xwayland option when we didn't have a good way to figure out the wlroots build config from the Sway build system.
2024-05-02config/output: Search for output config fallbacksKenny Levinsen-1/+4
The original sway output config implementation enabled one output at a time, testing modes, render formats and VRR support as it went along. While this sort of fallback is easy to do, it has the downside of not considering the effect of neighbor outputs on the configuration viability. With backend-wide commits, we can now better consider the effect of neighbor outputs, but to handle the fact that we commit all outputs at once we need to perform a more elaborate search of viable configurations. Implement a recursive configuration search for when the primary configuration failed to apply.
2024-04-12config/output: Refactor handling of tiered configsKenny Levinsen-1/+8
Output configuration can be applied to a particular output in three ways: As a wildcard, by connector name and by identifier. This in turn means that three different configurations must be handled at any given time. In the current model, this is managed by merging new configuration into every other matching configuration. At the same time, an additional synthetic configuration is made which matchehes both identifier and name at the same time, further complicating logic. Instead, manage and store each configuration independently and merge them in order when retrieving configuration for an output. When changes are made to a less specific configuration, clear these fields from more specific configurations to allow the change to take effect regardless of precedence. Fixes: https://github.com/swaywm/sway/issues/8048
2024-03-28output/config: Remove unused test_output_configKenny Levinsen-2/+0
2024-03-28config/output: Make merge_output_config staticKenny Levinsen-2/+0
2024-03-28output/config: Remove reset_outputs and co.Kenny Levinsen-4/+0
apply_output_config_to_outputs uses the specified output config to check which outputs to apply to, and to use as backup when no config is found. If any config matches the output, the specified config will be disregarded. The only remaining user of apply_output_config_to_outputs is reset_outputs, which called apply_output_config_to_outputs with either the first stored wildcard config, or a new empty wildcard config. Providing a stored or empty wildcard config is practically the same as calling `apply_all_output_configs`. Replace uses of `reset_outputs` with `apply_all_output_configs` and remove the now unused functions.
2024-03-28config/output: Remove apply_output_configKenny Levinsen-2/+0
2024-03-28output/config: Add apply_all_output_configsKenny Levinsen-0/+2
Apply all output configs as they are. This differs from apply_output_config_to_outputs, which tries to apply a specific output config.
2024-03-28config/output: Introduce apply_output_configsKenny Levinsen-0/+11
Introduce apply_output_configs, which applies the specified matched output configs as a single backend commit. Reimplement apply_output_config_to_outputs using apply_output_configs.
2024-03-18Implement transient seat managementAndri Yngvason-0/+4
2024-03-14Re-create renderer when lostSimon Ser-0/+1
2024-03-08config/output: drop enabling flagSimon Ser-1/+1
This was useful when wlroots backends were updating the current mode on their own. This is no longer the case.
2024-03-08xdg-shell: implement popup repositioningSimon Ser-0/+1
2024-02-28Convert to new pointer enumsSimon Ser-4/+4
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
2024-02-20text_input: Implement input-method popupsAccess-0/+23
Co-authored-by: tadeokondrak <me@tadeo.ca>
2024-02-17xdg-activation: distinguish activation and urgency requestsAleksei Bavshin-0/+6
Check if the app that requested a token has provided a valid input serial and a focused surface. Downgrade activation request to urgency otherwise. This is mostly in line with what other Wayland compositors decided to do, and offers a better security than the original logic.
2024-02-17launcher: track the seat in the launcher ctxRonan Pigott-0/+3
This is a more suitable place to track the requesting seat, since we are able to respond appropriately to destroy notifications.
2024-02-15Drop unnecessary includes from sway/server.hSimon Ser-17/+0
2024-02-15Fix build with wlroots DRM backend disabledSimon Ser-1/+0
The header is not installed by wlroots when the DRM backend is disabled. We don't need it here, so don't include it. Closes: https://github.com/swaywm/sway/issues/7943
2024-02-12view: drop ext_foreign_destroyKirill Primak-1/+0
It's not used and causes a crash when a view is destroyed.
2024-02-12layer_shell: Handle popups through popup descriptorAlexander Orzechowski-1/+4
We tried to synchronize layer shell popups with the parent layer shell on commits, but this is subtly wrong because we would only update the position for one layer shell that was committed, but not any other layer that might be affected. By moving handling to the scene descriptor we can iterate all popups and ensure they are synchronized.
2024-02-12xdg_shell: Extract struct for popup descriptorAlexander Orzechowski-0/+7
2024-02-12layer_shell: Arrange popups even if exclusive zone doesn't changeAlexander Orzechowski-0/+3
2024-02-12ext-foreign-toplevel-list: Implement protocolMerlin Lex-0/+7
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4543
2024-01-20Add debug flag to re-enable wl_drmSimon Ser-0/+1
7e69a7076fc8 ("Drop wl_drm") has dropped wl_drm, however a lot of software wasn't quite ready for this (Xwayland, libva, amdvlk). Keep wl_drm disabled by default to pressure the wl_drm phase-out, but add a -Dlegacy-wl-drm flag for users to restore the previous behavior in the meantime. References: https://github.com/swaywm/sway/issues/7897
2024-01-18scene_graph: port wlr_forgein_toplevel_management output enter/leave eventsAlexander Orzechowski-0/+4
2024-01-18remove damage debug optionsAlexander Orzechowski-7/+0
Now that we use wlr_scene, wlroots handles these. If available use the wlroots debug options instead.
2024-01-18scene_graph: Implement toplevel clippingAlexander Orzechowski-1/+1
2024-01-18container: Don't track outputsAlexander Orzechowski-22/+0
The scene graph abstraction does this for us
2024-01-18Delete old damage tracking codeAlexander Orzechowski-67/+0
The new scene graph abstraction handles this for us.
2024-01-18scene_graph: Port view saved buffersAlexander Orzechowski-15/+3