From 9a1046caedce8f0adf366147c735916aba2c2f84 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 6 Mar 2017 23:21:19 -0800 Subject: Add support for populating the "Name" property within the NativeWindowSystem class (associated with the much more static "class" name from X11 - use the Title/ShortTitle properties for the ones that change regularly). --- src-qt5/core/libLumina/NativeWindowSystem.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src-qt5/core/libLumina/NativeWindowSystem.cpp') diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp index d7c95fb8..5b56a131 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.cpp +++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp @@ -376,6 +376,16 @@ void NativeWindowSystem::UpdateWindowProperties(NativeWindow* win, QList< Native } } //end of geometry properties + if(props.contains(NativeWindow::Name)){ + //Put the app/class name here (much more static than the "Title" properties + xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_class_unchecked(QX11Info::connection(), win->id()); + xcb_icccm_get_wm_class_reply_t reply; + if(1 == xcb_icccm_get_wm_class_reply(QX11Info::connection(), cookie, &reply, NULL) ){ + //Returns: "::::" + win->setProperty(NativeWindow::Name, ( QString::fromLocal8Bit(reply.instance_name)+"::::"+QString::fromLocal8Bit(reply.class_name) )); + xcb_icccm_get_wm_class_reply_wipe(&reply); + } + } } -- cgit