aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
Commit message (Collapse)AuthorAge
* Remove usage of surface->sx|syLibravatar Kenny Levinsen2021-04-26
| | | | | | | | | | | | | | | These coordinates contain the all-time accumulated buffer attach point, which is a way to perform incremental client-side initiated movement of windows, intended as a way to maintain logical window positioning while compensating for layout changes such as folding in a left side panel. This value is not useful for implementing this feature, and break things if they ever become non-zero. Their inclusion in calculations also tend to cause confusion. Remove usage of these coordinates, removing the ability for clients to move themselves. This may again be supported if a better API is made available from wlroots.
* desktop/render: remove unused wlr_gles2_texture_attribsLibravatar Simon Ser2021-04-11
| | | | | We were calling wlr_gles2_texture_get_attribs, but we were never using the result.
* render: Clip surfaces to container boundsLibravatar Kenny Levinsen2021-03-01
| | | | | | | If a surface is associated with a sway container, we limit the destination box to the container dimensions. Floating views and popups are exempt from this clipping.
* render: handle containers without output when rendering titlesLibravatar Quantum2021-02-25
| | | | | | | | | | | In e0a94bee8da3271f942c0881ee18a7e2d4138063, it was believed that if the container is being rendered, it must have an output. This turned out not to be the case. When rendering a container, all its children are rendered, even if the children is positioned off screen and thus not having any output. This is the cause of the crash in #6061. This commit introduces a null-check, which fixes #6061.
* Fix #5643, #5064: rounding issues in floating-point -> integer conversionsLibravatar Dimitris Triantafyllidis2021-02-22
| | | | | | | | | | | | | Currently, various floating-point expressions involving the coordinates of borders, titlebars and content surfaces are directly assigned to integers, and so they are rounded towards zero. This results in off-by-one distances between these elements when the signs of their coordinates differ. Fixed by wrapping these expressions with a call to floor before the assignment.
* container: Add container_is_current_floatingLibravatar Kenny Levinsen2021-02-22
| | | | | Needed to check if containers are currently floating from render code, as container_is_floating checks pending state.
* render: scale titlebars correctly when straddling outputsLibravatar Quantum2021-02-22
| | | | | | | | | | | | When a container straddles multiple outputs, the title bar is only rendered at the scale of the "effective" output. If the title bar straddles onto another output with a different scale factor, it was drawn at the wrong size. In this commit, we take into consideration the scale the title was rendered at and scale it accordingly so that it appears at the right size on the other outputs. This fixes #6054.
* render: Use current instead of pending fullscreenLibravatar Kenny Levinsen2021-02-16
|
* container: Move pending state to state structLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
* view: Save surface x and y on saved buffersLibravatar Kenny Levinsen2021-02-09
| | | | | | | | | We need to use surface_x and surface_y when rendering and damaging saved buffers as these compensate for views that have been centered due to being smaller than their container. Add them to the surface positions on the saved buffer so we have the values from the time the buffer was saved.
* Rename output_layer_for_each_surface_{toplevel,popup}Libravatar Simon Ser2021-01-12
| | | | Swap the "surface" part for consistency with wlroots' naming.
* Switch to wlr_xdg_surface_for_each_popup_surfaceLibravatar Simon Ser2021-01-12
| | | | | | | | 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
* desktop/render: show indicators for top-level splitLibravatar Tudor Brindus2020-10-04
| | | | | | | | | i3 shows indicators for the workspace-level pseudo-split, but Sway does not, as of b977c02. This commit replaces the floating container check with a call to `container_is_floating`, which has some more robust checks in place. Fixes #5699.
* Add support for viewporterLibravatar Simon Ser2020-06-17
| | | | | | Depends on [1]. [1]: https://github.com/swaywm/wlroots/pull/2092
* Save transform during transactionLibravatar Kalyan Sriram2020-06-05
| | | Closes: https://github.com/swaywm/sway/issues/5412
* view: Save all buffers associated with viewLibravatar Kenny Levinsen2020-06-03
| | | | | | | | | | | | During the execution of a resize transaction, the buffer associated with a view's surface is saved and reused until the client acknowledges the resulting configure event. However, only one the main buffer of the main surface was stored and rendered, meaning that subsurfaces disappear during resize. Iterate over all, store and render buffers from all surfaces in the view to ensure that correct rendering is preserved.
* Render layer shell popups over the top layerLibravatar David962020-04-10
|
* Fix unreliable scaling filterLibravatar Simon Ser2020-01-13
| | | | | | | | | | | | | Two changes were made: - Bind the texture before glTexParameteri - Set the scaling filter before each wlr_render_texture_with_matrix call Logging in wlroots allows to check that the scaling filter is properly set prior to rendering. Fixes: 6968fb3123e6 ("add scale_filter output config option") Closes: https://github.com/swaywm/sway/issues/4798
* render: do not render indicator on floating viewsLibravatar Brian Ashworth2020-01-05
| | | | | | | | | This adds a check to make it so the indicator is only rendered on views with a parent, which floating views do not. Since floating views do not have a parent, the workspace layout was being incorrectly used to determine whether to show the split indicator previously. This has no impact on floating containers and a view within a floating container will still have indicators rendered appropriately.
* add scale_filter output config optionLibravatar Ronan Pigott2019-11-29
|
* Use new presentation-time helperLibravatar Simon Ser2019-11-21
| | | | | This has the advantage to (1) reduce boilerplate and (2) make us correctly handle wlr_output_event_present.commit_seq.
* view: add max_render_timeLibravatar Ivan Molodetskikh2019-11-17
|
* Fix direct scan-out flickeringLibravatar Simon Ser2019-09-26
| | | | | | | | | | | | | | | | | | | Sometimes when using direct scan-out, some flickering between the fullscreen app and the regular desktop could be seen. This happened because we called wlr_output_attach_render and then wlr_output_attach_buffer for direct scan-out. wlr_output_attach_render makes the OpenGL context current but also attaches the OpenGL buffer to the primary plane apparently (all of this happens inside eglMakeCurrent). This patch moves the scan-out logic outside of output_render, before wlr_output_attach_render. This lines it up with rootston's implementation. This also makes more sense since no rendering is involved when using direct scan-out. Sorry about that, I should've tested this with more clients. The new code has been tested with mpv and a GLFW demo.
* Add support for fullscreen view direct scan-outLibravatar Simon Ser2019-09-25
|
* render: set surface as sampled for presentationLibravatar Ivan Molodetskikh2019-09-19
|
* Update titlebar borders to match i3's current behavior.Libravatar Dark2019-08-24
|
* Remove all wayland-server.h includesLibravatar Simon Ser2019-07-27
| | | | | | | | | | | | | | | 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").
* Don't submit too much damageLibravatar Simon Ser2019-04-27
|
* Update for wlroots#1660Libravatar Simon Ser2019-04-23
|
* Fix scratchpad fullscreen behavior and crashLibravatar Brian Ashworth2019-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | When setting fullscreen on a hidden scratchpad container, there was a check to see if there was an existing fullscreen container on the workspace so it could be fullscreen disabled first. Since the workspace is NULL, it would cause a SIGSEGV. This adds a NULL check to avoid the crash. This also changes the behavior of how fullscreen is handled when adding a container to the scratchpad or changing visibility of a scratchpad container to match i3's. The behavior is as follows: - When adding a container to the scratchpad or hiding a container back into the scratchpad, there is an implicit fullscreen disable - When setting fullscreen on a container that is hidden in the scratchpad, it will be fullscreen when shown (and fullscreen disabled when hidden as stated above) - When setting fullscreen global on a container that is hidden in the scratchpad, it will be shown immediately as fullscreen global. The container is not moved to a workspace and remains in the scratchpad. The container will be visible until fullscreen disabled or killed. Since the container is in the scratchpad, running `scratchpad show` or `move container to scratchpad` will have no effect This also changes `container_replace` to transfer fullscreen and scratchpad status.
* Remove debug treeLibravatar Ryan Dwyer2019-03-18
| | | | This feature has served its purpose. It's better to use IPC now.
* Stop using wlr_output->{lx,ly}Libravatar emersion2019-03-11
| | | | | Also fixes sway_output->{lx,ly,width,height} not being updated. Also fixes output_get_in_direction adding buffer coords to layout coords.
* render_floating: skip fullscreen floatersLibravatar Brian Ashworth2019-03-03
| | | | | | | | If a floater is fullscreen either on a workspace or globally, it should not be rendered on any output is is not fullscreened on. When rendering it on an output it should not be rendered on, there will be an extraneous border along the adjacent side of the output. This adds a check in render_floating to skip all fullscreened floaters
* add --i3 flag to hide_edge_bordersLibravatar db2019-02-24
| | | | | | | Enables i3-compatible behavior regarding hiding the title bar on tabbed and stacked containers with one child. Related issues and merge requests: #3031, #3002, #2912, #2987.
* Introduce container_is_scratchpad_hiddenLibravatar Ryan Dwyer2019-01-28
| | | | | | | | | | | | Just a convenience function that improves readability of the code. Other things worth noting: * container_get_siblings and container_sibling_index no longer use the const keyword * container_handle_fullscreen_reparent is only ever called after attaching the container to a workspace, so its con->workspace check has been changed to an assertion
* Center surface inside container when it's too smallLibravatar Ryan Dwyer2019-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | The goal here is to center fullscreen views when they are both too small for the output and refuse to resize to the output's dimensions. It has the side effect of also centering the view when it's too small for its container. Example clients that have this behaviour are emersion's hello-wayland and weston. It works by introducing surface_{x,y,width,height} properties to the container struct. The x and y represent layout-local coordinates where the surface will be rendered. The width and height are only used to track the surface's previous dimensions so we can detect when the client has resized it and recenter and apply damage accordingly. The new surface properties are calculated when a transaction is applied, as well as when a view resizes itself unexpectedly. The latter is done in view_update_size. This function was previously restricted to views which are floating, but can now be called for any views. For views which refuse to resize *smaller* than a particular size, such as gnome-calculator, the surface is still anchored to the top left as per the current behaviour.
* Implement fullscreen globalLibravatar Ryan Dwyer2019-01-25
|
* Refactor seat operations to use an interfaceLibravatar Ryan Dwyer2019-01-10
| | | | | | | | | | | | | | | | | | This splits each seat operation (drag/move tiling/floating etc) into a separate file and introduces a struct sway_seatop_impl to abstract the operation. The move_tiling_threshold operation has been merged into move_tiling. The main logic for each operation is untouched aside from variable renames. The following previously-static functions have been made public: * node_at_coords * container_raise_floating * render_rect * premultiply_alpha * scale_box
* Fix fullscreen view rendering crashLibravatar Mack Straight2019-01-01
| | | | | | | See issue #3359 for reproduction details. When a fullscreen view is unmapped and there's a preceding transaction waiting, there may be neither a saved buffer or a surface to render. This change matches the equivalent code in render_view.
* Fix wlr_box_intersection args for wlroots 1441Libravatar Brian Ashworth2018-12-22
| | | | | The fix pushed to master missed wlr_box_intersection. This just fixes those lines so sway renders properly again
* Fixes per wlroots#1441Libravatar Drew DeVault2018-12-22
|
* Update for swaywm/wlroots#1403Libravatar emersion2018-12-01
|
* Fix titlebar when no title or marksLibravatar Brian Ashworth2018-11-28
| | | | This fixes the rendering of the titlebar when there is no title or marks.
* Implement title alignmentLibravatar Brian Ashworth2018-11-25
| | | | | | | | This adds support for `i3 4.16`'s ability to set the title alignment. The command is `title_align left|center|right`. When the title is on the right, marks are moved to the left. Otherwise, they are on the right.
* Adding commands for configuring titlebar borders and paddingLibravatar Florent de Lamotte2018-11-22
|
* Use #if instead of #ifdefLibravatar emersion2018-11-18
|
* Move view {x,y,width,height} into container structLibravatar Ryan Dwyer2018-11-17
| | | | | | | | | | | | | | | | | | | This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
* Render software cursors with wlr_output_render_software_cursorsLibravatar emersion2018-11-10
|
* Move view marks properties to container structLibravatar Ryan Dwyer2018-11-01
| | | | | Like border properties, this will be needed to implement layout saving and restoring.
* Revert "Respect border settings when rendering lone tabbed/stacked child"Libravatar Rostislav Pehlivanov2018-10-30
| | | | This reverts commit 65328ef60c9468ae44b4b1d6316d604c47293ec3.