Commit graph

211 commits

Author SHA1 Message Date
Ryan Dwyer 8392eae40f Revert "Revert "Fix popups""
This reverts commit 9aa258d33a.

Reverting the revert, so that popups can be fixed.
2018-08-02 23:36:36 +10:00
Drew DeVault 9aa258d33a Revert "Fix popups"
This reverts commit de86d65627.
2018-08-02 09:05:46 -04:00
Ryan Dwyer 7a59508da4 Close popups when changing focus
Also reverts the send frame done changes from the previous commit.
2018-07-31 19:58:34 +10:00
Ryan Dwyer de86d65627 Fix popups
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-31 18:41:30 +10:00
emersion 15c19572cf Fix segfault with fullscreen 2018-07-30 19:44:07 +01:00
Drew DeVault cbd0c3ec40
Merge pull request #2367 from emersion/iterator-redesign
Refactor surface iterators
2018-07-30 13:12:22 -04:00
Brian Ashworth b8efdeae29 Fix title textures on scale change 2018-07-30 01:59:20 -04:00
emersion 0ad865f0b7 Make output_surface_for_each_surface_iterator static 2018-07-29 14:34:48 +01:00
emersion 9951b2ec33 Remove unused output_from_wlr_output 2018-07-29 14:33:26 +01:00
emersion fe0750fec1 Remove output_surface_for_each_surface from header 2018-07-29 14:33:26 +01:00
emersion 8d5cc8625c Completely switch over to new iterators 2018-07-29 14:33:26 +01:00
emersion e9d674cfd2 wip: redesign output_view_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion a0dd977617 wip: redesign output_layer_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion dbf6dd0dae wip: redesign output_drag_icons_for_each_surface iterator 2018-07-29 14:33:26 +01:00
emersion d2172bd331 wip: redesign output_unmanaged_for_each_surface iterator 2018-07-29 14:33:26 +01:00
Ryan Dwyer 27a20a4884 Allow containers to be fullscreen 2018-07-26 08:27:07 +10:00
Drew DeVault 53dbe2da4b
Merge pull request #2353 from emersion/render-opaque-overlay
Improve rendering with a fullscreen opaque overlay surface
2018-07-25 08:32:32 -04:00
Pascal Pascher f95cb9a7c1 reverted includes of "sway/config.h" and replaced with "config.h" from meson build 2018-07-25 13:32:20 +02:00
emersion 0e79b2114c Improve rendering with a fullscreen opaque overlay surface
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-25 08:55:41 +01:00
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