xwayland: Set xwayland's name prop (#4924)

* set xwayland name

* [gha] Nix: update wlroots

* fix

---------

Co-authored-by: vaxerski <vaxerski@users.noreply.github.com>
This commit is contained in:
Vaxry 2024-03-09 16:47:57 +00:00 committed by GitHub
parent a01949dd28
commit e7a5db4852
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -233,4 +233,7 @@ inline std::map<std::string, xcb_atom_t> HYPRATOMS = {HYPRATOM("_NET_WM_WINDOW_T
HYPRATOM("_NET_WM_WINDOW_TYPE_POPUP_MENU"),
HYPRATOM("_NET_WM_WINDOW_TYPE_TOOLTIP"),
HYPRATOM("_NET_WM_WINDOW_TYPE_NOTIFICATION"),
HYPRATOM("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE")};
HYPRATOM("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE"),
HYPRATOM("_NET_SUPPORTING_WM_CHECK"),
HYPRATOM("_NET_WM_NAME"),
HYPRATOM("UTF8_STRING")};

View file

@ -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
}