mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:25:58 +01:00
xwayland: fix setting title prop (#6809)
* fix setting xwayland title prop * add window title types
This commit is contained in:
parent
648f824b9e
commit
b03f41efec
1 changed files with 6 additions and 4 deletions
|
@ -153,7 +153,7 @@ static bool lookupParentExists(SP<CXWaylandSurface> XSURF, SP<CXWaylandSurface>
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXWM::readProp(SP<CXWaylandSurface> XSURF, uint32_t atom, xcb_get_property_reply_t* reply) {
|
void CXWM::readProp(SP<CXWaylandSurface> XSURF, uint32_t atom, xcb_get_property_reply_t* reply) {
|
||||||
std::string propName = "?";
|
std::string propName = std::format("{}?", atom);
|
||||||
for (auto& ha : HYPRATOMS) {
|
for (auto& ha : HYPRATOMS) {
|
||||||
if (ha.second != atom)
|
if (ha.second != atom)
|
||||||
continue;
|
continue;
|
||||||
|
@ -174,6 +174,8 @@ void CXWM::readProp(SP<CXWaylandSurface> XSURF, uint32_t atom, xcb_get_property_
|
||||||
} else if (atom == XCB_ATOM_WM_NAME || atom == HYPRATOMS["_NET_WM_NAME"]) {
|
} else if (atom == XCB_ATOM_WM_NAME || atom == HYPRATOMS["_NET_WM_NAME"]) {
|
||||||
size_t len = xcb_get_property_value_length(reply);
|
size_t len = xcb_get_property_value_length(reply);
|
||||||
char* string = (char*)xcb_get_property_value(reply);
|
char* string = (char*)xcb_get_property_value(reply);
|
||||||
|
if (reply->type != HYPRATOMS["UTF8_STRING"] && reply->type != HYPRATOMS["TEXT"] && reply->type != XCB_ATOM_STRING)
|
||||||
|
return;
|
||||||
XSURF->state.title = std::string{string, len};
|
XSURF->state.title = std::string{string, len};
|
||||||
XSURF->events.metadataChanged.emit();
|
XSURF->events.metadataChanged.emit();
|
||||||
} else if (atom == HYPRATOMS["_NET_WM_WINDOW_TYPE"]) {
|
} else if (atom == HYPRATOMS["_NET_WM_WINDOW_TYPE"]) {
|
||||||
|
@ -520,7 +522,7 @@ bool CXWM::handleSelectionPropertyNotify(xcb_property_notify_event_t* e) {
|
||||||
|
|
||||||
// Debug::log(ERR, "[xwm] FIXME: CXWM::handleSelectionPropertyNotify stub");
|
// Debug::log(ERR, "[xwm] FIXME: CXWM::handleSelectionPropertyNotify stub");
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) {
|
void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) {
|
||||||
|
|
Loading…
Reference in a new issue