aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2024-09-23input/keyboard: extend bindsym --to-code to work with duplicate matchesbindsym-tocode-dup-childrenFurkan Sahin-1/+1
This modifies `get_active_binding` to treat bindsym --to-codes separately: per each keysym `i` in `binding->keys`, look through the list of matching keycodes in `binding->translations[i]`. Another solution is to take the cartesian product of all syms and make a binding per each product. This makes retranslation more difficult though because the dups from the old layout have to be cleared out before translating to the new `xkb_layout`. Whether by retaining a parent binding, searching through all bindings for matching `binding->command`, or some other ref count structure, that would introduce more complexity than modifying get_active binding to account for dups. Notice this requires no changes to the existing retranslation logic.
2025-07-10Add xdg_toplevel tag to criteriaFurkan Sahin-0/+1
2025-07-10Wire up xdg-toplevel-tag-v1Furkan Sahin-0/+8
2025-07-08Add features.hdr to output IPC responseFurkan Sahin-0/+2
2025-01-27Add support for HDR10 outputFurkan Sahin-1/+5
2025-05-06Drop sway_output.events.disableFurkan Sahin-5/+5
In general wl_signal isn't well-suited for Sway: Sway doesn't need any modularity, and signals make it trickier to track down exactly what happens down the stack. Replace Sway's output disable signal with a simple list tracking for the only user.
2025-06-28Revert "sway/tree: Simplify sway_node teardown"Furkan Sahin-7/+12
This reverts commit d2ef57e60c89c7cb3c652a932de37fd560b9addd. This change tried to remove nodes from all points of reference to allow immediate destruction. However, it missed things like the children lists cloned by transaction states of parent nodes. Adding all that extra cleanup would not be in the spirit of a PR claiming to simplify teardown. Let's wait for someone to come up with a cleaner approach instead. Fixes: https://github.com/swaywm/sway/pull/8738
2025-05-26sway/tree: Simplify sway_node teardownFurkan Sahin-12/+7
A sway_node may end up being referenced in either a queued transaction, pending transaction or as a dirty node. To manage this, the transaction system has been responsible for destroying containers, workspaces and outputs at the end of their last referenced transaction. This significantly complicates the teardown flow of surfaces and outputs. Instead, remove the node from transactions and dirty lists so that the callsite can remove and free the node immediately.
2025-05-25Add support for toplevel captureFurkan Sahin-1/+13
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5078
2025-06-16Rename get_current_time_msec to get_current_time_in_msec and move to util.cFurkan Sahin-0/+2
get_current_time_msec conflicts with a function with the same name in wlroots.
2025-06-05Remove trailing spacesFurkan Sahin-2/+2
2025-06-05server: fix socket path memory leakFurkan Sahin-1/+1
The socket path allocated with strdup() in server_init() was not being freed in server_fini(). Remove const qualifier and add proper cleanup.
2025-03-27swaybar: deduplicate mode and workspace rendering codeFurkan Sahin-0/+5
The render_workspace_button and render_binding_mode_indicator functions are almost the same. This commit extracts the common rendering code into a new render_box function.
2025-05-06tree/workspace: Remove exclude arg from get_highest_availableFurkan Sahin-1/+1
workspace_output_get_highest_available took an output to exclude as argument, meant to avoid accidentally reselecting an output we are evacuating workspaces from. Outputs are now removed from the list before we evacuate, making exclusion unnecessary. Remove the argument.
2025-04-20Use pthread_atfork() to restore signals and NOFILE limitFurkan Sahin-3/+0
This ensures these functions are always called (even when a library such as wlroots or libc perform the fork) and removes the need to manually call them.
2024-07-13Drop wl_drm againFurkan Sahin-1/+0
In [1] we re-introduced a debug flag to enable wl_drm. Time has passed and Xwayland + VA-API + amdvlk now all support linux-dmabuf-v1. [1]: https://github.com/swaywm/sway/pull/7916
2025-04-17server: move sway_terminate() definition to headerFurkan Sahin-0/+2
2025-03-21server: recreate renderer in idle callback to avoid UAFFurkan Sahin-0/+1
Destroying the wlr_renderer in a callback to its own renderer_lost event is unsafe due to wl_signal_emit*() still accessing it after it was destroyed. Delegate recreation of renderer to an idle callback and ensure that only one such idle callback is scheduled at a time by storing the returned event source.
2025-02-18tree/container: remove event listeners on destroyFurkan Sahin-0/+1
Change begin_destroy to remove event listeners before the final destroy, since otherwise event listeners would be removed twice, which crashes. This fixes a crash in wlroots listener checks. See #8509.
2025-02-18input/text_input: remove event listeners on destroyFurkan Sahin-0/+2
sway_input_method_relay can be destroyed from two sources, either the seat is destroyed or the manager protocol objects are destroyed due compositor exit. This fixes a crash in wlroots listener checks. See #8509.
2025-02-18desktop/idle_inhibit: remove event listeners on destroyFurkan Sahin-0/+1
This fixes a crash in wlroots listener checks. See #8509.
2025-02-18input/input-manager: remove event listeners on finiFurkan Sahin-0/+2
This fixes a crash in wlroots listener checks. See #8509.
2025-03-09Use SIG_IGN for SIGCHLD instead of our own handlerFurkan Sahin-0/+1
The behavior of handlers registered with signal(3p) is not well-defined for signals delivered more than once, as laid out in the man page. We should replace our use of signal with sigaction, but for SIGCHLD specifically we can also just skip the signals altogether by setting the handler to SIG_IGN which causes child reaping to not be required. Fixes: https://github.com/swaywm/sway/pull/8567
2025-03-09sway/server: create ext-data-control managerFurkan Sahin-1/+2
2025-02-18output: Expose output_configure_scene to headerFurkan Sahin-0/+3
2024-02-12Add ext-image-copy-capture-v1 and ext-image-capture-source-v1Furkan Sahin-0/+1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4545
2022-08-07criteria: add sandbox propertiesFurkan Sahin-0/+3
2024-12-26tree/view: add getters for sandbox propertiesFurkan Sahin-0/+6
2025-01-07stringop: move over has_prefix()Furkan Sahin-0/+2
2024-11-17ipc-server: Force modeset if needed after executing commandsFurkan Sahin-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.
2024-11-11config: Force modeset before running deferred configsFurkan Sahin-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
2024-09-21desktop/output: Expose request_modesetFurkan Sahin-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.
2024-08-04text_input: Properly handle map/unmap eventsFurkan Sahin-0/+2
The last implementation would ignore these and get it could get into a bad state where it would start crashing sway.
2024-08-04text_input: Move popup placement to own functionFurkan Sahin-0/+1
2024-08-29config/output: Add support for 6-bit render fmtFurkan Sahin-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.
2024-09-18ext-session-lock: Do not use commit listener to arrangeFurkan Sahin-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.
2024-09-09config/output: Rename to apply_stored_output_configsFurkan Sahin-1/+1
2024-09-09config/output: Accept a list of output_configs to useFurkan Sahin-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.
2024-09-03(desktop|tree)/output: Do not use layout listener to arrangeFurkan Sahin-5/+0
Output layout changes originate from the centralized modeset infrastructure and request_state which already takes care of arranging and updating outputs as needed.
2024-09-03desktop/output: Do not use commit listener to arrangeFurkan Sahin-1/+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.
2024-09-02move title_format to containerFurkan Sahin-2/+4
2024-08-14output: Use wlr_scene_set_gamma_control_manager_v1Furkan Sahin-3/+0
2024-08-05Add support for tearing-control-v1Furkan Sahin-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.
2024-04-10Implement clickfinger_button_map support.Furkan Sahin-0/+2
2024-07-03tree/container: drop decl for container_update_textures_recursive()Furkan Sahin-2/+0
This function doesn't exist anymore.
2024-03-28desktop/output: Debounce modesetsFurkan Sahin-0/+2
Output changes often happen in rapid succession. Instead of doing the modesets one by one, set a 10 millisecond debounce timer.
2023-07-17sway/commands/output: Add command to set color profileFurkan Sahin-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-25Drop server.h include from input/input-manager.hFurkan Sahin-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-24server: hide xdg_output from unprivileged clientsFurkan Sahin-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-18build: drop xwayland optionFurkan Sahin-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.