aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sway/tree/container.h6
-rw-r--r--sway/tree/container.c3
-rw-r--r--sway/tree/view.c6
3 files changed, 11 insertions, 4 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index e0cda17c..cd886cd0 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -351,6 +351,12 @@ bool container_is_floating_or_child(struct sway_container *container);
351 */ 351 */
352bool container_is_fullscreen_or_child(struct sway_container *container); 352bool container_is_fullscreen_or_child(struct sway_container *container);
353 353
354/**
355 * Return the output which will be used for scale purposes.
356 * This is the most recently entered output.
357 */
358struct sway_output *container_get_effective_output(struct sway_container *con);
359
354void container_discover_outputs(struct sway_container *con); 360void container_discover_outputs(struct sway_container *con);
355 361
356#endif 362#endif
diff --git a/sway/tree/container.c b/sway/tree/container.c
index b932925d..6ea0cc94 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -764,8 +764,7 @@ void container_damage_whole(struct sway_container *container) {
764 * Return the output which will be used for scale purposes. 764 * Return the output which will be used for scale purposes.
765 * This is the most recently entered output. 765 * This is the most recently entered output.
766 */ 766 */
767static struct sway_output *container_get_effective_output( 767struct sway_output *container_get_effective_output(struct sway_container *con) {
768 struct sway_container *con) {
769 if (con->outputs->length == 0) { 768 if (con->outputs->length == 0) {
770 return NULL; 769 return NULL;
771 } 770 }
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 4abf1abb..2c0c1aa9 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -889,8 +889,10 @@ void view_add_mark(struct sway_view *view, char *mark) {
889 889
890static void update_marks_texture(struct sway_view *view, 890static void update_marks_texture(struct sway_view *view,
891 struct wlr_texture **texture, struct border_colors *class) { 891 struct wlr_texture **texture, struct border_colors *class) {
892 struct sway_output *output = 892 struct sway_output *output = container_get_effective_output(view->swayc);
893 view->swayc->outputs->items[view->swayc->outputs->length - 1]; 893 if (!output) {
894 return;
895 }
894 if (*texture) { 896 if (*texture) {
895 wlr_texture_destroy(*texture); 897 wlr_texture_destroy(*texture);
896 *texture = NULL; 898 *texture = NULL;