Commit graph

385 commits

Author SHA1 Message Date
Ryan Dwyer
c699a86e47 Fix pixel leaks when using fractional scaling
The basic idea here is to apply rounding after scaling. It's not as
simple as this, though, and I've detailed it in the comments for a
function.

In order to fix some pixel leaks in the title bar, I found it easier to
change how we place rectangles to fill the area. Instead of placing two
rectangles across the full width above and below the title and having
shorter rectangles in the inner area, it's now pieced together in
vertical chunks. This method involves drawing two less rectangles per
container.
2018-10-12 22:36:11 +10:00
Ryan Dwyer
f23588de3c Introduce container_is_transient_for 2018-10-08 23:00:36 +10:00
Ryan Dwyer
832ebc8966 Implement popup_during_fullscreen
This introduces a new view_impl function: is_transient_for. Similar to
container_has_ancestor but works using the surface parents rather than
the tree.

This patch modifies view_is_visible, container_at and so on to allow
transient views to function normally when they're in front of a
fullscreen view.
2018-10-08 22:49:59 +10:00
Ryan Dwyer
f6e218a643 Rename seat_get_active_child to seat_get_active_tiling_child
Also renames container to con in one function to prevent ugly line
wrapping.
2018-09-16 22:01:54 +10:00
emersion
7699c5444c Update for swaywm/wlroots#1243 2018-09-14 19:21:44 +02:00
Drew DeVault
030b5bc024
Merge pull request #2603 from emersion/fix-dnd
Fix drag-and-drop
2018-09-07 11:09:02 -04:00
emersion
251a7ebc4b Fix drag-and-drop 2018-09-07 15:43:15 +02:00
Ryan Dwyer
93ff7879f1 Fix output position issue
Looks like the output dimensions need to be set when arranging rather
than when a mode is set.

Fixes an issue with position of fullscreen views.
2018-09-05 18:01:43 +10:00
Ryan Dwyer
0b23423c14 Update output propertes on mode change
This was previously done when arranging the output, but only needs to be
done on mode change.
2018-09-05 18:01:43 +10:00
Ryan Dwyer
26204441b4 Apply default config to output
When starting without any output config, the default config was not
applying.
2018-09-05 18:01:43 +10:00
Ryan Dwyer
acc2628c79 Don't use wlr_output properties
These properties are before rotation.
2018-09-05 18:01:43 +10:00
Ryan Dwyer
7586f150c0 Implement type safe arguments and demote sway_container
This commit changes the meaning of sway_container so that it only refers
to layout containers and view containers. Workspaces, outputs and the
root are no longer known as containers. Instead, root, outputs,
workspaces and containers are all a type of node, and containers come in
two types: layout containers and view containers.

In addition to the above, this implements type safe variables. This
means we use specific types such as sway_output and sway_workspace
instead of generic containers or nodes. However, it's worth noting that
in a few places places (eg. seat focus and transactions) referring to
them in a generic way is unavoidable which is why we still use nodes in
some places.

If you want a TL;DR, look at node.h, as well as the struct definitions
for root, output, workspace and container. Note that sway_output now
contains a workspaces list, and workspaces now contain a tiling and
floating list, and containers now contain a pointer back to the
workspace.

There are now functions for seat_get_focused_workspace and
seat_get_focused_container. The latter will return NULL if a workspace
itself is focused. Most other seat functions like seat_get_focus and
seat_set_focus now accept and return nodes.

In the config->handler_context struct, current_container has been
replaced with three pointers: node, container and workspace. node is the
same as what current_container was, while workspace is the workspace
that the node resides on and container is the actual container, which
may be NULL if a workspace itself is focused.

The global root_container variable has been replaced with one simply
called root, which is a pointer to the sway_root instance.

The way outputs are created, enabled, disabled and destroyed has
changed. Previously we'd wrap the sway_output in a container when it is
enabled, but as we don't have containers any more it needs a different
approach. The output_create and output_destroy functions previously
created/destroyed the container, but now they create/destroy the
sway_output. There is a new function output_disable to disable an output
without destroying it.

Containers have a new view property. If this is populated then the
container is a view container, otherwise it's a layout container. Like
before, this property is immutable for the life of the container.

Containers have both a `sway_container *parent` and
`sway_workspace *workspace`. As we use specific types now, parent cannot
point to a workspace so it'll be NULL for containers which are direct
children of the workspace. The workspace property is set for all
containers, except those which are hidden in the scratchpad as they have
no workspace.

