aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
AgeCommit message (Collapse)Author
2018-08-18Implement iterators per container typeRyan Dwyer
This introduces the following `for_each` functions: * root_for_each_workspace * root_for_each_container * output_for_each_workspace * output_for_each_container * workspace_for_each_container And introduces the following `find` functions: * root_find_output * root_find_workspace * root_find_container * output_find_workspace * output_find_container * workspace_find_container * container_find_child And removes the following functions: * container_descendants * container_for_each_descendant * container_find This change is preparing the way for demoting sway_container. Eventually these functions will accept and return sway_outputs, sway_workspaces and sway_containers (meaning a C_CONTAINER or C_VIEW). This change also makes it easy to handle abnormalities like the workspace floating list, root's scratchpad list and (once implemented) root's saved workspaces list for when there's no connected outputs.
2018-08-17Add using_csd variable to transaction stateRyan Dwyer
This fixes a race condition flicker when unfloating a view which uses client side decorations. When the view is floated it has using_csd = true, so the decorations are not drawn. When unfloating it it changes to false, but this change wasn't part of transactions so it could potentially render the decorations around the view while it's waiting for the transaction to apply.
2018-08-15Simplify transactionsRyan Dwyer
Commit 4b8e3a885be74c588291c51f798de80bd81a92db makes it so only one transaction is committed (ie. configures sent) at a time. This commit removes the now-unnecessary code which was used to support concurrent committed transactions. * Instead of containers storing a list of instructions which they've been sent, it now stores a single instruction. * Containers now have an ntxnrefs property. Previously we knew how many references there were by the length of the instruction list. * Instructions no longer need a ready property. It was used to avoid marking an instruction ready twice when they were in a list, but this is now avoided because there is only one instruction and we nullify the container->instruction pointer when it's ready. * When a transaction applies, we no longer need to consider releasing and resaving the surface, as we know there are no other committed transactions. * transaction_notify_view_ready has been renamed to view_notify_view_ready_by_serial to make it consistent with transaction_notify_view_ready_by_size. * Out-of-memory checks have been added when creating transactions and instructions.
2018-08-12Don't commit multiple transactions at the same timeRyan Dwyer
2018-08-12Don't progress transaction queue if any are partially completeRyan Dwyer
This fixes an issue where views might commit to a transaction ahead of the first one, and applying the first transaction causes us to save a buffer of the wrong size.
2018-08-12Implement resizing tiled containers via cursorRyan Dwyer
* The OP_RESIZE seat operation has been renamed to OP_RESIZE_FLOATING, and OP_RESIZE_TILING has been introduced. * Similar to the above, seat_begin_resize and handle_resize_motion have been renamed and tiling variants introduced. * resize.c's resize_tiled has to be used, so container_resize_tiled has been introduced in resize.c to allow external code to call it.
2018-08-10xwayland: fix unmanaged surfaces orderemersion
2018-08-06Handle views created after decoration mode is sent for xdg-shell-v6emersion
2018-08-06Handle views created after decoration mode is sent for xdg-shellemersion
2018-08-02Convert toplevel coordinates to output-localRyan Dwyer
2018-08-02Revert "Revert "Fix popups""Ryan Dwyer
This reverts commit 9aa258d33a9baa42895214da7e82f4568fcb8f76. Reverting the revert, so that popups can be fixed.
2018-08-02Merge pull request #2366 from RedSoxFan/nagbarDrew DeVault
Implement swaynag
2018-08-02Merge branch 'master' into nagbarRyan Dwyer
2018-08-02Revert "Fix popups"Drew DeVault
This reverts commit de86d65627e96cffe77f4abf11c4a0b982326ff9.
2018-08-02Fix race condition crashes when unmapping viewsRyan Dwyer
This fixes two issues which were both introduced in #2396. First issue: The PR changes the location of the buffer save to transaction_apply, but puts it inside the should_configure block. For unmapping (destroying) views, should_configure returns false so it wasn't saving the buffer. If a frame was rendered between the unmap and the transaction applying then it would result in a crash. Second issue: If a destroying view is involved in two transactions, we must not release the buffer between the transactions because there is no live buffer to grab any more.
2018-08-02Merge branch 'master' into fix-resize-wiggleemersion
2018-08-01Address first round review for swaynagBrian Ashworth
2018-08-01Arrange output in arrange_layers and commit dirtyBrian Ashworth
2018-08-01Correctly track saved surfaces during multiple transactionsRyan Dwyer
Fixes #2364. Suppose a view is 600px wide, and we tell it to resize to 601px during a resize operation. We create a transaction, save the 600px buffer and send the configure. This buffer is saved into the associated instruction, and is rendered while we wait for the view to commit a 601px buffer. Before the view commits the 601px buffer, suppose we tell it to resize to 602px. The new transaction will also save the buffer, but it's still the 600px buffer because we haven't received a new one yet. Then suppose the view commits its original 601px buffer. This completes the first transaction, so we apply the 601px width to the container. There's still the second (now only) transaction remaining, so we render the saved buffer from that. But this is still the 600px buffer, and we believe it's 601px. Whoops. The problem here is we can't stack buffers like this. So this commit removes the saved buffer from the instructions, places it in the view instead, and re-saves the latest buffer every time the view completes a transaction and still has further pending transactions. As saved buffers are now specific to views rather than instructions, the functions for saving and removing the saved buffer have been moved to view.c. The calls to save and restore the buffer have been relocated to more appropriate functions too, favouring transaction_commit and transaction_apply rather than transaction_add_container and transaction_destroy.
2018-07-31Close popups when changing focusRyan Dwyer
Also reverts the send frame done changes from the previous commit.
2018-07-31Fix popupsRyan Dwyer
Fixes the render and container_at order for popups. Fixes #2210 For rendering: * render_view_surfaces has been renamed to render_view_toplevels * render_view_toplevels now uses output_surface_for_each_surface (which is now public), as that function uses wlr_surface_for_each_surface which doesn't descend into popups * Views now have a for_each_popup iterator, which is used by the renderer to render the focused view's popups * When rendering a popup, toplevels (xdg subsurfaces) of that popup are also rendered For sending frame done, the logic has been updated to match the rendering logic: * send_frame_done_container no longer descends into popups * for_each_popup is used to send frame done to the focused view's popups and their child toplevels For container_at: * floating_container_at is now static, which means it had to be moved higher in the file. * container_at now considers popups for the focused view before checking containers. * tiling_container_at has been introduced, so that it doesn't call container_at recursively (it would check popups recursively if it did)
2018-07-30Fix segfault with fullscreenemersion
2018-07-30Merge pull request #2367 from emersion/iterator-redesignDrew DeVault
Refactor surface iterators
2018-07-30Fix title textures on scale changeBrian Ashworth
2018-07-29Don't give focus if xwayland window has a type hintemersion
2018-07-29Make output_surface_for_each_surface_iterator staticemersion
2018-07-29Remove unused output_from_wlr_outputemersion
2018-07-29Remove output_surface_for_each_surface from headeremersion
2018-07-29Completely switch over to new iteratorsemersion
2018-07-29wip: redesign output_view_for_each_surface iteratoremersion
2018-07-29wip: redesign output_layer_for_each_surface iteratoremersion
2018-07-29wip: redesign output_drag_icons_for_each_surface iteratoremersion
2018-07-29wip: redesign output_unmanaged_for_each_surface iteratoremersion
2018-07-28Merge pull request #2360 from RyanDwyer/floating-containersDrew DeVault
Allow containers to float
2018-07-28Allow containers to floatRyan Dwyer
Things worth noting: * When a fullscreen view unmaps, the check to unset fullscreen on the workspace has been moved out of view_unmap and into container_destroy, because containers can be fullscreen too * The calls to `container_reap_empty_recursive(workspace)` have been removed from `container_set_floating`. That function reaps upwards so it wouldn't do anything. I'm probably the one who originally added it... * My fix (b14bd1b0b1536039e4f46fe94515c7c44e7afc61) for the tabbed child crash has a side effect where when you close a floating container, focus is not given to the tiled container again. I've removed my fix and removed the call to `send_cursor_motion` from `seat_set_focus_warp`. We should consider calling it from somewhere earlier in the call stack.
2018-07-28Include errno.hRyan Dwyer
2018-07-28Show errno description in logRyan Dwyer
2018-07-28Handle out-of-fd situations gracefully for transaction and urgent timersRyan Dwyer
2018-07-28Second attempt at fixing transaction use-after-freeRyan Dwyer
The solution used in 073ac425d5bf6f6393eb91d9b5f84e3caa68f511 doesn't work in all cases because the freed instruction might be ahead in the list, not necessarily behind. The new solution delays running the queue until after the loop has finished iterating, thus avoiding the problem completely.
2018-07-28Fix use after free in transactionsRyan Dwyer
In set_instructions_ready, calling set_instruction_ready may cause any number of transactions to get applied, which removes them from the list being iterated. The iteration variables need to be adjusted accordingly.
2018-07-26Fix indentRyan Dwyer
2018-07-26Allow containers to be fullscreenRyan Dwyer
2018-07-25Merge pull request #2353 from emersion/render-opaque-overlayDrew DeVault
Improve rendering with a fullscreen opaque overlay surface
2018-07-25reverted includes of "sway/config.h" and replaced with "config.h" from meson ↵Pascal Pascher
build
2018-07-25Improve rendering with a fullscreen opaque overlay surfaceemersion
The rendering code doesn't use the exclusive input surface at all anymore to decide to skip rendering of shell surfaces. This fixes a weird situation in which a client requests exclusive input but isn't an overlay layer surface. The renderer also renders all overlay surfaces in this situation, not just one. This simplifies the code and fixes rendering when there are more than one overlay surfaces (e.g. for a virtual keyboard to type the lockscreen password).
2018-07-24style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: falsePascal Pascher
2018-07-24Added meson option "enable_xwayland" (default: true) to enable/disable ↵Pascal Pascher
xwayland support
2018-07-23Merge branch 'master' into pid-workspacesDrew DeVault
2018-07-23fix crash on new output while swaylock is runningsomdoron
2018-07-22Handle set_{title,app_id} for xdg-shell and zxdg-shell-v6emersion
This allows to update the title even if the view doesn't commit. This is useful e.g. when a terminal sets its toplevel title to the currently running command and when the view isn't visible.