summaryrefslogtreecommitdiff
path: root/src/events/Misc.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-03-09 16:47:57 +0000
committerGitHub <noreply@github.com>2024-03-09 16:47:57 +0000
commite7a5db4852d654596e554b9cdeaa2694b346ee03 (patch)
treee29856856e7c1bfe3c698bdd5224de82887c928f /src/events/Misc.cpp
parenta01949dd286ba67f8026aeec38b44b61e20be412 (diff)
xwayland: Set xwayland's name prop (#4924)
* set xwayland name * [gha] Nix: update wlroots * fix --------- Co-authored-by: vaxerski <vaxerski@users.noreply.github.com>
Diffstat (limited to 'src/events/Misc.cpp')
-rw-r--r--src/events/Misc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp
index 0ee95ac3..64f2f29d 100644
--- a/src/events/Misc.cpp
+++ b/src/events/Misc.cpp
@@ -63,6 +63,8 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
}
ATOM.second = reply->atom;
+
+ free(reply);
}
wlr_xwayland_set_seat(g_pXWaylandManager->m_sWLRXWayland, g_pCompositor->m_sSeat.seat);
@@ -73,6 +75,19 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
XCURSOR->images[0]->height, XCURSOR->images[0]->hotspot_x, XCURSOR->images[0]->hotspot_y);
}
+ const auto ROOT = xcb_setup_roots_iterator(xcb_get_setup(XCBCONNECTION)).data->root;
+ auto cookie = xcb_get_property(XCBCONNECTION, 0, ROOT, HYPRATOMS["_NET_SUPPORTING_WM_CHECK"], XCB_ATOM_ANY, 0, 2048);
+ auto reply = xcb_get_property_reply(XCBCONNECTION, cookie, nullptr);
+
+ const auto XWMWINDOW = *(xcb_window_t*)xcb_get_property_value(reply);
+ const char* name = "Hyprland";
+
+ xcb_change_property(wlr_xwayland_get_xwm_connection(g_pXWaylandManager->m_sWLRXWayland), XCB_PROP_MODE_REPLACE, XWMWINDOW, HYPRATOMS["_NET_WM_NAME"], HYPRATOMS["UTF8_STRING"],
+ 8, // format
+ strlen(name), name);
+
+ free(reply);
+
xcb_disconnect(XCBCONNECTION);
#endif
}