In some cases we need to refer to workspaces in a container-like way.
For example, workspaces have layout and children, but when using
specific types this makes it difficult. Likewise, it's difficult for a
container to get its parent's layout when the parent could be another
container or a workspace. To make it easier, some helper functions have
been created: container_parent_layout and container_get_siblings.

container_remove_child has been renamed to container_detach and
container_replace_child has been renamed to container_replace.

`container_handle_fullscreen_reparent(con, old_parent)` has had the
old_parent removed. We now unfullscreen the workspace when detaching the
container, so this function is simplified and only needs one argument
now.

container_notify_subtree_changed has been renamed to
container_update_representation. This is more descriptive of its
purpose. I also wanted to be able to call it with whatever container was
changed rather than the container's parent, which makes bubbling up to
the workspace easier.

There are now state structs per node thing. ie. sway_output_state,
sway_workspace_state and sway_container_state.

The focus, move and layout commands have been completely refactored to
work with the specific types. I considered making these a separate PR,
but I'd be backporting my changes only to replace them again, and it's
easier just to test everything at once.
2018-09-05 18:01:43 +10:00
emersion
349d1f3be8 Do not modeset disabled outputs 2018-09-01 18:56:53 +02:00
Ryan Dwyer
f5b9815128 Prepare arrange code for type safe arguments
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.
2018-08-28 23:50:41 +10:00
Drew DeVault
10c2c09cf6
Merge pull request #2513 from RyanDwyer/rename-root-outputs
Rename sway_root.outputs to sway_root.all_outputs
2018-08-26 10:50:02 -04:00
Ryan Dwyer
5dbbab7bdc Remove layout.c
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.
2018-08-26 12:05:16 +10:00
Ryan Dwyer
2e7401772e Rename sway_root.outputs to sway_root.all_outputs
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.
2018-08-25 23:41:11 +10:00
Ryan Dwyer
b6058703fa Refactor destroy functions and save workspaces when there's no outputs
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.
2018-08-24 22:17:28 +10:00
Ryan Dwyer
76bdb21ca9 Fix popup position when parent uses geometry
Fixes #2489.
2018-08-19 21:09:39 +10:00
Ryan Dwyer
2b5a404ac9 Replace hacky L_FLOATING container with a list
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
2018-08-19 16:18:33 +10:00
Drew DeVault
d0a24465d7
Merge pull request #2466 from RyanDwyer/geometry
Fix geometry
2018-08-18 19:26:36 -04:00
Ryan Dwyer
d6cd79c342 Implement iterators per container type
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-18 23:38:54 +10:00
Ryan Dwyer
b0a5f3a25f Store geometry in the view and handle any floating view resizing 2018-08-18 15:10:06 +10:00
Ryan Dwyer
982a2d0c99 Fix geometry 2018-08-18 10:39:38 +10:00
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
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
Ryan Dwyer
aaba7642b3 Replace is_floating boolean with function 2018-06-01 23:14:58 +10:00
Ryan Dwyer
34f35f0bad Use L_FLOATING instead of reapable boolean 2018-06-01 23:14:58 +10:00
Ryan Dwyer
1f2e399ade Implement floating 2018-06-01 23:14:58 +10:00
Drew DeVault
71db8de4be Render floating views 2018-06-01 23:14:58 +10:00
Brian Ashworth
205a1732cf Force fullscreen views to be fully opaque 2018-05-28 13:55:38 -04:00
Ryan Dwyer
f6c3682c05 Use constants for titlebar dimensions 2018-05-22 08:27:42 +10:00
Ryan Dwyer
664169fbf1 Implement stacked layout 2018-05-22 08:27:24 +10:00
Ryan Dwyer
048b29527b Pre-multiply alpha for tab decorations 2018-05-21 20:16:56 +10:00
Ryan Dwyer
90607dc329 Add left/right borders to tabs 2018-05-21 20:16:56 +10:00
Ryan Dwyer
5ab4930185 Fix tab border issues 2018-05-21 20:16:56 +10:00
Ryan Dwyer
efc07fb3d4 Don't track damage for views on inactive tabs 2018-05-21 20:16:56 +10:00
Ryan Dwyer
c08f9bf257 Implement tabbed layout 2018-05-21 20:16:56 +10:00
Brian Ashworth
750a497a8b Pre-multiply alpha for non-textures 2018-05-20 09:33:47 -04:00
Konstantin Pospelov
fcc11f9771 Fix pixel bar below title
This commit changes how the left and right indents are calculated for the
title bottom pixel bar, so that it is displayed properly in case the left or
right border is hidden.
2018-05-19 18:39:01 +03:00
Ryan Dwyer
f0212d66ee Update marks textures on output scale event 2018-05-17 08:29:14 +10:00
Ryan Dwyer
ebb0d051db Fix many border opacity issues 2018-05-17 08:29:14 +10:00
Ryan Dwyer
0e2cc0af30 Implement show_marks 2018-05-17 08:29:14 +10:00
emersion
79e970d86e
Correctly clip title texture if necessary 2018-05-15 08:38:28 +01:00
Brian Ashworth
9ba0dca7ba
Merge branch 'master' into fix-1975 2018-05-14 09:06:23 -04:00
Brian Ashworth
77b42ec821 Always render top border for border normal 2018-05-14 09:04:18 -04:00
emersion
95a10dd4f3
Kill wl_shell 2018-05-14 13:26:10 +01:00
Brian Ashworth
6ff7c52736 Fix titles and detect edges for hide_edge_borders 2018-05-14 00:20:34 -04:00
Brian Ashworth
2adf23c2a3 Only count views for hide_edge_borders smart 2018-05-12 12:56:26 -04:00
Brian Ashworth
e3625d8f33 Count descendant views for hide_edge_borders smart 2018-05-12 12:37:48 -04:00
Brian Ashworth
3db7fc2bb2 Implement hide_edge_borders 2018-05-11 18:44:56 -04:00
Ryan Dwyer
83e314bf51 Highlight all child borders when using focus parent 2018-05-11 09:20:46 +10:00
emersion
44fcc06efd
Fix damage tracking on HiDPI 2018-05-10 23:22:00 +01:00
emersion
90614f3a63
Accumulate surface damage even if whole=true 2018-05-10 23:03:51 +01:00
emersion
bec80f1551
Damage borders when damaging view 2018-05-10 23:03:50 +01:00
emersion
98f7ee8f59
Render borders with damage 2018-05-10 23:03:50 +01:00
emersion
c8a9ea3903
Implement full damage tracking 2018-05-10 23:02:37 +01:00
Ryan Dwyer
4922d269b8 Fix titles on rotated outputs
If the output is rotated, the scissor box needs to be transformed in the
opposite rotation.
2018-05-09 16:41:54 +10:00
Ryan Dwyer
e83e5487be Use scissor to render title texture
This allows the title's texture to always be the full width of the text,
and clipped at render time according to the desired width (eg. tabs...).

