aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop
Commit message (Collapse)AuthorAge
...
* | Do not modeset disabled outputsLibravatar emersion2018-09-01
|/
* Implement window_type criteria tokenLibravatar Ryan Dwyer2018-09-01
|
* Don't send never-ending transactions when a focused layer surface commitsLibravatar Ryan Dwyer2018-08-31
| | | | | | | | | | | This moves the arrange_windows call into the arrange_layers function, where we know the output actually needs to be arranged. Additionally, we shouldn't set focus to the parent of an unknown container type, because the parent may be an output and this causes a crash because outputs can't have direct focus. Fixes #2543
* Merge pull request #2531 from RyanDwyer/maybe-fix-transaction-crashLibravatar Drew DeVault2018-08-29
|\ | | | | Don't use bitfield to test for similar transactions
| * Don't use bitfield to test for similar transactionsLibravatar Ryan Dwyer2018-08-29
| | | | | | | | | | | | | | | | | | | | | | | | When there's multiple transactions in the queue, sway can take a shortcut by checking if they all operate on the same set of containers. If they do, it can skip all but the last transaction. The way we tested for transactions which used the same containers was to exclusive-or their con IDs together, but this has proved not only to be ineffective but also has the potential to make sway crash. This patch replaces the exclusive-or with a loop and container comparison.
* | Fix rendering of nested tabsLibravatar Ryan Dwyer2018-08-29
| | | | | | | | The C_CONTAINER check needs to apply to C_VIEW as well.
* | Fix workspace tabsLibravatar Ryan Dwyer2018-08-29
|/ | | | | | | | | | When collecting focus to save into the transaction state, the workspace needs to look in the tiling list only. As seat_get_focus_inactive_tiling returns any descendant, the list also needs to be traversed back up to the direct child of the workspace. Fixes #2532
* Fix gaps issuesLibravatar Ryan Dwyer2018-08-28
| | | | | | | | | * In layout command, arrange parent of parent - not sure why this is needed but it is * Remove gap adjustment when rendering * Workspace should use outer gaps, not inner * Add exceptions for tabbed and stacked containers * Don't mess with gap state when splitting a container
* Prepare arrange code for type safe argumentsLibravatar Ryan Dwyer2018-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the arrange code in a way that will support type safe arguments. The arrange_output et al functions are now public, however I opted not to use them directly yet. I've kept the generic arrange_windows there for convenience until type safety is fully implemented. This means this patch has much less risk of breaking things as it would otherwise. To be type safe, arrange_children_of cannot exist in its previous form because the thing passed to it could be either a workspace or a container. So it's now renamed to arrange_children and accepts a list_t, as well as the parent layout and parent's box. There was some code which checked the grandparent's layout to see if it was tabbed or stacked and adjusted the Y offset of the grandchild accordingly. Accessing the grandparent layout isn't easy when using type safe arguments, and it seemed odd to even need to do this. I determined that this was needed because a child of a tabbed container would have a swayc Y matching the top of the tab bar. I've changed this so a child of a tabbed container will have a swayc Y matching the bottom of the tab bar, which means we don't need to access the grandparent layout. Some tweaks to the rendering and autoconfigure code have been made to implement this, and the container_at code appears to work without needing any changes. arrange_children_of (now arrange_children) would check if the parent had gaps and would copy them to the child, effectively making the workspace's gaps recurse into all children. We can't do this any more without passing has_gaps, gaps_inner and gaps_outer as arguments to arrange_children, so I've changed the add_gaps function to retrieve it from the workspace directly. apply_tabbed_or_stacked_layout has been split into two functions, as it had different logic depending on the layout. Lastly, arrange.h had an unnecessary include of transaction.h. I've removed it, which means I've had to add it to several other files.
* Merge pull request #2513 from RyanDwyer/rename-root-outputsLibravatar Drew DeVault2018-08-26
|\ | | | | Rename sway_root.outputs to sway_root.all_outputs
| * Rename sway_root.outputs to sway_root.all_outputsLibravatar Ryan Dwyer2018-08-25
| | | | | | | | | | | | | | | | This list includes disabled outputs. When sway_container is demoted, we'll need to store the root's children (ie. enabled outputs) in the sway_root. It makes sense to put these in a list called `outputs`, so I'm renaming the existing list in advance.
* | Remove layout.cLibravatar Ryan Dwyer2018-08-26
|/ | | | | | | | | | | | | | | | | | | | | | | | | When we have type safety we'll need to have functions for workspace_add_tiling and so on. This means the existing container functions will be just for containers, so they are being moved to container.c. At this point layout.c doesn't contain much else, so I've relocated everything and removed the file. * container_swap and its static functions have been moved to the swap command and made static. * container_recursive_resize has been moved to the resize command and made static. * The following have been moved to container.c: * container_handle_fullscreen_reparent * container_insert_child * container_add_sibling * container_add_child * container_remove_child * container_replace_child * container_split * enum movement_direction and sway_dir_to_wlr have been moved to util.c. Side note: Several commands included layout.h which then included root.h. With layout.h gone, root.h has to be included by those commands.
* Refactor destroy functions and save workspaces when there's no outputsLibravatar Ryan Dwyer2018-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the destroy functions to the following: * output_begin_destroy * output_destroy * workspace_begin_destroy * workspace_destroy * container_begin_destroy * container_destroy * view_begin_destroy * view_destroy The terminology was `destroy` and `free`, and it has been changed to `begin_destroy` and `destroy` respectively. When the last output is disconnected, its workspaces will now be stashed in the root. Upon connection of a new output they will be restored. There is a new function `workspace_consider_destroy` which decides whether the given workspace should be destroyed or not (ie. empty and not visible). Calling container_begin_destroy will no longer automatically reap the parents. In some places we want to reap the parents and in some we don't, so this is left to the caller. container_reap_empty_recursive and container_reap_empty have been combined into one function and it will recurse up the tree.
* Merge pull request #2483 from RyanDwyer/floating-emit-reparentLibravatar Drew DeVault2018-08-19
|\ | | | | Send enter/leave events for floating views
| * Send output enter/leave events correctlyLibravatar Ryan Dwyer2018-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we used a reparent event to detect when a view changes parent, then sent an output enter/leave to the surfaces if needed. This worked for tiling views but not floating views, as floating views can intersect another output without changing parent. The solution implemented for floating views also applies cleanly to tiling views, so the previous method has been completely replaced and the reparent event has been removed. This introduces a new function container_discover_outputs. This function compares the container's `current` position to the outputs, sends enter and leave events as needed, and keeps track of which outputs it's intersecting in a new `container->outputs` list. If it has entered a new output with a different scale then the title and marks textures will also be recreated at the new scale. The function is called when a transaction applies. This is convenient as it means we don't have to call it from various places. There is imperfect rendering when a floating view overlaps two outputs with different scales. It renders correctly for the most recently entered output, but there is only one title texture so it renders incorrectly on the old output. Fixes #2482
* | Fix crash when a view destroys with pending transactionsLibravatar Ryan Dwyer2018-08-20
|/ | | | | | | | | | We were removing the saved buffer when one transaction applies, then didn't have a new buffer to save when the next transaction ran. This made the rendering code crash as it had no surface to use. This commit makes it continue to hold the buffer if the view is destroying and has more transactions. Additionally, a check is added when saving the buffer to make sure there's no one already there.
* Merge pull request #2493 from RyanDwyer/fix-popup-positionLibravatar emersion2018-08-19
|\ | | | | Fix popup position when parent uses geometry
| * Fix popup position when parent uses geometryLibravatar Ryan Dwyer2018-08-19
| | | | | | | | Fixes #2489.
* | Merge pull request #2478 from RyanDwyer/standardise-debugLibravatar Drew DeVault2018-08-19
|\ \ | |/ |/| Standardise debug variables
| * Use enum for damage debug optionsLibravatar Ryan Dwyer2018-08-19
| |
| * Standardise debug variablesLibravatar Ryan Dwyer2018-08-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes all debug options stored in a single struct rather than in various places, changes/fixes the behaviour of existing options, and introduces some new options. * Fixes damage issues with `-Drender-tree` texture (by removing scissor) * Offsets the render tree overlay's `y` position for those who have swaybar at the top * Replaces `-Ddamage=rerender` with `-Dnodamage` * Replaces `-Ddamage=highlight` with `-Dhighlight-damage` * Replaces `-Dtxn-debug` with `-Dtxn-wait` * Introduces `-Dnoatomic` * Removes the `create_time` and `ms_arranging` figures from transactions and the log message. Transactions are created after arranging and the create time is of no significance. * Fixes `-Dtxn-debug` (now `-Dtxn-wait`) not working.
* | Replace hacky L_FLOATING container with a listLibravatar Ryan Dwyer2018-08-19
|/ | | | | | | | | | | | | | | | Workspaces previously had a magical `workspace->floating` container, which had a layout of L_FLOATING and whose children were actual floating views. This allowed some conveniences, but was a hacky solution because the container has to be exempt from focus, coordinate transactions with the workspace, and omit emitting IPC events (which we didn't do). This commit changes it to be a list directly in the sway_workspace. The L_FLOATING layout is no longer used so this has been removed as well. * Fixes incorrect check in the swap command (it checked if the containers had the L_FLOATING layout, but this layout applied to the magical container). * Introduces workspace_add_floating
* Merge pull request #2466 from RyanDwyer/geometryLibravatar Drew DeVault2018-08-18
|\ | | | | Fix geometry
| * Fix nitpickLibravatar Ryan Dwyer2018-08-18
| |
| * Store geometry in the view and handle any floating view resizingLibravatar Ryan Dwyer2018-08-18
| |
| * Set current size when a floating xwayland view resizesLibravatar Ryan Dwyer2018-08-18
| | | | | | | | This avoids sending an unnecessary configure.
| * Handle xwayland views sending new sizes in their commitsLibravatar Ryan Dwyer2018-08-18
| |
| * Add get_geometry for xdg_shell_v6Libravatar Ryan Dwyer2018-08-18
| |
| * Render saved buffer using saved geometryLibravatar Ryan Dwyer2018-08-18
| |
| * Fix geometryLibravatar Ryan Dwyer2018-08-18
| |
| * Add view_get_geometryLibravatar emersion2018-08-18
| |
* | Implement iterators per container typeLibravatar Ryan Dwyer2018-08-18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add using_csd variable to transaction stateLibravatar Ryan Dwyer2018-08-17
| | | | | | | | | | | 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.
* Simplify transactionsLibravatar Ryan Dwyer2018-08-15
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Don't commit multiple transactions at the same timeLibravatar Ryan Dwyer2018-08-12
|
* Don't progress transaction queue if any are partially completeLibravatar Ryan Dwyer2018-08-12
| | | | | | 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.
* Implement resizing tiled containers via cursorLibravatar Ryan Dwyer2018-08-12
| | | | | | | | | * 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.
* xwayland: fix unmanaged surfaces orderLibravatar emersion2018-08-10
|
* Handle views created after decoration mode is sent for xdg-shell-v6Libravatar emersion2018-08-06
|
* Handle views created after decoration mode is sent for xdg-shellLibravatar emersion2018-08-06
|
* Convert toplevel coordinates to output-localLibravatar Ryan Dwyer2018-08-02
|
* Revert "Revert "Fix popups""Libravatar Ryan Dwyer2018-08-02
| | | | | | This reverts commit 9aa258d33a9baa42895214da7e82f4568fcb8f76. Reverting the revert, so that popups can be fixed.
* Merge pull request #2366 from RedSoxFan/nagbarLibravatar Drew DeVault2018-08-02
|\ | | | | Implement swaynag
| * Merge branch 'master' into nagbarLibravatar Ryan Dwyer2018-08-02
| |\
| * | Address first round review for swaynagLibravatar Brian Ashworth2018-08-01
| | |
| * | Arrange output in arrange_layers and commit dirtyLibravatar Brian Ashworth2018-08-01
| | |
* | | Revert "Fix popups"Libravatar Drew DeVault2018-08-02
| |/ |/| | | | | This reverts commit de86d65627e96cffe77f4abf11c4a0b982326ff9.
* | Fix race condition crashes when unmapping viewsLibravatar Ryan Dwyer2018-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'master' into fix-resize-wiggleLibravatar emersion2018-08-02
|\|
| * Close popups when changing focusLibravatar Ryan Dwyer2018-07-31
| | | | | | | | Also reverts the send frame done changes from the previous commit.