From 09e442ff43c15939d44a0ecbb26f9daf5229cf69 Mon Sep 17 00:00:00 2001 From: Oskari Alaranta Date: Mon, 9 Feb 2026 03:44:45 +0200 Subject: [PATCH] Support Pixmaps with GetGeometry --- xbanan/main.cpp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/xbanan/main.cpp b/xbanan/main.cpp index b726ea3..b856edf 100644 --- a/xbanan/main.cpp +++ b/xbanan/main.cpp @@ -1807,31 +1807,51 @@ BAN::ErrorOr handle_packet(Client& client_info, BAN::ConstByteSpan packet) dprintln("GetGeometry"); dprintln(" drawable: {}", drawable); - const auto& object = *client_info.objects[drawable]; - ASSERT(object.type == Object::Type::Window); + auto& object = *client_info.objects[drawable]; + INT16 x, y; CARD16 width, height; + CARD8 depth; if (drawable == root.windowId) { width = root.pixWidth; height = root.pixHeight; + depth = root.rootDepth; + x = 0; + y = 0; + } + else if (object.type == Object::Type::Window) + { + const auto& window = object.object.get(); + width = window.texture().width(); + height = window.texture().height(); + depth = 32; + x = window.x; + y = window.y; + } + else if (object.type == Object::Type::Pixmap) + { + const auto& pixmap = object.object.get(); + width = pixmap.width; + height = pixmap.height; + depth = pixmap.depth; + x = 0; + y = 0; } else { - const auto& texture = object.object.get().texture(); - width = texture.width(); - height = texture.height(); + ASSERT_NOT_REACHED(); } xGetGeometryReply reply { .type = X_Reply, - .depth = 32, + .depth = depth, .sequenceNumber = client_info.sequence, .length = 0, .root = root.windowId, - .x = 0, - .y = 0, + .x = x, + .y = y, .width = width, .height = height, .borderWidth = 0,