Skip to content

Commit

Permalink
xwayland: fix setting title prop (hyprwm#6809)
Browse files Browse the repository at this point in the history
* fix setting xwayland title prop

* add window title types
  • Loading branch information
ikalco authored and DawfukFR committed Jul 12, 2024
1 parent 74115c1 commit 7370288
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/xwayland/XWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
std::string propName = "?";
std::string propName = std::format("{}?", atom);
for (auto& ha : HYPRATOMS) {
if (ha.second != atom)
continue;
Expand All @@ -172,8 +172,10 @@ void CXWM::readProp(SP<CXWaylandSurface> XSURF, uint32_t atom, xcb_get_property_
XSURF->state.appid.pop_back();
XSURF->events.metadataChanged.emit();
} else if (atom == XCB_ATOM_WM_NAME || atom == HYPRATOMS["_NET_WM_NAME"]) {
size_t len = xcb_get_property_value_length(reply);
char* string = (char*)xcb_get_property_value(reply);
size_t len = xcb_get_property_value_length(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->events.metadataChanged.emit();
} else if (atom == HYPRATOMS["_NET_WM_WINDOW_TYPE"]) {
Expand Down Expand Up @@ -520,7 +522,7 @@ bool CXWM::handleSelectionPropertyNotify(xcb_property_notify_event_t* e) {

// Debug::log(ERR, "[xwm] FIXME: CXWM::handleSelectionPropertyNotify stub");

return true;
return false;
}

void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) {
Expand Down

0 comments on commit 7370288

Please sign in to comment.