aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorLines
2025-04-19logszwlr_keyboard_interactivity-on_demand-behaviorFurkan Sahin-2/+8
2025-04-13logsFurkan Sahin-0/+4
logg
2025-05-07move: fix broken titlebar when moving child to new workspaceFurkan Sahin-0/+1
Before this commit, when moving a non-leaf child of a tabbed or stacking container to a new workspace, the child would be detached from the parent container and the grandchildren would be sent to the new workspace but the child itself wouldn't be destroyed causing the titlebar to still be rendered as part of the parent container. Fixes #8648.
2025-04-25input/seatop_down: Update decorations for touchscreen inputsFurkan Sahin-0/+1
fixes #8675
2025-05-04transaction: Ensure all tabs are visible in tabbed modeFurkan Sahin-0/+2
Before this commit when a child of a tabbed or stacking container was taken out of fullscreen and a different sibling was focused in the same transaction, the titlebar of the previously fullscreen container would remain hidden. This commit makes sure that scene tree for decorations is enabled for all containers within a tabbed or stacking container when it is arranged.
2025-04-29config/output: Fix missing output config supersedesFurkan Sahin-0/+10
color_transform and allow_tearing was not handled by supersede_output_config which could lead to configuration being incorrectly applied.
2025-04-30config/output: Use INT_MAX as x/y unset valueFurkan Sahin-8/+8
We oftne use -1 to indicate unset values. In case of output (x, y), we would consider the fields set if they are not both -1. This means that (0, -1) and (-1, 0) are valid coordinates, but (-1, -1) is not. We support negative output positioning, so we cannot use -1 to mean unset. Zero is also not an option as that would disallow reverting a set position back to (0, 0). INT_MAX is an unreasonable output position, so use it to indicate unset values, and only use the value when both are set.
2024-05-03Fix includes with relative pathsFurkan Sahin-20/+4
The function `load_include_configs` already changes the directory to the one containing the parent config. Therefore, `load_include_config` trying to assemble the "full" path leads to repetition of path segments, making the `realpath` call fail with ENOENT. Just calling `realpath` on the path itself from the directory with the parent configuration is sufficient, so there is no point in passing `parent_dir` to `load_include_config`.
2025-04-27build: bump version to 1.11-rc21.11-rc2Furkan Sahin-1/+1
2025-04-24sway/commands: Handle incorrect resize unitFurkan Sahin-1/+1
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width.
2025-04-27Replace signal() with sigaction()Furkan Sahin-8/+12
The man page for signal(3) reads: > new applications should use sigaction() rather than signal()
2025-04-20Use pthread_atfork() to restore signals and NOFILE limitFurkan Sahin-28/+23
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.
2025-04-20build: bump version to 1.11-rc11.11-rc1Furkan Sahin-1/+1
2024-07-13Drop wl_drm againFurkan Sahin-7/+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-2/+3
2025-04-17swaymsg, swaynag: drop sway_terminate() definitionsFurkan Sahin-9/+0
These are unused.
2025-04-16layer_shell: destroy layer_surface on assigned output destructionFurkan Sahin-1/+1
According to the spec, the closed event should be sent when the surface is no longer shown, because the output may have been destroyed or the user may have asked for it to be removed. In such cases, the clients should destroy the resource. This fixes mako not being able to show notifications if the assigned output was destroyed while a notificataion was still visible Fixes: f2f4af868bfa ("scene_graph: Port layer_shell")
2025-04-14Remove duplicate arrange_containerFurkan Sahin-1/+0
2025-04-14Fix crash on shutdown when Xwayland is disabledFurkan Sahin-3/+5
2025-04-14server: fix shutdown crash when running on x11 backendFurkan Sahin-1/+3
Signed-off-by: Loukas Agorgianitis <loukas@agorgianitis.com>
2025-03-21server: recreate renderer in idle callback to avoid UAFFurkan Sahin-3/+16
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-2/+18
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-2/+38
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/+12
This fixes a crash in wlroots listener checks. See #8509.
2025-02-18input/input-manager: remove event listeners on finiFurkan Sahin-0/+11
This fixes a crash in wlroots listener checks. See #8509.
2025-02-18server: remove event listeners on finiFurkan Sahin-0/+21
This fixes a crash in wlroots listener checks. See #8509.
2024-06-11idle_inhibit: Check if layer surface output is enabledFurkan Sahin-2/+5
While we we cannot easily check for true visibility of layer surfaces as easily as for views, we can check at least check that the output associated with the surface is enabled.
2024-05-23idle_inhibit: Assume view is invisible by defaultFurkan Sahin-2/+2
We have historically considered surfaces without a view visible. This made sense in case of layer surfaces which do not have a view, but it also allows unmapped surfaces to act as global inhibitors irrespective of the current view state, which is not the intention fo the protocol. As we now explicitly handle layer surfaces, assume that views are only visible if they can be found and their visibility checked.
2024-05-23idle_inhibit: Explicitly handle layer surfacesFurkan Sahin-1/+8
Layer surfaces do not have a view, and while they can be occluded they are always visible on their associated output - assuming it is enabled.
2024-05-23idle_inhibit: Ignore inhibitors when lockedFurkan Sahin-0/+25
When a session is locked, no views are visible and there is no way to interact with the user session. This means that all inhibitors based on visibility - with the exception being inhibitors on the session lock surfaces themselves - become inert, allowing the session to go idle. The only inhibitor type on normal views that one could argue should remain active is INHIBIT_IDLE_OPEN, but for now we disable all view inhibitors regardless of type.
2025-03-09Use wl_event_loop_add_signal for exit signalsFurkan Sahin-14/+18
This avoids calling non-async-signal-safe functions from within a signal handler.
2025-04-08ipc: standardize pretty print with raw printFurkan Sahin-1/+1
`swaymsg -t get_inputs --raw` calls it a pointer but `--pretty` calls it a Mouse. Previous commit 16300ca2d that set this to pointer probably forgo to update the pretty one. closes #8584
2025-03-26Fix tabbed/stacking container height regressionFurkan Sahin-6/+6
Commit faed848 added a bounds check on `height - title_bar_height`, repurposing the local variable `height` in an attempt to DRY out the expression. However, because re-assignment occurs inside the loop body, its result would leak across loop iterations, compounding its effect and leading to the artifact reported in issue #8625, where each child except the first in a tabbed container would acquire a visible waterline. Introduce a second variable and reset it in each loop iteration to get rid of the waterline. Fixes #8625.
2025-02-11man: clarify criteria (incl. PCRE2 usage)Furkan Sahin-3/+13
Replace the XWayland-only class attribute in the examples: - The first example given should work for Wayland-native windows. - The example 'Kill all windows with the title "Emacs"' should use title, not class. Also, it's a substring (regex) match. There are many different implementations of regular expressions with incompatible syntax. For example, GNU grep alone provides three different ones. Clarify the use of PCRE2 by sway criteria.
2025-03-12Avoid crashing on too many containersFurkan Sahin-12/+33
If far too many containers are created, they can become so small that their size calculations come out negative, leading to crashes on asserts. Instead, set a lower bound for sizes and disable the container entirely if it goes below it, giving whatever space it used to the last container. The splits are not recalculated, so currently the effect is that if all containers have the same width fraction, they keep getting narrower until at some point they all round to zero and the last container will be given all the available space. A better behavior would have been if the additional container did not contribute to size and fraction calculations at all, but it's an extreme edge-case, anything is better than crashing, and this is easier to implement.
2025-03-20stringop: fix has_prefix() arg order in config parsingFurkan Sahin-3/+3
has_prefix() expects the prefix to be the 2nd argument, not the first. The config parsing was broken when using `--input-device=`. Introduced by: 86d128b708d76a76587d4ce796b567ba4be36e66 "Use has_prefix() instead of strncmp() throughout"
2025-03-20text_input: Fix ime panic in ext-session-lockFurkan Sahin-0/+29
in the origin text_input.c, we only check the sway_view and layershell, but now we have the third shell named sessionlock, so we need to modify both text_input.c and view.c to handle the new type of shell
2025-03-19desktop/output: Skip repaint if wlr_output is disabledFurkan Sahin-1/+1
When the repaint timer fires, we check if the sway_output is disabled, and if so, skip the output commit after having reset frame_pending. The sway_output enable flag is only updated if the output is disabled and removed from the layout, not if the power is disabled for e.g. idle. This can lead to situations where a commit is attempted on a disabled output, which will lead to an attempted and failed primary swapchain allocation. Use the wlr_output.enabled state to check if the output is active.
2025-03-12sway/commands: Return error if container is not in scratchpadFurkan Sahin-2/+2
2025-03-16Fix output repositioning in global fullscreenFurkan Sahin-0/+2
Call wlr_scene_output_set_position when in global fullscreen to correctly set output positions when repositioning outputs (using swaymsg output or similar).
2025-03-09config/output: Reset everything before swaybg execFurkan Sahin-0/+1
swaybar and the exec command reset signal masks, signal handlers and NOFILE limit before exec, but swaybg was missing all that. Reset it for swaybg as well.
2025-03-09Use SIG_IGN for SIGCHLD instead of our own handlerFurkan Sahin-18/+14
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-3/+7
2024-02-04Add the DesktopNames key to the sway.desktop session fileFurkan Sahin-0/+1
According to https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html, to set the value of XDG_CURRENT_DESKTOP, a DesktopNames key is required in the session file. And the value of XDG_CURRENT_DESKTOP is used to run xdg-desktop-portal*. If this value is not set, xdg-desktop-portal-wlr will not run at login.
2025-03-07Remove constraint that con->view != NULL to use __focused__ criteriaFurkan Sahin-2/+1
To use something like: [con_id=__focused__] mark --add --toggle foo The container must currently have a view. However, it is possible to focus parent containers that do not have a view. For example, via: focus parent Since containers without views can be the focused (meaning the container is marked "focused": true in the output of: swaymsg -t get_tree), it seems reasonable that a view is not required to target a container via __focused__.
2025-02-11Rework fork/exec strategyFurkan Sahin-138/+71
cmd_exec_process is used whenever sway is meant to execute a child process on behalf of the user, and had a lot of complexity. In order to avoid having to wait on the user's process, a double-fork was used, which in turn required us to wait on the outer process. In order to track the child PID for launcher purposes, a pipe was used to transmit the PID back to sway. This resulted in sway blocking for 5-6 ms per exec on my system, which is quite significant. The error handling was also quite lacking - the read loop did not handle errors at all for example. Instead, teach sway to handle SIGCHLD and do away with the double-fork. This in turn allows us to get rid of the pipe as we can record the child's PID directly. This reduces the time we block to just 1.5 ms on my system. We'd be able to get down to just 150 µs if we could use posix_spawn(3), but posix_spawn(3) cannot reset NOFILE. clone(2) or vfork(2) would be alternatives, but that presents portability issues. This change is replicated for swaybar, swaybg and swaynag handling, which had similar albeit less complicated implementations.
2025-02-25sway_text_node: Remove use of source boxFurkan Sahin-14/+0
The source box is always set to the full buffer dimensions, making it ineffective. Remove it.
2025-02-25sway_text_node: Apply max_width when renderingFurkan Sahin-2/+2
max_width was applied to the source box, but not to the cairo surface. The cairo surface would therefore take on arbitrarily large dimensions according to the required dimensions to fit the text input, which if large enough would cause failures during output rendering and leave a black hole in the titlebar.
2025-02-18commands/opacity: Call output_configure_scene on updated containerFurkan Sahin-1/+3
Calling container_update() wasn't enough: If there is no visible window decorations (title bar, borders) container_update would basically no-op and the scene wouldn't repaint with the update alpha. By also calling output_configure_scene() we force a call to wlr_scene_buffer_set_opacity() thus ensuring we update the scene. Closes: #8580
2025-02-18output: Allow configuring scene without an outputFurkan Sahin-1/+3