Commit Graph

192 Commits

Author SHA1 Message Date
Pascal Pascher 2bf893248a style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: false 2018-07-24 23:37:41 +02:00
Pascal Pascher 24ad1c3983 Added meson option "enable_xwayland" (default: true) to enable/disable xwayland support 2018-07-24 22:16:06 +02:00
Ryan Dwyer f9491c9584 Fix damage issue when moving and resizing 2018-07-22 23:10:19 +10:00
Ryan Dwyer 2032f85d94 Simplify transactions by utilising a dirty flag on containers
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.
2018-07-14 23:14:55 +10:00
emersion d88f1d2196 Fix output_has_opaque_lockscreen 2018-07-13 12:26:20 +01:00
emersion 63b4bf5000
Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
emersion f9625d1d56
Split renderer 2018-07-07 10:30:52 +01:00
Ryan Dwyer 0046eed969 Fix titles when container titles contain UTF-8 characters
The title and marks textures would have their height set from the
config's computed max font height, but the textures were not regenerated
when the config's max font height changed which made a gap appear.
Rather than making it regenerate the title textures every time the
config font height was changed, I've changed it to just make the
textures the height of the title itself and fill any gap when rendering.

Also, the title_width and marks_width variables have been renamed to
make it more obvious that they are in output-buffer-local coordinates.

Fixes #1936.
2018-07-07 15:49:51 +10:00
Ryan Dwyer 464d4d5889 Translate surface by its geo when doing opaque box check 2018-07-07 01:18:54 +10:00
Ryan Dwyer 9480781229 Don't clear when using opaque lockscreen 2018-07-07 00:21:39 +10:00
Ryan Dwyer 3b842f4eed Detect opaque lockscreen when using a solid color 2018-07-07 00:17:08 +10:00
Ryan Dwyer f1fadef923 Use pixman_region32_contains_rectangle 2018-07-07 00:03:49 +10:00
Ryan Dwyer 839c3a5500 Use opaque region to determine if frame done should be sent 2018-07-07 00:03:49 +10:00
Ryan Dwyer 58befcf2cd Don't send frame done to surfaces behind lockscreen
Also, when rendering, don't descend into the tree if the lockscreen is
active. Just render the lockscreen's surfaces.
2018-07-07 00:03:49 +10:00
emersion 51b215ad5c
Use wlr_surface.buffer_damage 2018-07-05 00:26:39 +01:00
Drew DeVault d43500831a
Updates per wlroots#1076 2018-07-05 00:26:35 +01:00
Dominique Martinet 9ea4cc13a0 sway views: add helpers to get view and layer from wlr_surface 2018-06-30 22:31:14 +09:00
Ryan Dwyer e396af853b Merge remote-tracking branch 'upstream/master' into atomic 2018-06-30 22:46:25 +10:00
Rostislav Pehlivanov 0cc24dd9c8 Fix crash with stacking layout after f42bf0ad4
The "simple" rendering function only applies to tiled views.
2018-06-30 12:45:49 +01:00
Rostislav Pehlivanov e0d0e8f840 Revert "Don't unmaximize floating views"
This reverts commit 97672295ed.
2018-06-30 11:10:47 +01:00
Ryan Dwyer 3a6ed5110c Render saved buffers with the surface's dimensions 2018-06-29 21:13:22 +10:00
Ryan Dwyer a2fbb20a61 Merge remote-tracking branch 'upstream/master' into atomic 2018-06-29 20:04:24 +10:00
Dominique Martinet 6856866a61 layer_shell: order destroying before sway_output
Both sway_output and sway_layer_shell listen to wlr's output destroy event,
but sway_layer_shell needs to access into sway_output's data strucure and needs
to be destroyed first.

Resolve this by making sway_layer_shell listen to a new event that happens at
start of sway_output's destroy handler
2018-06-26 21:20:56 +09:00
Ryan Dwyer 834805f5e2 Fix crash when disconnecting output
We were freeing the sway_output immediately upon disconnect which left
a dangling pointer in the output's container. It then tried to use the
pointer when the container is freed.