As an added bonus, the texture no longer needs to be updated when
containers are arranged.
2018-05-05 20:32:31 +10:00
Ryan Dwyer
b667298a0a Render titles 2018-05-03 15:12:00 +10:00
Ryan Dwyer
daab8e3503 Support alpha in border colours
The alpha component is merged with the container's opacity.

Completes #1882.
2018-05-02 08:40:38 +10:00
Ryan Dwyer
a19a511b90 Implement indicator border 2018-05-01 19:21:29 +10:00
Ryan Dwyer
d847ac1120 Scale borders according to output scale 2018-05-01 18:35:58 +10:00
Ryan Dwyer
e67f354333 Implement borders
Implements rendering of borders. Title text is still to do.

Implements the following configuration directives:

* client.focused
* client.focused_inactive
* client.unfocused
* client.urgent
* border
* default_border
2018-04-30 21:24:13 +10:00
Ryan Dwyer
167c2e1aa9 Refactor arrange_windows()
Replaces arrange_windows() with arrange_root(), arrange_output(),
arrange_workspace() and arrange_children_of().

Also makes fullscreen views save and restore their dimensions, which
allows it to preserve any custom resize and is also a requirement for
floating views once they are implemented.
2018-04-28 11:26:14 +10:00
Ryan Dwyer
4d2b3fc950 Render unmanaged xwayland views when an xwayland view is fullscreen
This makes Chromium and Firefox context menus appear when fullscreen.
2018-04-23 09:20:19 +10:00
Ryan Dwyer
6afccd07d9 Add TODO about rendering fullscreen views smaller than the output 2018-04-20 08:12:03 +10:00
Ryan Dwyer
bd67342bdc Don't render top layer when fullscreen. 2018-04-20 08:08:34 +10:00
Ryan Dwyer
9715e38ca8 render_output(): When fullscreen, clear to black and don't render background 2018-04-19 13:01:43 +10:00
Ryan Dwyer
8d06b222f0 Fullscreen rendering and input fixes.
* Render background when using fullscreen, because transparency.
* Check that fullscreen surface allows input.
* Don't look for surfaces in top layer if there's a fullscreen view.
2018-04-18 13:06:10 +10:00
Ryan Dwyer
35ccdd67a8 More fullscreen fixes.
* Render fullscreen views without wlr function, which makes popups and
lockscreen work.
* Don't allow input events to surfaces behind fullscreen views.
* Use correct output dimensions (for rotated outputs).
2018-04-18 08:35:28 +10:00
Ryan Dwyer
a44d016e2b Don't damage views if they're hidden by a fullscreen view. 2018-04-17 10:58:42 +10:00
Ryan Dwyer
c685ef081f Create sway_workspace struct. 2018-04-17 09:31:34 +10:00
Ryan Dwyer
bfd5834f4c Feedback for fullscreen. 2018-04-17 08:11:50 +10:00
Ryan Dwyer
52420cc24d Implement fullscreen. 2018-04-16 20:36:40 +10:00
Drew DeVault
b12b848bdc
Merge pull request #1759 from emersion/output-send-frame-done
Don't send frame done immediately when rendering
2018-04-07 12:23:26 -04:00
emersion
8af0c2b000
Don't send frame done immediately when rendering 2018-04-07 12:10:50 -04:00
emersion
33b4f945ab
Fix inverted assertion
Seems like it doesn't work this way
2018-04-07 12:03:13 -04:00
Drew DeVault
c47b4d4edb
Merge pull request #1756 from emersion/output-damage
Fine-grained damage tracking
2018-04-07 11:53:10 -04:00
emersion
0c627918bb
Damage all surfaces when damaging whole container 2018-04-06 15:59:50 -04:00
emersion
58914822aa
Don't damage the whole output 2018-04-06 14:17:58 -04:00
emersion
e550e22c0b
Refactor rendering code 2018-04-06 13:27:01 -04:00
Drew DeVault
603e0e42c5 Add debug tree view 2018-04-06 11:49:27 -04:00
emersion
516f5454ad
Simplify damage tracking functions, use them in layer shell 2018-04-06 11:45:40 -04:00
emersion
641807d920
Handle unmanaged surfaces motion 2018-04-05 18:48:35 -04:00
emersion
d65d001aa5
Fix desktop_damage_whole_surface 2018-04-05 18:38:50 -04:00
emersion
076bedb85e
Add container_damage_whole 2018-04-05 18:31:19 -04:00
emersion
1c91d0c10f
Add damage tracking for xwayland unmanaged surfaces 2018-04-05 17:39:17 -04:00
emersion
44b8d30f52 Use new wlr_*_surface_at functions 2018-04-04 22:03:14 -04:00
emersion
8eff00f723 Remove unused SWAY_VIEW_TYPES 2018-04-04 22:03:14 -04:00
Tony Crisci
fc9398a42e Implement opacity command 2018-04-04 21:57:05 -04:00
Tony Crisci
741e3959e3 Merge branch 'wlroots' into split-containers2 2018-04-04 00:20:44 -04:00
Tony Crisci
a001890fb8 move workspace create to workspace.c 2018-04-03 19:52:17 -04:00
emersion
c0554d23d3
Fix rendering with multiple outputs 2018-04-03 19:34:56 -04:00
Tony Crisci
481a8275c1 address feedback 2018-04-03 19:23:59 -04:00
Tony Crisci
cba258e16a move output code out of the tree 2018-04-03 12:40:11 -04:00
Tony Crisci
09d448ea2d unify container destroy functions 2018-04-03 12:34:01 -04:00
emersion
a4a241697a
Merge branch 'wlroots' into view-redesign 2018-04-02 15:30:58 -04:00
emersion
2f64ce86c4
Xwayland unmanaged views aren't views anymore 2018-04-02 14:35:43 -04:00
Tony Crisci
5e024278a6 Merge branch 'wlroots' into seat-fixes 2018-04-02 13:23:43 -04:00
Drew DeVault
b2d871cfe2 Partially implement move command
Works:

