aboutsummaryrefslogtreecommitdiff
path: root/include/sway/output.h
AgeCommit message (Collapse)Author
2024-01-18Delete old damage tracking codeAlexander Orzechowski
The new scene graph abstraction handles this for us.
2024-01-18scene_graph: Port xwaylandAlexander Orzechowski
2024-01-18scene_graph: Port layer_shellAlexander Orzechowski
2024-01-18renderer: Remove in favor of scene_graphAlexander Orzechowski
2024-01-18scene_graph: Port ext_session_v1Alexander Orzechowski
2024-01-18scene_graph: Port seat drag iconsAlexander Orzechowski
2024-01-18renderer: Render scene_graphAlexander Orzechowski
2024-01-18scene_graph: Maintain `wlr_scene_node`s for the sway tree.Alexander Orzechowski
2024-01-18desktop: Rename layers to shell_layersAlexander Orzechowski
This code will be deleted later, but for the time being rename it so it doesn't conflict with future properties.
2023-12-13output: Destroy when output layout is destroyedAlexander Orzechowski
Since output layout is destroyed when the wayland display is destroyed we run into a destroy listener order problem: Either the display starts destroying the outputs first, in which case we're good: The existing handling will clean up. However, things go wrong if the display decides to destroy the output layout first. In this case, sway will hold invalid references to the output layout as part of each output so that when it finally goes to destroy them, sway will dereference destroyed output layout bits. Ref: https://github.com/swaywm/sway/pull/6844#issuecomment-1843599513
2023-07-31output: drop current_modeSimon Ser
This is now unused.
2023-06-08Handle gamma-control-v1 set_gamma eventsSimon Ser
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
2023-05-02render: Use wlr_render_passAlexander Orzechowski
2023-05-02render: pass rendering state together in a structAlexander Orzechowski
This lets us easily add rendering state that we need in the future
2023-04-14Use output_match_name_or_id() in apply_output_config_to_outputs()Simon Ser
2023-02-22Move output commit out of output_render()Simon Ser
That way output_render() only does what it says on the tin.
2023-02-22Constify pixman_region32_t for rendering functionsSimon Ser
2022-12-01sway/desktop/output: listen to output mode in commit handleSimon Zeni
2022-11-15Listen to the output request_state eventSimon Ser
References: https://github.com/swaywm/wlroots/pull/2693
2022-11-11Use wlr_damage_ringKirill Primak
wlr_output_damage is to be replaced with wlr_damage_ring, so use that.
2022-09-19sway: Add non-desktop-output typeAlex Maese
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`
2022-07-04Remove internal references to DPMSSimon Ser
While at it, use an int for the config field, just like we do for all other fields.
2021-12-17output: change output::destroy to output::disableRonan Pigott
This changes output::destroy to output::disable and emits it only once when an output is disabled, instead of twice in succession.
2021-07-07Update wlr_box includesSimon Ser
Update for the breaking change in [1]. [1]: https://github.com/swaywm/wlroots/pull/3011
2021-04-26Remove support for arbitrary rotationsSimon Ser
There was some unused code-paths for rendering surfaces with an arbitrary rotation applied. This was imported from rootston. Since we don't have plans to make use of this, remove it.
2021-01-12Rename output_layer_for_each_surface_{toplevel,popup}Simon Ser
Swap the "surface" part for consistency with wlroots' naming.
2021-01-12Switch to wlr_xdg_surface_for_each_popup_surfaceSimon Ser
Instead of calling wlr_xdg_surface_for_each_popup and then wlr_surface_for_each_surface, use the new for_each_popup_surface helper introduced in [1] that does it in one go. [1]: https://github.com/swaywm/wlroots/pull/2609
2020-08-27Use wlr_output_event_commitSimon Ser
Instead of listening to both transform and scale events, we can listen to the commit event and use the new wlr_output_event_commit struct to decide what to do. This de-duplicates some of the work we were doing twice when an output was re-configured. Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2315
2020-07-10config/output: don't change output state before commitSimon Ser
Previously, we called output_disable prior to wlr_output_commit. This mutates Sway's output state before the output commit actually succeeds. This results in Sway's state getting out-of-sync with wlroots'. An alternative fix [1] was to revert the changes made by output_disable in case of failure. This is a little complicated. Instead, this patch makes it so Sway's internal state is never changed before a successful wlr_output commit. We had two output flags: enabled and configured. However enabled was set prior to the output becoming enabled, and was used to prevent the output event handlers (specifically, the mode handler) from calling apply_output_config again (infinite loop). Rename enabled to enabling and use it exclusively for this purpose. Rename configure to enabled, because that's what it really means. [1]: https://github.com/swaywm/sway/pull/5521 Closes: https://github.com/swaywm/sway/issues/5483
2020-04-10Render layer shell popups over the top layerDavid96
2020-03-06Drop sway_output.surface_needs_frameSimon Ser
wlr_output_schedule_frame now sets output->needs_frame [1], so this isn't needed anymore. [1]: https://github.com/swaywm/wlroots/pull/2053
2020-03-04Make handle_destroy and output_repaint_timer_handler staticSimon Ser
2020-02-26Add support for wlr-output-power-management-unstable-v1Simon Ser
2020-02-16output: fix updating output manager configBrian Ashworth
The output manager config is created when the output is created. It is updated when the mode, transform, scale, or layout for the output changes, as well as, when the output is destroyed. Since the output->enabled property was not being set before calling apply_output_config, the output event handlers were early returning and never updating the output manager config when the output state was committed. This fixes the issue by setting output->enabled in apply_output_config below the output disabling section. There are also a few other minor changes that are required to function. Additionally, this renames output_enable to output_configure to better describe the recent changes.
2020-02-11Stop calling apply_output_config from output_enableSimon Ser
The only output_enable caller is now apply_output_config. Stop calling apply_output_config from output_enable to simplify the code and avoid the back-and-forth between these two functions. output_enable is now the symmetric of output_disable: it just marks the output as enabled and performs bookkeeping (e.g. creating teh default workspace). It is called from apply_output_config after the output commit, so that it can read the current output state and act accordingly. This change also allows us to avoid an extraneous wlr_output_commit. References: https://github.com/swaywm/sway/issues/4921
2019-12-01output: Schedule idle frames if we do not renderKenny Levinsen
Repaint scheduling delays output render and frame done events from output frame events, and block idle frame events from being scheduled in between output frame done and output render in this period of time. If a surface is committed after its frame done event, but before output render, idle frame requests will be blocked, and the surface relies on the upcoming render to schedule a frame. If when the repaint timer expires, output render is deemed unnecessary, no frame will be scheduled. This can lead to surfaces never having their frame callbacks fire. To fix this, we store that a surface has requested a frame in surface_needs_frame. When the repaint expires, if no render is deemed necessary, we check this flag and schedule an idle frame. Fixes #4768
2019-11-29add scale_filter output config optionRonan Pigott
2019-11-17view: add max_render_timeIvan Molodetskikh
2019-11-17output: add max_render_timeIvan Molodetskikh
2019-10-27Fix segfault in wlr_output_manager_v1_set_configurationSimon Ser
Calling wlr_output_manager_v1_set_configuration with an enabled output and a NULL mode is incorrect if the output doesn't support modes. When DPMS'ing an output, wlr_output_enable(output, false) is called. This de-allocates the CRTC and sets wlr_output.current_mode to NULL. Because we mark DPMS'ed outputs as enabled, we also need to provide a correct output mode. Add a field to sway_output to hold the current mode. Closes: https://github.com/swaywm/wlroots/issues/1867
2019-10-27Fix apply_output_config return value when enabling outputSimon Ser
apply_output_config would call output_enable and always return true, even if the output couldn't be enabled.
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration. This commit si similar to wlroots' ca45f4490ccc ("Remove all wayland-server.h includes").
2019-07-17Update output manager on layout changeJosef Gajdusek
The output manager config was not properly updated if the position of the output got changed.
2019-05-24Implement wlr-output-management-v1Josef Gajdusek
2019-05-14Implement output toggleMoelf
discussed in #4136, this can't handle wildcard but won't crash.
2019-04-04swaybg: one instance for all outputsBrian Ashworth
This makes it so there will only be one swaybg instance running instead of one per output. swaybg's cli has been changed to a xrandr like interface, where you select an output and then change properties for that output and then select another output and repeat. This also makes it so swaybg is only killed and respawned when a background changes or when reloading.
2019-03-24Add support for manually setting subpixel hinting on outputs.Geoff Greer
Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses https://github.com/swaywm/sway/issues/3163
2019-03-16Fix output config retrieval for new outputsBrian Ashworth
This removes `output_find_config`, which would take the first matching output config it found. This is fine if only a name output config, identifier output config, or even just wildcard exist, but if there is a name output config and identifier output config, they are not merged. Instead, this introduces find_output_config, which is just a wrapper for `get_output_config`. This ensures that both the name and identifier output configs are respected. This fixes the following case: - For simplicity in this example, remove all output configs from config - Run `swaymsg output <name> bg #ff0000 solid_color` - Run `swaymsg output <identifier> scale 2` - Disconnect and reconnect output Without this, the output will have the background, but not the scale. With this, the output will have both the background and scale
2019-03-11Stop using wlr_output->{lx,ly}emersion
Also fixes sway_output->{lx,ly,width,height} not being updated. Also fixes output_get_in_direction adding buffer coords to layout coords.
2019-02-16Disconnect swaybg instead of killing itemersion
This is much more reliable. This also fixes race conditions when killing swaybg while it's doing a wl_display_roundtrip.