aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree/container.h
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 11:01:51 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-20 09:23:24 +1000
commit0f6d212629964c6a131b5675fa6c9f4d48da43aa (patch)
tree2dec4ff1e44ede939eb01927425c5da61e41ab5e /include/sway/tree/container.h
parentMerge pull request #2493 from RyanDwyer/fix-popup-position (diff)
downloadsway-0f6d212629964c6a131b5675fa6c9f4d48da43aa.tar.gz
sway-0f6d212629964c6a131b5675fa6c9f4d48da43aa.tar.zst
sway-0f6d212629964c6a131b5675fa6c9f4d48da43aa.zip
Send output enter/leave events correctly
Previously we used a reparent event to detect when a view changes parent, then sent an output enter/leave to the surfaces if needed. This worked for tiling views but not floating views, as floating views can intersect another output without changing parent. The solution implemented for floating views also applies cleanly to tiling views, so the previous method has been completely replaced and the reparent event has been removed. This introduces a new function container_discover_outputs. This function compares the container's `current` position to the outputs, sends enter and leave events as needed, and keeps track of which outputs it's intersecting in a new `container->outputs` list. If it has entered a new output with a different scale then the title and marks textures will also be recreated at the new scale. The function is called when a transaction applies. This is convenient as it means we don't have to call it from various places. There is imperfect rendering when a floating view overlaps two outputs with different scales. It renders correctly for the most recently entered output, but there is only one title texture so it renders incorrectly on the old output. Fixes #2482
Diffstat (limited to 'include/sway/tree/container.h')
-rw-r--r--include/sway/tree/container.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 5eccedc1..e0cda17c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -138,6 +138,9 @@ struct sway_container {
138 138
139 struct sway_container *parent; 139 struct sway_container *parent;
140 140
141 // Outputs currently being intersected
142 list_t *outputs; // struct sway_output
143
141 // Indicates that the container is a scratchpad container. 144 // Indicates that the container is a scratchpad container.
142 // Both hidden and visible scratchpad containers have scratchpad=true. 145 // Both hidden and visible scratchpad containers have scratchpad=true.
143 // Hidden scratchpad containers have a NULL parent. 146 // Hidden scratchpad containers have a NULL parent.
@@ -166,12 +169,7 @@ struct sway_container {
166 169
167 struct { 170 struct {
168 struct wl_signal destroy; 171 struct wl_signal destroy;
169 // Raised after the tree updates, but before arrange_windows
170 // Passed the previous parent
171 struct wl_signal reparent;
172 } events; 172 } events;
173
174 struct wl_listener reparent;
175}; 173};
176 174
177struct sway_container *container_create(enum sway_container_type type); 175struct sway_container *container_create(enum sway_container_type type);
@@ -353,4 +351,6 @@ bool container_is_floating_or_child(struct sway_container *container);
353 */ 351 */
354bool container_is_fullscreen_or_child(struct sway_container *container); 352bool container_is_fullscreen_or_child(struct sway_container *container);
355 353
354void container_discover_outputs(struct sway_container *con);
355
356#endif 356#endif