summaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
Commit message (Collapse)AuthorAge
* 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.
* Respect border settings when rendering lone tabbed/stacked childLibravatar Ryan Dwyer2018-10-27
| | | | | | | | | | | | In i3, when a child of a tabbed or stacked container has no siblings, its border settings are respected. This patch achieves the same effect by rendering a lone tabbed/stacked child as if it's a linear container. This makes the border settings be respected. Over in view_autoconfigure, we compensate for this by only adjusting `y_offset` if there's multiple children.
* Minor refactor of input managerLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | | | | | | | The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
* Fix pixel leaks when using fractional scalingLibravatar Ryan Dwyer2018-10-12
| | | | | | | | | | | | | The basic idea here is to apply rounding after scaling. It's not as simple as this, though, and I've detailed it in the comments for a function. In order to fix some pixel leaks in the title bar, I found it easier to change how we place rectangles to fill the area. Instead of placing two rectangles across the full width above and below the title and having shorter rectangles in the inner area, it's now pieced together in vertical chunks. This method involves drawing two less rectangles per container.
* Use current state when rendering transient containersLibravatar Ryan Dwyer2018-10-08
|
* Introduce container_is_transient_forLibravatar Ryan Dwyer2018-10-08
|
* Implement popup_during_fullscreenLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | | This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view.
* Add CSD to border modesLibravatar Ryan Dwyer2018-09-27
| | | | | | | | | | | | | | | | | This replaces view.using_csd with a new border mode: B_CSD. This also removes sway_xdg_shell{_v6}_view.deco_mode and view->has_client_side_decorations as we can now get these from the border. You can use `border toggle` to cycle through the modes including CSD, or use `border csd` to set it directly. The client must support the xdg-decoration protocol, and the only client I know of that does is the example in wlroots. If the client switches from SSD to CSD without us expecting it (via the server-decoration protocol), we stash the previous border type into view.saved_border so we can restore it if the client returns to SSD. I haven't found a way to test this though.
* Fix segfault in output_renderLibravatar emersion2018-09-19
|
* Fix dropzone box on scaled outputsLibravatar Ryan Dwyer2018-09-11
|
* Implement tiling dragLibravatar Ryan Dwyer2018-09-11
| | | | Hold floating_modifier and drag a tiling view to a new location.
* Align titles to baselineLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | This does the following: * Adds a baseline argument to get_text_size (the baseline is the distance from the top of the texture to the baseline). * Stores the baseline in the container when calculating the title height. * Takes the baseline into account when calculating the config's max font height. * When rendering, pads the textures according to the baseline so they line up.
* Fix gaps in title textures and vertically center themLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | | | | | | | There was code that attempted to fill in the gap below the title texture when the texture isn't tall enough, but this only worked when the output was positioned at 0,0. The reason is that render_rect expects a box passed in a hybrid layout-local/output-buffer-local system, and we were passing purely output-buffer-local. I've added a comment documenting this. By the way, we can't use layout-local coordinates for the rectangle box because in some cases we set the box based on a texture size. Texture sizes are buffer-local, and we'd have to divide them to bring it back to layout-local which means losing precision. We could use output-buffer-local coordinates for the box, but this would require translating the coordinates from layout-local to output-buffer-local in many places during rendering. This patch also vertically centers the text inside the title bar.
* Fix crash when switching to new workspace during transactionLibravatar Ryan Dwyer2018-09-06
| | | | | | | When rendering, the workspace for the output needs to be retrieved from the output's `current` state. output_get_active_workspace returns the pending workspace, which crashes if the pending workspace is new and hasn't completed a transaction yet.