Kenny Levinsen
393c29fc59
render: Apply clip to rendered texture correctly
...
The new wlr_render_pass API provides src_box, dst_box and clip
parameters for texture rendition. Rather than clipping the dst_box,
which control the projection matrix and leads to compression, intersect
the damage and clip box and pass these as a clip parameter.
Fixes: https://github.com/swaywm/sway/issues/7579
Regressed by: https://github.com/swaywm/sway/pull/7552
2 years ago
Alexander Orzechowski
db7638a0e5
Don't crash if there is no damage during render
2 years ago
Alexander Orzechowski
029b99b482
render: Use wlr_render_pass
2 years ago
Alexander Orzechowski
07cdf6ccd0
render: Don't pass matrix into render_texture
2 years ago
Alexander Orzechowski
d5cc474aef
render: pass rendering state together in a struct
...
This lets us easily add rendering state that we need in the future
2 years ago
Alexander Orzechowski
33cfdbe886
xdg_shell: Fix crash if popup generates while toplevel is in the scratchpad
2 years ago
Simon Ser
fcec581748
Use output_match_name_or_id() in apply_output_config_to_outputs()
2 years ago
Simon Ser
8d95638df6
Introduce output_match_name_or_id()
...
Reduces code duplication.
2 years ago
Elyes Haouas
63f9bdf001
Fix old style function definitions
...
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2 years ago
Simon Ser
ab4f460597
Set output damage during direct scan-out
...
During direct scan-out, pass the damaged region to the wlroots
backend.
2 years ago
Simon Ser
777df22377
Skip direct scan-out commit when damage is empty
...
When there is no damage, no need to perform an output commit, even
when direct scan-out is used.
2 years ago
Alexander Orzechowski
dadf3e9b78
Chase wlroots!4067
2 years ago
Simon Ser
e8fb7f53b8
Remove duplicate wlr_damage_ring_set_bounds() call
...
We already do this in handle_commit().
2 years ago
Erik Reider
fa7b686e61
Fix damage-ring bounds not being set when unplugging -> plugging in monitor
...
#7524 was a partial fix. Seems like this is still an issue when
unplugging and plugging the monitor back in.
Closes: https://github.com/swaywm/sway/issues/7528
2 years ago
Erik Reider
ac1ed638e9
Init the damage_ring bounds on output creation
...
Otherwise the initial bounds would be `INT_MAX` until `handle_mode` or `handle_commit` is called :)
2 years ago
novenary
b28e1b0d3c
Disable direct scanout for surfaces with popups
2 years ago
Simon Ser
16b0afd433
Check for empty damage before attaching render buffer
...
Check whether output->damage_ring.current is empty before calling
wlr_output_attach_render(). Saves us from having to un-do that
via wlr_output_rollback().
2 years ago
Simon Ser
c2ccc0c9d4
Move output commit out of output_render()
...
That way output_render() only does what it says on the tin.
2 years ago
Simon Ser
d6cb4fa8de
Constify pixman_region32_t for rendering functions
2 years ago
Simon Ser
7d2e4a5106
layer-shell: enter output before surface is mapped
...
This sends fractional-scale-v1 events before the first configure
event. That way clients have all of the metadata they need to render
the first frame.
2 years ago
Simon Ser
7a6c7d60d5
Update surface fractional scale on output change
...
Closes: https://github.com/swaywm/sway/issues/7464
2 years ago
Simon Ser
9162b536f6
Add support for fractional-scale-v1
...
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511
2 years ago
Simon Ser
1cab17ada2
Introduce surface_{enter,leave}_output()
...
We can centralize all output-related surface events from there.
2 years ago
Ronan Pigott
dbc1eec850
launcher: make launcher context seat aware
2 years ago
Ronan Pigott
842609da64
view: make request_activate take a seat
...
This way we can move focus on the same seat an activation token
originates from.
2 years ago
Simon Ser
40eb29e7c5
ipc: add support for output event
...
For compatibility with i3 [1].
[1]: https://i3wm.org/docs/ipc.html#_output_event
2 years ago
Alexander Courtis
2c0f68b7c6
Apply new adaptive sync value from wlr-output-management
...
fixes #7394
Test cases:
* zwlr_output_configuration_head_v1_set_adaptive_sync 0->0, no change
* 0->1, enabled
* 1->0, disabled
* 1->1, no change
Similar tests with an incapable display resulted in `"Adaptive sync
failed, ignoring"` messages as expected.
2 years ago
Simon Ser
36f627d0fa
Check return value of wlr_renderer_begin()
...
Since [1], wlr_renderer_begin() can fail. Check its return value
and bail.
This fixes an assertion error (when begin() fails and then we try
to render something) after a GPU reset.
[1]: a541c9510a
2 years ago
Carl Smedstad
9425ce2fba
Replace math functions that promote float to double
2 years ago
Simon Zeni
aa03a8fcb5
sway/desktop/output: listen to output mode in commit handle
2 years ago
Simon Ser
e795ea6a0c
Make DRM backend optional
2 years ago
Simon Ser
5b64e2fc31
Make GLES2 optional
2 years ago
Ronan Pigott
28fda4c0d3
launcher: export X startup ids and use them for workspace matching
2 years ago
Ronan Pigott
30ad4dc4a5
launcher: export xdga tokens and use them for workspace matching
2 years ago
Ronan Pigott
bdeb9f9565
launcher: fudge the interface a bit
...
We want to create a context before knowing the pid it will match with.
2 years ago
Ronan Pigott
66568508c0
launcher: initialize launcher_ctxs once on startup
2 years ago
Ronan Pigott
864b3a9a18
view: associate launch contexts with views
...
Views now maintain a reference to a launch context which, as a last
resort, is populated at map time with a context associated with its pid.
This opens the possibility of populating it before map via another
source, e.g. xdga-tokens or configuration.
2 years ago
Ronan Pigott
d75c9f9722
launcher: rename pid_workspace to launcher_ctx
...
Soon we will match views with more than just a pid.
2 years ago
Ronan Pigott
bd66f4943d
launcher: use xdga tokens
...
This reuses wlroots token tracking for workspace matching. It doesn't
export any xdga tokens for clients yet.
2 years ago
Ronan Pigott
3b49f2782e
launcher: track workspaces by node
...
This removes the need to rename the pid_workspaces when a workspace
is renamed.
It also opens the possibility of tracking other node types. Tracking
containers would allow application to be placed correctly in the
container tree even if the user has moved their focus elsewhere since
it was launched.
2 years ago
Ronan Pigott
eb5021ef99
root: move the workspace matching code to its own file
...
This removes the pid_workspace bits from tree/root before it gets
too interesting.
No functional change.
2 years ago
Simon Ser
907ca48a61
Listen to the output request_state event
...
References: https://github.com/swaywm/wlroots/pull/2693
2 years ago
Kirill Primak
85005b52fe
output: set damage ring bounds to pixel values
...
Fixes: https://github.com/swaywm/sway/issues/7254
2 years ago
Kirill Primak
7862fa670e
Use wlr_damage_ring
...
wlr_output_damage is to be replaced with wlr_damage_ring, so use that.
2 years ago
Simon Ser
9400bd963c
Add support for ext-idle-notify-v1
...
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3753
2 years ago
Alex Maese
c015db4a9f
sway: Add non-desktop-output type
...
Currently, when encountering a non-desktop display, sway offers the
output for leasing and returns without storing it in a sway specific
output type like `struct sway_output`. Additionally, running
`swaymsg -t get_outputs` doesn't show non-desktop outputs.
This commit stores the non-desktop outputs into a struct called
`sway_output_non_desktop`, and adds them to a list on `sway_root`
2 years ago
Simon Ser
b69d637f7a
Remove internal references to DPMS
...
While at it, use an int for the config field, just like we do for
all other fields.
2 years ago
Kirill Primak
6a59e38aeb
xdg-shell: schedule a configure on maximize request
...
This commit reverts 03879290dbee26127f6867ef60bc2a7f9a6c8c5f and
fc84bcb7fb0ffa29b1f9bed287762241a3473803.
3 years ago
Kirill Primak
26a0e97634
chore: chase wlroots xdg-shell update
3 years ago
Daniel De Graaf
75b2d0b105
ext-session-lock: disable direct scan-out when locked
3 years ago