- move [container|window] to workspace <name>
    - Note, this should be able to move C_CONTAINER but this is untested
- move [workspace] to output [left|right|up|down|<name>]

Not implemented yet:

- move [left|right|up|down]
- move scratchpad
- move position
2018-04-02 11:12:18 -04:00
Tony Crisci
0828c77251 rename input-manager functions 2018-04-02 08:49:38 -04:00
Tony Crisci
e677c5b204 rename seat functions 2018-04-02 08:45:37 -04:00
emersion
b2c2ee693b
Introduce common functions to create, map, unmap, destroy views 2018-03-31 17:49:40 -04:00
emersion
98b67e2399
Fix xwayland configure in set_size 2018-03-31 11:30:15 -04:00
emersion
0f7936735c
Fix unmanaged views rendering on all outputs 2018-03-31 10:56:49 -04:00
emersion
3a68c012a9
Remove debug, add explicit TODO 2018-03-30 17:24:29 -04:00
emersion
50219564c2
Fix white screen due to bad cast 2018-03-30 17:16:35 -04:00
emersion
a776ecbb86
Add lite damage tracking
This skips the renderer if nothing has changed, and renders
everything otherwise.
2018-03-30 17:16:35 -04:00
emersion
981827ca42
Cleanup and remove global renderer reference 2018-03-30 00:49:27 -04:00
Drew DeVault
00d450e554 Use output coords for layer surfaces
This will need to be more carefully thought out when we get the
output_layout working entirely.
2018-03-30 00:16:18 -04:00
Drew DeVault
f26ecd9f58 Merge remote-tracking branch 'origin/wlroots' into swaybar-layers 2018-03-30 00:04:04 -04:00
Tony Crisci
8f490d7d2d Fix oversights from previous pull request 2018-03-29 23:53:38 -04:00
Tony Crisci
dc8c9fbeb6 Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"
This reverts commit 472e81f35d, reversing
changes made to 6b7841b11f.
2018-03-29 23:41:33 -04:00
Drew DeVault
d0c7f66e95
Revert "Refactor tree" 2018-03-29 23:29:29 -04:00
Drew DeVault
6b7841b11f
Merge pull request #1647 from acrisci/refactor-tree
Refactor tree
2018-03-29 23:19:14 -04:00
Tony Crisci
2778edef97 arrange windows 2018-03-29 23:15:39 -04:00
Drew DeVault
a76829f375 Some layer shell fixes
Based on the corresponding rootston changes
2018-03-29 22:11:08 -04:00
Scott Anderson
c8e7437b82 Clear buffer after beginning renderer 2018-03-30 14:38:14 +13:00
Tony Crisci
eca029f218 more renaming things 2018-03-29 17:06:29 -04:00
Tony Crisci
b90099b4b7 rename container functions 2018-03-29 16:40:40 -04:00
Tony Crisci
874f009866 move tree includes to their own directory 2018-03-29 14:21:42 -04:00
Drew DeVault
8d6bce02af Address review feedback 2018-03-28 18:11:03 -04:00
Drew DeVault
68cfa7ef67 Render layer surfaces and respect exclusive zone 2018-03-28 16:42:13 -04:00
Drew DeVault
0c8a64942e Add initial layer shell skeleton 2018-03-28 15:47:22 -04:00
Drew DeVault
cbb2e3308e Update API to match latest wlroots 2018-03-27 13:28:43 -04:00
emersion
01beee5826
Update wlroots API
Breaking changes in wlr_xdg_shell_v6 and wlr_renderer have been
made upstream.
2018-03-19 23:31:18 +01:00
emersion
1004915796
Update rendering code for wlroots matrix redesign 2018-03-15 21:22:34 +01:00
Drew DeVault
4b781356a4 Fix wlr_render_with_matrix call
This takes an alpha parameter now.
2018-02-26 19:04:57 -05:00
Drew DeVault
265378270a Revert "Multiple output coords by scale"
This reverts commit 94f8bdf081.
2018-02-25 17:55:49 -05:00
Drew DeVault
94f8bdf081 Multiple output coords by scale 2018-02-25 17:54:28 -05:00
Tony Crisci
23e9f5dc35 use wl_container_of() in output destroy callback 2018-02-20 19:21:32 -05:00
Tony Crisci
316effd7b1 make handle_output_destroy() static 2018-02-20 19:06:56 -05:00