aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xwayland
diff options
context:
space:
mode:
authorIkalco <[email protected]>2024-07-08 10:46:42 -0500
committerGitHub <[email protected]>2024-07-08 17:46:42 +0200
commitb03f41efec14273cf25c42d4cef326acc36cb319 (patch)
tree0549b180a04e91d7caabdaa0a2d462b9e1024db7 /src/xwayland
parent648f824b9e9ba58cc49962b0c58fc90892da2bda (diff)
downloadHyprland-b03f41efec14273cf25c42d4cef326acc36cb319.tar.gz
Hyprland-b03f41efec14273cf25c42d4cef326acc36cb319.zip
xwayland: fix setting title prop (#6809)
* fix setting xwayland title prop * add window title types
Diffstat (limited to 'src/xwayland')
-rw-r--r--src/xwayland/XWM.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp
index aa38910f..b34d0cfe 100644
--- a/src/xwayland/XWM.cpp
+++ b/src/xwayland/XWM.cpp
@@ -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;
@@ -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"]) {
@@ -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) {