aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-19Merge pull request #2484 from ianyfan/con-for-each-child-fixRyan Dwyer
Fix double iterating in container_for_each_child
2018-08-18Fix double iterating in container_for_each_childIan Fan
2018-08-18Merge pull request #2473 from RyanDwyer/iterators-per-typeDrew DeVault
Implement iterators per container type
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-18Merge pull request #2460 from RyanDwyer/implement-mousedownDrew DeVault
Implement mousedown operation
2018-08-18Merge pull request #2481 from RyanDwyer/rename-functionsDrew DeVault
Rename container_sort_workspaces and container_wrap_children
2018-08-18Rename container_sort_workspaces and container_wrap_childrenRyan Dwyer
This commit renames container_sort_workspaces to output_sort_workspaces and moves it to output.c. This also renames container_wrap_children to workspace_wrap_children and moves it to workspace.c. This function is only called with workspaces.
2018-08-18Merge pull request #2480 from RyanDwyer/fix-mod-resizeemersion
Fix mod+resize
2018-08-18Fix mod+resizeRyan Dwyer
Fixes #2479. It was missing a mod_pressed check. This also moves the parent traversal into the `if` block.
2018-08-18Don't send motion if the cursor hasn't movedRyan Dwyer
Prevents GTK+ comboboxes from immediately closing.
2018-08-18Rename mousedown to down and make seat operation a named enumRyan Dwyer
2018-08-18Implement mousedown operationRyan Dwyer
This allows you to move the cursor off the surface while dragging its scrollbar.
2018-08-17Merge pull request #2472 from RyanDwyer/refactor-seat-get-focusDrew DeVault
Refactor seat_get_focus functions
2018-08-17Merge pull request #2471 from RyanDwyer/reap-when-floatingemersion
Attempt to reap old tiling parent when floating a container
2018-08-17Merge pull request #2474 from RyanDwyer/transactionise-csdemersion
Add using_csd variable to transaction state
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-17Refactor seat_get_focus functionsRyan Dwyer
Fixes #2467. This commit introduces seat_get_focus_inactive_floating to supplement seat_get_focus_inactive_tiling, and uses it during `focus mode_toggle` which fixes a focus bug. This also refactors the seat_get_focus_inactive functions so that they do their selection logic themselves rather than offloading it to seat_get_focus_by_type which was getting bloated. seat_get_focus_by_type is now removed. Lastly, this commit changes seat_get_focus to just return the first container in the focus stack rather than looping and calling seat_get_focus_by_type.
2018-08-17Attempt to reap old tiling parent when floating a containerRyan Dwyer
2018-08-17Merge pull request #2465 from DonnieWest/masterRyan Dwyer
Default to the previous workspace if the current one has no focused windows
2018-08-16When the workspace is focused, return it instead of checking parentDonnie West
2018-08-15Merge pull request #2458 from RyanDwyer/cleanup-transactionsDrew DeVault
Simplify transactions
2018-08-15Merge pull request #2459 from RyanDwyer/fix-workspace-prev-nextemersion
Use list_find in more places and refactor/fix workspace prev_next functions
2018-08-15Use list_find in more places and refactor/fix workspace prev_next functionsRyan Dwyer
The original purpose of this commit is to replace some for loops with list_find. But while doing this I found the workspace_prev_next_impl functions to be difficult to read and also contained a bug, so I refactored them and fixed the bug. To reproduce the bug: * Have two outputs, where the left output has workspaces 1, 2, 3 and the right output has workspaces 4, 5, 6. Make workspace 2 focused_inactive and workspace 4 focused. * Run `workspace prev`. * Previously it would visit the left output, then apply `workspace prev` to workspace 2, which focuses workspace 1. * Now it will focus the rightmost workspace on the left output (workspace 3). The refactoring I made to the workspace functions are: * Added the static keyword. * They now accept an int dir rather than bool, to avoid an unnecessary conversion. * Rather than preparing start and end variables for the purpose of iterating, just iterate everything. * Replace for loops with list_find. * Don't call workspace_output_prev_next_impl (this fixes the bug).
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-14Merge pull request #2445 from RyanDwyer/resize-tiling-via-cursorDrew DeVault
Implement resizing tiled containers via cursor
2018-08-13Merge pull request #2454 from minus7/workspace-namesemersion
Use assigned workspace name for output
2018-08-12Use assigned workspace name for outputminus
Instead of relying on bindings being configured, primarily source new workspace names from workspace-output assignments. Fixes #2435
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-12Make mod+resize a floating container resize the container itselfRyan Dwyer
Rather than resizing the split within the container.
2018-08-12Use col-resize and row-resize cursor imagesRyan Dwyer
2018-08-12Fix right-click/popups and add state checksRyan Dwyer
2018-08-12Allow resizing tiled views via mod keyRyan Dwyer
2018-08-12Refactor dispatch_cursor_buttonRyan Dwyer
There was a separate function dispatch_cursor_button_floating which dealt with the resize and move operations, but as resize is not really limited to floating views, it doesn't make as much sense to have this separate. So both functions are now combined into one. Additionally, dispatch_cursor_button now uses a pattern of returning early instead of using else-ifs.
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-11Merge pull request #2452 from janza/position-command-fix-argsDrew DeVault
Man page: Correct argument format for output position config
2018-08-11man: Correct format for output position configJosip Janzic
2018-08-11Merge pull request #2451 from RyanDwyer/fix-ancestor-crashDrew DeVault
Fix container_has_ancestor crash
2018-08-12Fix container_has_ancestor crashRyan Dwyer
Fixes #2450
2018-08-11Merge pull request #2449 from RyanDwyer/remove-bfsDrew DeVault
Remove container_for_each_descendant_bfs
2018-08-11Merge pull request #2448 from RyanDwyer/remove-container-has-childemersion
Remove container_has_child
2018-08-11Remove container_for_each_descendant_bfsRyan Dwyer
The function was not used. Also renames container_for_each_descendant_dfs to just container_for_each_descendant.
2018-08-11Remove container_has_childRyan Dwyer
In all cases you can use container_has_ancestor with the arguments swapped, which is faster than container_has_child.
2018-08-10Merge pull request #2447 from ianyfan/swaynag-leakemersion
Fix memory leak in swaynag
2018-08-10swaynag: destroy old cursor theme when updatedIan Fan
2018-08-10Merge pull request #2446 from emersion/xwayland-unmanaged-orderDrew DeVault
xwayland: fix unmanaged surfaces order
2018-08-10xwayland: fix unmanaged surfaces orderemersion
2018-08-09Merge pull request #2441 from RyanDwyer/finish-resize-commandsBrian Ashworth
Finish resize commands
2018-08-10Update resize documentationRyan Dwyer
2018-08-10Implement resize set <width> <height> for tiled containersRyan Dwyer
Unlike i3, this implementation allows px measurements. Also fixes a sane size check.