aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
Commit message (Collapse)AuthorAge
* desktop/layer_shell: fix centering for opposing anchorsLibravatar fwsmit2021-04-12
|
* desktop/layer_shell.c: Fix misspelled "exclusive"Libravatar Elyes HAOUAS2021-04-12
| | | | Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
* 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.
* output: damage whole output when exiting scanoutLibravatar Ronan Pigott2021-04-01
|
* idle_inhibit: Store wlr inhibitor instead of viewLibravatar Kenny Levinsen2021-03-21
| | | | | | | | | | | When an application inhibited idle, a view pointer was stored and a destroy listener was registered to the wlr inhibitor. As the wlr inhibitor lives longer than the view, this lead to a dangling view pointer between view unmap and inhibitor destroy. Store a pointer to the wlr inhibitor instead of to the view, and look up the view when needed, which may at any point be NULL. This also allows for an inhibitor to remain functional if a surface is re-mapped.
* xwayland: simplify override-redirect focus restorationLibravatar Simon Ser2021-03-12
| | | | | No need to grab the xwayland surface from the wlr_surface, the parent is already an xwayland surface.
* output: simplify layer surface iterationLibravatar Vyivel2021-03-11
|
* 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.
* shells: Update comment about size change on commitLibravatar Kenny Levinsen2021-02-23
|
* transaction: Remove unused ready_immediatelyLibravatar Kenny Levinsen2021-02-23
|
* transaction: Note if instructions are server requestsLibravatar Kenny Levinsen2021-02-23
| | | | | | | | | On server request, we need to send configure events to inform the client of the new intended size. If the client changes size itself, sending a configure event will only cause problems. Use transaction_commit_dirty_client to distinguish between the two transaction causes.
* 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.
* Fix incorrect damage being applied on popupsLibravatar Tadeo Kondrak2021-02-21
| | | | | | | | To reproduce: - Open a floating window and a popup that hangs over the bottom or right - Move the window in the direction of the popup overhang - The previous position of the popup is damaged, not the new one
* 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.
* transactions: Amend pending transactionsLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | | | | | | | | The transaction system contains a necessary optimization where a popped transaction is combined with later, similar transactions. This breaks the chronological order of states, and can lead to desynchronized geometries. To fix this, we replace the queue with only 2 transactions: current and pending. If a pending transaction exists, it is updated with new state instead of creating additional transactions. As we never have more than a single waiting transaction, we no longer need the queue optimization that is causing problems. Closes: https://github.com/swaywm/sway/issues/6012
* transaction: Only wait for ack from visible viewsLibravatar Kenny Levinsen2021-02-15
| | | | | | | | | | | | | Transactions currently wait for all configures to be acked, regardless fo what they were sent to. This includes views that are hidden in tabbed or stacked containers. If these views do not ack the configure in response to a single frame callback, they can cause transaction timeouts. Check if a container is hidden before registering the configure serial and saving any view buffers. Closes: https://github.com/swaywm/sway/issues/6023
* view: Read geometry directly in view_update_sizeLibravatar Kenny Levinsen2021-02-09
|
* shells: Align geometry change commit handlingLibravatar Kenny Levinsen2021-02-09
| | | | | | xdg_shell and xwayland handled geometry changes differently despite needing mostly identical behavior. The xwayland implementation has been changed to match that of xdg_shell.
* shells: Only center tiled views on size changeLibravatar Kenny Levinsen2021-02-09
| | | | | | | The size of a tiled container cannot change in response to new buffer sizes, so there is no need to commit a new transaction. Instead, simply recenter the view with the new geometry, leaving the full transaction flow for floating containers.
* transaction: Move centering to view_center_surfaceLibravatar Kenny Levinsen2021-02-09
| | | | This will allow us to reuse it for centering elsewhere.
* 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.
* desktop/layer_shell: Fix allocation type mismatchLibravatar Manuel Stoeckl2021-01-30
|
* desktop/output: Disable head if mode is NULLLibravatar Kenny Levinsen2021-01-26
| | | | | | | | | | wlr_output_configuration_head_v1_create normally fills out the head "enabled" field to match the wlr_output state. We overwrite this to also set the head as enabled if it is only turned off with DPMS. However, in some cases we may not have a mode for this display, in which case setting it as enabled will lead to a segfault later on. Therefore, enabled conditional on the presence of a mode.
* 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/xwayland: use index constants for atom arrayLibravatar Simon Ser2021-01-08
| | | | This ensures we don't swap two atoms by mistake.
* Change workspace_layout to match i3 behaviorLibravatar Ronan Pigott2020-12-20
| | | | | | | In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation.
* Test output before direct scan-outLibravatar Simon Ser2020-12-20
| | | | | | | | | | | This avoids some log spam. Eventually when we wire up the atomic test commit this will take care of the other log spam referenced below. References: https://github.com/swaywm/sway/pull/5010 References: https://github.com/swaywm/wlroots/issues/2181 Closes: https://github.com/swaywm/wlroots/issues/2532
* Add layer shell subsurfacesLibravatar Vlad Pănăzan2020-12-07
| | | | | | | Damage subsurfaces created by layer surfaces on map, unmap and commit. This fixes the flicker of Gtk Popovers. Fixes #5617
* xdg_shell: allow views to change geometry anytimeLibravatar Ronan Pigott2020-11-24
| | | | | | | | | | | Currently, when sway sends a configure with some geometry and the client responds with a different geometry in a commit that acks that configure, sway ignores the new size. Sway applies the surface geometry it had requested to the container, not what was actually committed, in the following transaction. This change allows any client commit to change its surface geometry, even if it is a response to a configure event.
* Log which output is using direct scan-outLibravatar Simon Ser2020-11-16
|
* transaction: make transaction collapsing smarter with > 2 viewsLibravatar Tudor Brindus2020-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | Sway maintains a list of pending transactions, and tries to merge consecutive transactions applying to the same views into one. Given a pending transactions list on views {A, B, C} of: A -> A' -> A'' -> B -> B' -> B'' Sway will collapse the transactions into just A'' -> B''. This works fine when doing things like resizing views by their border. However, when interactively resizing layouts like H[V[A B] C], we end up with pending transaction lists like: A -> B -> C -> A' -> B' -> C' -> A'' -> B'' -> C'' Previously, Sway would not be able to simplify this transaction list, and execute many more transactions than would be necessary (the final state is determined by {A'', B'', C''}). After this commit, the transaction list gets simplified to A'' -> B'' -> C'', resolving performance problems (that were particularly noticeable with high-refresh-rate mice). Fixes #5736.
* transaction: validate X transaction completions by geometry, not sizeLibravatar Tudor Brindus2020-10-18
| | | | | | | | | | | Xwayland views are aware of their coordinates, so validating transaction completions should take into account the reported coordinates of the view. Prior to this commit they didn't, and matching dimensions would suffice to validate the transaction. Also introduced `transaction_notify_view_ready_immediately` to support the fix from d0f7e0f without jumping through hoops to figure out the geometry of an `xdg_shell` view.
* transaction: don't reconfigure X views unless integral coords changedLibravatar Tudor Brindus2020-10-18
| | | | | | | | | Sway logical coordinates are doubles, but they get truncated to integers when sent to Xwayland through `xcb_configure_window`. X11 apps will not respond to duplicate configure requests (from their truncated point of view) and cause transactions to time out. Fixes #5035.
* xwayland: listen to `set_geometry` eventLibravatar Tudor Brindus2020-10-18
| | | | | | Closes #5735, refs #3007. This makes the "Search everywhere" dialog in JetBrains IDEs movable.
* xwayland: support views that change override-redirect statusLibravatar Tobias Langendorf2020-10-10
|
* 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.
* check parent surface before it is destroyedLibravatar John Mako2020-09-19
|
* Re-focus on parent surface if it is availableLibravatar BrassyPanache2020-09-04
| | | | | | | | | | | | | | | | | | | | | | My primary issue was IntelliJ IDEA's code suggestion pop-up not returning focus to the active editing window. I have spent some time looking at the changes of @Xyene (#5398) and @RyanDwyer (#2103). I think my proposed change maintains the status quo for the most part whilst fixing my focus issue. I have verified that @Xyene's fix for IntelliJ sub-menus still works. I have done basic testing which consists of: - Chrome - IntelliJ IDEA 2020.2.1 - VSCode - Alacritty It seems to hold up. I at least didn't see any obvious errors. Relates to #3007
* Use wlr_output_event_commitLibravatar Simon Ser2020-08-27
| | | | | | | | | | | | | 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
* Fix incorrect format specifiersLibravatar Antonin Décimo2020-07-30
|
* Fix X11 clients getting stuck minimizedLibravatar Tobias Langendorf2020-07-22
| | | | | | | | | | | Usually it should be enough to simply not grant a client's minimize request, however some applications (Steam, fullscreen games in Wine) don't wait for the compositor and minimize anyway, getting them stuck in an unrecoverable state. Restoring them immediately lead to heavy flickering when unfocused on my test application (Earth Defense Force 5 via Steam), so it's preferable to grant their request without actually minimizing and then restoring them once they are in focus again.
* desktop: output: Scale custom output refresh rateLibravatar Andri Yngvason2020-07-18
| | | | | This fixes an issue with wlr-output-management causing the frame rate to jump to 60000 Hz when setting a custom mode.
* xdg_shell: schedule configure on maximize requestsLibravatar Ronan Pigott2020-07-14
|
* input: implement xdg_toplevel interactive resize hintsLibravatar Ronan Pigott2020-07-13
|
* config/output: don't change output state before commitLibravatar Simon Ser2020-07-10
| | | | | | | | | | | | | | | | | | | | | | | 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