Compare commits

..

13 commits

Author SHA1 Message Date
Simon Ser
93bba7dad5 build: bump version to 1.12-rc2 2026-04-12 18:33:52 +02:00
Alexander Orzechowski
41c94c2c72 container: Move foreign toplevel enter/leave events to view
It made sense to put it on the container level because the protocol cares
about the toplevel and that includes its decorations. But, this breaks
down when we consider if the container's view is fullscreen and the container
decorations are disabled. Moving it to the view manages this expected lifetime
better. Since the buffer is now part of the view, the buffer will get
negative coordinates to act as if it's part of the container when we
want to.

A known issue is that we will send spurious leave/enter events while
we reconfigure the scene for entering/exiting fullscreen. The fix for
this loops back to atomic updates to scene and that is outside of the scope
of this commit.

Fixes: #9000
(cherry picked from commit 81246fc6dc)
2026-04-12 18:33:42 +02:00
Hugo Osvaldo Barrera
0df0173102 Don't ignore initialisation errors
server_init ignores all errors. In practice, theses result in a
segfault, potentially much later and losing any unsaved work.

Properly handle initialisation errors and bail immediately.

(cherry picked from commit 1606311553)
2026-04-12 18:33:42 +02:00
Simon Ser
faedde4e77 build: bump version to 1.12-rc1 2026-03-26 18:42:46 +01:00
Hugo Osvaldo Barrera
4e673a3515 Centre fullscreen surfaces smaller than output
Sway renders fullscreen surfaces smaller than the output left-aligned.

From xdg-shell:

> If the surface doesn't cover the whole output, the compositor will
> position the surface in the center of the output and compensate with
> with border fill covering the rest of the output. The content of the
> border fill is undefined, but should be assumed to be in some way that
> attempts to blend into the surrounding area (e.g. solid black).

Render surfaces smaller than the output centred. Can be tested easily
with:

    weston-simple-egl -f -r

Fixes: https://github.com/swaywm/sway/issues/8845
(cherry picked from commit 909a2ddb5f)
2026-03-26 18:42:43 +01:00
Hugo Osvaldo Barrera
1e96e73767 ext-workspace-v1: initial implementation
Maintain a 1:1 relationship between workspace groups and outputs, so
that moving a workspace across groups effectively moves it across
outputs.

ext_workspace_handle_v1::id is never emitted; sway has no concept of ids
or of stable vs temporary workspaces. Everything is ephemeral to the
current session.

ext_workspace_handle_v1::coordinates is never emitted; sway does not
organise workspaces into any sort of grid.

ext_workspace_handle_v1::assign is mostly untested, because no client
current implements this. Perhaps it's best to not-advertise the feature
for now?

Deactivating a workspace is a no-op. This functionality doesn't really
align with sway, although it could potentially be implemented to "switch
to previous workspace on this output" as a follow-up.

Removing a workspace is a no-op.

Implements: https://github.com/swaywm/sway/issues/8812
(cherry picked from commit f50f78c0d9)
2026-03-26 16:21:46 +01:00
Hugo Osvaldo Barrera
3aa4c46c13 Make workspace_move_to_output reusable
Move workspace_move_to_output out of the command handler, so it can be
re-used for ext_workspace_handle_v1::assign.

(cherry picked from commit 7ba11d6dee)
2026-03-26 16:21:46 +01:00
llyyr
fa889d020b sway_text_node: properly check cairo_t status in text_calc_size
cairo_create never returns NULL, so the previous null check never
triggered. Use cairo_status instead.

(cherry picked from commit 131045ce55)
2026-03-26 16:21:46 +01:00
llyyr
257a0a7548 common/pango: use pangocairo directly instead of cairo_create(NULL)
We never need a cairo context for anything here. Use
pango_cairo_font_map_get_default() and pango_font_map_create_context()
directly instead of bootstrapping via a nil cairo context.

Same as last commit, but just a cosmetic fix in this case since we don't
actually use the cairo context for anything

(cherry picked from commit dea166a27c)
2026-03-26 16:21:46 +01:00
llyyr
9d77163d6e sway_text_node: fix cairo_create without a backing surface
This fixes sway not being able to draw text on text nodes.

cairo_create(NULL) returns a nil object in an error state rather than
NULL, causing the null check to never trigger and passing a broken cairo
context to get_text_size, which was fine until 40e1dcd29f adding error
handling to it and causing pango_cairo_update_layout to fail with a NULL
pointer.

(cherry picked from commit e4870d84a2)
2026-03-26 16:21:46 +01:00
Stephane Fontaine
948d481cfa call disable container in arrange_root
(cherry picked from commit 8378c560c1)
2026-03-26 16:21:46 +01:00
Félix Poisot
07e3c06741 common/pango: get_text_size out pointers may be NULL
Fixes: 2c2a2ec380
Closes: https://github.com/swaywm/sway/issues/9082
(cherry picked from commit 82227d6103)
2026-03-26 16:21:46 +01:00
Simon Ser
1826c38ecd ci: pin wlroots to 0.20.x 2026-03-26 16:21:36 +01:00
5 changed files with 26 additions and 26 deletions