We don't need to store the sway_output in an output's container which is
destroying, so the fix is to set the pointer to NULL and remove the use
in container_free.

Also added an arrange when the output is disconnected for good measure.
2018-06-26 19:40:42 +10:00
Ryan Dwyer 33e03cb277 Fix crash related to stacks and tabs 2018-06-24 13:08:47 +10:00
Ryan Dwyer 32b865e610 Fix crash when deleting last child in a tabbed or stacked container
There was no `current` child because the container was destroyed. This
makes it fall back to looking in the parent's current children list.
2018-06-23 17:47:28 +10:00
Ryan Dwyer 38398e2d77 Implement atomic layout updates for tree operations
This implements atomic layout updates for when views map, reparent or
unmap.
2018-06-23 16:24:11 +10:00
Ryan Dwyer 1c89f32533 Preserve buffers during transactions
* Also fix parts of the rendering where it was rendering the pending
state instead of current.
2018-06-18 20:42:12 +10:00
Ryan Dwyer 645bf446fa Merge remote-tracking branch 'upstream/master' into atomic 2018-06-18 15:58:48 +10:00
emersion 088cae45c8 Update for swaywm/wlroots#1060 2018-06-16 13:32:23 -04:00
Ryan Dwyer 9e96cfd310 Merge remote-tracking branch 'upstream/master' into atomic 2018-06-11 11:03:43 +10:00
emersion cfd02918c0
Render drag icons 2018-06-09 13:26:03 +01:00
emersion 88cd7616db
Fix compilation errors related to disabled outputs 2018-06-09 11:38:16 +01:00
Ryan Dwyer bb66e6d578 Refactor everything that needs to arrange windows
* 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.
2018-06-09 10:11:25 +10:00
Ryan Dwyer f9e6d703d2 Make main properties be the pending state 2018-06-09 10:08:43 +10:00
Ryan Dwyer 59c9488701 WIP: Atomic layout updates ground work 2018-06-09 10:08:43 +10:00
Brian Ashworth e072fbc6d9 Switch output storing from list_t to wl_list 2018-06-06 20:11:24 -04:00
Brian Ashworth a0bbe67076 Address emersions comments on output re-enabling 2018-06-06 20:11:24 -04:00
Brian Ashworth a1b5b93d29 Store sway_outputs so that they can be reenabled 2018-06-06 20:11:24 -04:00
emersion 0f71547032
Merge pull request #2095 from emersion/fullscreen-damage-only-visible
Only send frame to visible surfaces when fullscreened
2018-06-05 11:18:52 +01:00
emersion 55b855d867
Add SWAY_DAMAGE_DEBUG
Setting it to "rerender" will always re-render everything
regardless of the damaged region. Setting it to "highlight" will
clear the screen and render only damaged regions.
2018-06-02 21:57:34 +01:00
emersion 34bdf25bb5
Only send frame to visible surfaces when fullscreened 2018-06-02 20:56:33 +01:00
emersion 51eee3aecc
Schedule a frame even if damage is empty 2018-06-02 20:42:26 +01:00
emersion 65845be802
Only send frame done to visible views
Also don't accumulate empty damage
2018-06-02 15:19:03 +01:00
Ryan Dwyer 02d385e06f Use swayc rather than wlr_output when rendering 2018-06-01 23:14:58 +10:00
Ryan Dwyer 3281574fa3 Remove check for if floating view intersects output 2018-06-01 23:14:58 +10:00
Ryan Dwyer 7d2b33a458 Render floating views before top layer and unmanaged 2018-06-01 23:14:58 +10:00
Ryan Dwyer e4e912ea91 Store swayc coordinates as layout-local 2018-06-01 23:14:58 +10:00
Ryan Dwyer dc83b158e1 Fix issues with sticky containers and workspaces
* Attach sticky containers to new workspaces when switching
* Fire the close event *before* we start destroying the workspace to
prevent a crash

Because the sticky container now follows the visible workspace, this
simplifies the rendering and container_at logic.
2018-06-01 23:14:58 +10:00
Ryan Dwyer 754cb7944c Respect view's border config for floating containers 2018-06-01 23:14:58 +10:00