aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/transaction.c
Commit message (Collapse)AuthorAge
...
| * 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
* Store geometry in the view and handle any floating view resizingLibravatar Ryan Dwyer2018-08-18
|
* Fix geometryLibravatar Ryan Dwyer2018-08-18
|
* 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.
* 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.
* Correctly track saved surfaces during multiple transactionsLibravatar Ryan Dwyer2018-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Include errno.hLibravatar Ryan Dwyer2018-07-28
|
* Show errno description in logLibravatar Ryan Dwyer2018-07-28
|
* Handle out-of-fd situations gracefully for transaction and urgent timersLibravatar Ryan Dwyer2018-07-28
|
* Second attempt at fixing transaction use-after-freeLibravatar Ryan Dwyer2018-07-28
| | | | | | | | | 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.
* Fix use after free in transactionsLibravatar Ryan Dwyer2018-07-28
| | | | | | | 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.
* Allow containers to be fullscreenLibravatar Ryan Dwyer2018-07-26
|
* Improve resize performance by partially flushing the transaction queueLibravatar Ryan Dwyer2018-07-22
| | | | | | | | | | | | When interactively resizing some views (eg. Nautilus), new transactions are added to the queue faster than the client can process them. Previously, we would wait for the entire queue to be ready before applying any of them, but in this case the transactions would time out, giving the client choppy performance. This changes the queue handling so it applies the transactions up to the first waiting transaction, without waiting for the entire queue to be ready.
* Update for swaywm/wlroots#1148Libravatar emersion2018-07-19
|
* Make focus part of transactionsLibravatar Ryan Dwyer2018-07-15
| | | | | | | | | | | | Rather than maintain copies of the entire focus stack, this PR transactionises the focus by introducing two new properties to the container state and using those when rendering. * `bool focused` means this container has actual focus. Only one container should have this equalling true in its current state. * `struct sway_container *focus_inactive_child` points to the immediate child that was most recently focused (eg. for tabbed and stacked containers).
* Merge pull request #2272 from RyanDwyer/simplify-transactionsLibravatar Drew DeVault2018-07-15
|\ | | | | Simplify transactions by using a dirty flag on containers
| * Set signature to voidLibravatar Ryan Dwyer2018-07-15
| |
| * Simplify transactions by utilising a dirty flag on containersLibravatar Ryan Dwyer2018-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR changes the way we handle transactions to a more simple method. The new method is to mark containers as dirty from low level code (eg. arranging, or container_destroy, and eventually seat_set_focus), then call transaction_commit_dirty which picks up those containers and runs them through a transaction. The old methods of using transactions (arrange_and_commit, or creating one manually) are now no longer possible. The highest-level code (execute_command and view implementation handlers) will call transaction_commit_dirty, so most other code just needs to set containers as dirty. This is done by arranging, but can also be done by calling container_set_dirty.
* | Add extended debugging flagsLibravatar Drew DeVault2018-07-14
|/ | | | | | We currently have several ways of setting debug flags, including command line arguments, environment variables, and compile-time macros. This replaces the lot with command line flags.
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* Updates per wlroots#1076Libravatar Drew DeVault2018-07-05
|
* Fix use after free in transaction codeLibravatar Ryan Dwyer2018-07-04
| | | | | | | | | If we set an instruction as ready twice, it decreases the transaction's num_waiting a second time and applies the transaction earlier than it should. This no doubt has undesired effects, probably resulting in a use after free. Hopefully fixes the first part of #2207.
* Merge pull request #2187 from martinetd/idle-inhibitLibravatar emersion2018-07-02
|\ | | | | Idle inhibit
| * idle_inhibit: move server data to its own structLibravatar Dominique Martinet2018-07-02
| |
| * idle_inhibit: stop inhibitor when views become invisibleLibravatar Dominique Martinet2018-07-02
| |
* | transaction_apply: use float for quotientLibravatar Dominique Martinet2018-07-02
|/ | | | | | Pre-dividing 1000/60 would lose 2/3 due to round-up Found through static analysis
* Fix flash of background when xwayland views are mappedLibravatar Ryan Dwyer2018-06-30
| | | | | | | | | | | A flash of background was happening for two reasons: 1) We were using the xsurface's dimensions to check if the surface is ready, but these are pending dimensions. 2) In my particular setup, the default geometry of the xsurface does not intersect any output, which prevented it from receiving a frame done event. This made the transaction time out and the client would only redraw once it's been rendered.
* Render saved buffers with the surface's dimensionsLibravatar Ryan Dwyer2018-06-29
|
* Replace list_empty with a simple alternativeLibravatar Ryan Dwyer2018-06-29
|
* Allow views to skip configuresLibravatar Ryan Dwyer2018-06-27
| | | | | To do this properly, the transaction queue will only be processed if it can be completely processed.
* Remove transaction_add_damageLibravatar Ryan Dwyer2018-06-27
| | | | Instead, damage each container when applying the transaction.
* Fix nitpicksLibravatar Ryan Dwyer2018-06-27
|
* Remove timer when transaction destroysLibravatar Ryan Dwyer2018-06-26
|
* Rename progress_queue to transaction_progress_queueLibravatar Ryan Dwyer2018-06-25
|
* Implement per-configure debug timingsLibravatar Ryan Dwyer2018-06-25
|
* Implement transaction timings debugLibravatar Ryan Dwyer2018-06-25
| | | | Launch sway with SWAY_DEBUG=txn_timings to enable it.
* Implement atomic layout updates for xwayland viewsLibravatar Ryan Dwyer2018-06-24
|
* Force transactions to complete in orderLibravatar Ryan Dwyer2018-06-24
| | | | | This forces transactions to complete in order by using a singly linked list stored in the sway server.
* Implement atomic layout updates for tree operationsLibravatar Ryan Dwyer2018-06-23
| | | | | This implements atomic layout updates for when views map, reparent or unmap.
* Preserve buffers during transactionsLibravatar Ryan Dwyer2018-06-18
| | | | | * Also fix parts of the rendering where it was rendering the pending state instead of current.
* Merge remote-tracking branch 'upstream/master' into atomicLibravatar Ryan Dwyer2018-06-11
|
* Refactor everything that needs to arrange windowsLibravatar Ryan Dwyer2018-06-09
| | | | | | | | | | * The arrange_foo functions are now replaced with arrange_and_commit, or with manually created transactions and arrange_windows x2. * The arrange functions are now only called from the highest level functions rather than from both high level and low level functions. * Due to the previous point, view_set_fullscreen_raw and view_set_fullscreen are both merged into one function again. * Floating and fullscreen are now working with transactions.
* Make main properties be the pending stateLibravatar Ryan Dwyer2018-06-09
|
* WIP: Atomic layout updates ground workLibravatar Ryan Dwyer2018-06-09