summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2024-09-06 00:36:29 +0200
committerFurkan Sahin <furkan-dev@proton.me>2024-09-06 00:36:29 +0200
commit63fe592d7e0d9de54b8969f5dbdf2c985d5fd71f (patch)
treef0662aed32cf26a4e5fb0035cbef8f49f7d40e4a
parent499b50b4da54bd38c91a88b5359fbc8275c56381 (diff)
desktop/transaction: Deactivate workspace on inactive outputs
If the output is not active, it might not have a valid geometry to arrange for. Outputs do not gain a geometry until modeset, so if an output is connected with a configuration present to disable it, it will not have a geometry. If the output has a past workspace restored, this will be attemtped arranged to fit a 0x0 rectangle, which asserts when trying to sort out borders. Consider the workspace activated only if the output itself is active to get the scene nodes disabled. (cherry picked from commit 14bff7b451d865f16e3fc82279dfba314b11269c)
-rw-r--r--sway/desktop/transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 2ee5a5df..93118989 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -559,7 +559,7 @@ static void arrange_output(struct sway_output *output, int width, int height) {
for (int i = 0; i < output->current.workspaces->length; i++) {
struct sway_workspace *child = output->current.workspaces->items[i];
- bool activated = output->current.active_workspace == child;
+ bool activated = output->current.active_workspace == child && output->wlr_output->enabled;
wlr_scene_node_reparent(&child->layers.tiling->node, output->layers.tiling);
wlr_scene_node_reparent(&child->layers.fullscreen->node, output->layers.fullscreen);