From 75fe5f6965d258614b33ac2879779385f4b51657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 11 Sep 2013 08:39:17 +0200 Subject: [PATCH] Port Client::firstInTabBox to XCB That code needs testing with Plasma Active. --- client.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/client.cpp b/client.cpp index d648256773..7f8143bc59 100644 --- a/client.cpp +++ b/client.cpp @@ -2414,19 +2414,15 @@ KDecorationDefines::Position Client::titlebarPosition() void Client::updateFirstInTabBox() { // TODO: move into KWindowInfo - Atom type; - int format, status; - unsigned long nitems = 0; - unsigned long extra = 0; - unsigned char *data = 0; - status = XGetWindowProperty(display(), window(), atoms->kde_first_in_window_list, 0, 1, false, atoms->kde_first_in_window_list, &type, &format, &nitems, &extra, &data); - if (status == Success && format == 32 && nitems == 1) { + xcb_connection_t *c = connection(); + const auto cookie = xcb_get_property_unchecked(c, false, m_client, atoms->kde_first_in_window_list, + atoms->kde_first_in_window_list, 0, 1); + ScopedCPointer prop(xcb_get_property_reply(c, cookie, nullptr)); + if (!prop.isNull() && prop->format == 32 && prop->value_len == 1) { setFirstInTabBox(true); } else { setFirstInTabBox(false); } - if (data) - XFree(data); } bool Client::isClient() const