View file

@ -25,7 +25,7 @@ packages:
- hwdata-dev - hwdata-dev
sources: sources:
- https://github.com/swaywm/sway - https://github.com/swaywm/sway
- https://gitlab.freedesktop.org/wlroots/wlroots.git - https://gitlab.freedesktop.org/wlroots/wlroots.git#0.20
tasks: tasks:
- wlroots: | - wlroots: |
cd wlroots cd wlroots

View file

@ -22,7 +22,7 @@ packages:
- hwdata - hwdata
sources: sources:
- https://github.com/swaywm/sway - https://github.com/swaywm/sway
- https://gitlab.freedesktop.org/wlroots/wlroots.git - https://gitlab.freedesktop.org/wlroots/wlroots.git#0.20
tasks: tasks:
- wlroots: | - wlroots: |
cd wlroots cd wlroots

View file

@ -31,7 +31,7 @@ packages:
- misc/hwdata - misc/hwdata
sources: sources:
- https://github.com/swaywm/sway - https://github.com/swaywm/sway
- https://gitlab.freedesktop.org/wlroots/wlroots.git - https://gitlab.freedesktop.org/wlroots/wlroots.git#0.20
tasks: tasks:
- setup: | - setup: |
cd sway cd sway

View file

@ -1,7 +1,7 @@
project( project(
'sway', 'sway',
'c', 'c',
version: '1.13-dev', version: '1.12-rc2',
license: 'MIT', license: 'MIT',
meson_version: '>=1.3', meson_version: '>=1.3',
default_options: [ default_options: [
@ -39,14 +39,14 @@ if is_freebsd
endif endif
# Execute the wlroots subproject, if any # Execute the wlroots subproject, if any
wlroots_version = ['>=0.21.0', '<0.22.0'] wlroots_version = ['>=0.20.0', '<0.21.0']
subproject( subproject(
'wlroots', 'wlroots',
default_options: ['examples=false'], default_options: ['examples=false'],
required: false, required: false,
version: wlroots_version, version: wlroots_version,
) )
wlroots = dependency('wlroots-0.21', version: wlroots_version, fallback: 'wlroots') wlroots = dependency('wlroots-0.20', version: wlroots_version, fallback: 'wlroots')
wlroots_features = { wlroots_features = {
'xwayland': false, 'xwayland': false,
'libinput_backend': false, 'libinput_backend': false,

View file

@ -802,7 +802,7 @@ node and will have the following properties:
Retrieve the currently set marks Retrieve the currently set marks
*REPLY*++ *REPLY*++
An array of marks currently set. Since each mark can only be set for one An array of marks current set. Since each mark can only be set for one
container, this is a set so each value is unique and the order is undefined. container, this is a set so each value is unique and the order is undefined.
*Example Reply:* *Example Reply:*
@ -833,13 +833,13 @@ An array of bar IDs, which are strings
*MESSAGE*++ *MESSAGE*++
When sent with a bar ID as the payload, this retrieves the config associated When sent with a bar ID as the payload, this retrieves the config associated
with the bar ID specified in the payload. This is used by swaybar, but could with the specified by the bar ID in the payload. This is used by swaybar, but
also be used for third-party bars could also be used for third party bars
*REPLY*++ *REPLY*++
An object that represents the configuration for the bar with the bar ID sent as An object that represents the configuration for the bar with the bar ID sent as
the payload. The following properties exist, with more information about their the payload. The following properties exists and more information about what
values in *sway-bar*(5): their value mean can be found in *sway-bar*(5):
[- *PROPERTY* [- *PROPERTY*
:- *DATA TYPE* :- *DATA TYPE*
@ -1040,7 +1040,7 @@ An object containing the following properties:
## 8. GET_BINDING_MODES ## 8. GET_BINDING_MODES
*MESSAGE*++ *MESSAGE*++
Retrieve the list of binding modes that are currently configured Retrieve the list of binding modes that currently configured
*REPLY*++ *REPLY*++
An array of strings, with each string being the name of a binding mode. This An array of strings, with each string being the name of a binding mode. This
@ -1154,13 +1154,13 @@ following properties:
_tablet\_tool_, _tablet\_pad_, or _switch_ _tablet\_tool_, _tablet\_pad_, or _switch_
|- xkb_active_layout_name |- xkb_active_layout_name
: string : string
: (Only keyboards) The name of the active keyboard layout : (Only keyboards) The name of the active keyboard layout in use
|- xkb_layout_names |- xkb_layout_names
: array : array
: (Only keyboards) A list a layout names configured for the keyboard : (Only keyboards) A list a layout names configured for the keyboard
|- xkb_active_layout_index |- xkb_active_layout_index
: integer : integer
: (Only keyboards) The index of the active keyboard layout : (Only keyboards) The index of the active keyboard layout in use
|- scroll_factor |- scroll_factor
: floating : floating
: (Only pointers) Multiplier applied on scroll event values. : (Only pointers) Multiplier applied on scroll event values.
@ -1467,7 +1467,7 @@ one seat. Each object has the following properties:
# EVENTS # EVENTS
Events are a way for clients to get notified of changes to sway. A client can Events are a way for client to get notified of changes to sway. A client can
subscribe to any events it wants to be notified of changes for. The event is subscribe to any events it wants to be notified of changes for. The event is
sent in the same format as a reply. The following events are currently sent in the same format as a reply. The following events are currently
available: available:
@ -1478,7 +1478,7 @@ available:
|- 0x80000000 |- 0x80000000
: workspace : workspace
:[ Sent whenever an event involving a workspace occurs such as initialization :[ Sent whenever an event involving a workspace occurs such as initialization
of a new workspace or another workspace gaining focus of a new workspace or a different workspace gains focus
|- 0x80000001 |- 0x80000001
: output : output
: Sent when outputs are updated : Sent when outputs are updated
@ -1487,7 +1487,7 @@ available:
: Sent whenever the binding mode changes : Sent whenever the binding mode changes
|- 0x80000003 |- 0x80000003
: window : window
: Sent whenever an event involving a window occurs such as it being reparented, : Sent whenever an event involving a window occurs such as being reparented,
focused, or closed focused, or closed
|- 0x80000004 |- 0x80000004
: barconfig_update : barconfig_update
@ -1503,7 +1503,7 @@ available:
: Sent when an ipc client sends a _SEND\_TICK_ message : Sent when an ipc client sends a _SEND\_TICK_ message
|- 0x80000014 |- 0x80000014
: bar_state_update : bar_state_update
: Sent when the visibility of a bar should change due to a modifier : Send when the visibility of a bar should change due to a modifier
|- 0x80000015 |- 0x80000015
: input : input
: Sent when something related to input devices changes : Sent when something related to input devices changes
@ -1522,10 +1522,10 @@ single object with the following properties:
:[ The type of change that occurred. See below for more information :[ The type of change that occurred. See below for more information
|- current |- current
: object : object
: An object representing the affected workspace or _null_ for _reload_ changes : An object representing the workspace effected or _null_ for _reload_ changes
|- old |- old
: object : object
: For a _focus_ change, this will be an object representing the workspace : For a _focus_ change, this is will be an object representing the workspace
being switched from. Otherwise, it is _null_ being switched from. Otherwise, it is _null_
@ -1543,7 +1543,7 @@ The following change types are currently available:
|- rename |- rename
: The workspace was renamed : The workspace was renamed
|- urgent |- urgent
: A window on the workspace has had its urgency hint set or all urgency hints : A window on the workspace has had their urgency hint set or all urgency hints
for windows on the workspace have been cleared for windows on the workspace have been cleared
|- reload |- reload
: The configuration file has been reloaded : The configuration file has been reloaded
@ -1653,7 +1653,7 @@ object with the following properties:
:[ The type of change that occurred. See below for more information :[ The type of change that occurred. See below for more information
|- container |- container
: object : object
: An object representing the affected window : An object representing the window effected
The following change types are currently available: The following change types are currently available:
@ -1816,7 +1816,7 @@ event is a single object with the following properties:
: Whether this event was triggered by subscribing to the tick events : Whether this event was triggered by subscribing to the tick events
|- payload |- payload
: string : string
: The payload provided in a _SEND\_TICK_ message, if any. Otherwise, an empty : The payload given with a _SEND\_TICK_ message, if any. Otherwise, an empty
string string
@ -1838,7 +1838,7 @@ event is a single object with the following properties:
:- *DESCRIPTION* :- *DESCRIPTION*
|- id |- id
: string : string
:[ The bar ID affected :[ The bar ID effected
|- visible_by_modifier |- visible_by_modifier
: boolean : boolean
: Whether the bar should be made visible due to a modifier being pressed : Whether the bar should be made visible due to a modifier being pressed
@ -1854,7 +1854,7 @@ event is a single object with the following properties:
## 0x80000015. INPUT ## 0x80000015. INPUT
Sent when something related to input devices changes. The event is a single Sent when something related to the input devices changes. The event is a single
object with the following properties: object with the following properties:
[- *PROPERTY* [- *PROPERTY*
@ -1865,7 +1865,7 @@ object with the following properties:
:[ What has changed :[ What has changed
|- input |- input
: object : object
: An object representing the input that is identical to the ones GET_INPUTS gives : An object representing the input that is identical the ones GET_INPUTS gives
The following change types are currently available: The following change types are currently available:
[- *TYPE* [- *TYPE*