From 6124525439883d0bf5761ee5792f3c545dd928c6 Mon Sep 17 00:00:00 2001 From: Oskari Alaranta Date: Thu, 12 Feb 2026 02:37:12 +0200 Subject: [PATCH] Store per window depths --- xbanan/Base.cpp | 6 ++++-- xbanan/Definitions.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xbanan/Base.cpp b/xbanan/Base.cpp index fe5dde5..b0bb76e 100644 --- a/xbanan/Base.cpp +++ b/xbanan/Base.cpp @@ -1193,12 +1193,13 @@ BAN::ErrorOr handle_packet(Client& client_info, BAN::ConstByteSpan packet) { case Object::Type::Window: { - auto& texture = object.object.get().texture(); + auto& window = object.object.get(); + auto& texture = window.texture(); info.data = { reinterpret_cast(texture.pixels().data()), texture.pixels().size() * 4 }; info.w = texture.width(); info.h = texture.height(); - info.depth = 32; + info.depth = window.depth; break; } @@ -1329,6 +1330,7 @@ BAN::ErrorOr handle_packet(Client& client_info, BAN::ConstByteSpan packet) TRY(BAN::UniqPtr::create(Object { .type = Object::Type::Window, .object = Object::Window { + .depth = request.depth, .x = request.x, .y = request.y, .event_mask = event_mask, diff --git a/xbanan/Definitions.h b/xbanan/Definitions.h index 9eb0402..d6bc34c 100644 --- a/xbanan/Definitions.h +++ b/xbanan/Definitions.h @@ -58,6 +58,7 @@ struct Object { bool mapped { false }; bool focused { false }; + uint8_t depth { 0 }; int32_t x { 0 }; int32_t y { 0 }; int32_t cursor_x { -1 };