Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions native/os_x11_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,25 @@ bool IsRsWindow(const xcb_window_t window) {
memcpy(buffer, xcb_get_property_value(replyProp), len);
// first is instance name, then class name - both null terminated. we want class name.
const char* classname = buffer + strlen(buffer) + 1;
if (strcmp(classname, "RuneScape") == 0 || strcmp(classname, "steam_app_1343400") == 0 || strcmp(classname, "rs2client.exe") == 0) {
if (strcmp(classname, "RuneScape") == 0 || strcmp(classname, "steam_app_1343400") == 0 || strcmp(classname, "steam_proton") == 0 || strcmp(classname, "rs2client.exe") == 0) {
auto replyTransient = xcb_get_property_reply(connection, cookieTransient, NULL);
if (replyTransient && xcb_get_property_value_length(replyTransient) == 0) {
free(replyProp);
return true;
xcb_get_property_cookie_t cookie = xcb_get_property_unchecked(connection, 0, window, XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 0, 100);
std::unique_ptr<xcb_get_property_reply_t, decltype(&free)> reply { xcb_get_property_reply(connection, cookie, NULL), &free };
if(reply) {
char* title = reinterpret_cast<char*>(xcb_get_property_value(reply.get()));
int length = xcb_get_property_value_length(reply.get());
auto str_title = std::string(title, length);
/* Covers both normal and compatibility mode (substring of RuneScape (compatibility mode) )*/
if (str_title.compare(0, sizeof("RuneScape") - 1, "RuneScape") == 0) {
if (replyTransient && xcb_get_property_value_length(replyTransient) == 0) {
free(replyProp);
return true;
} else {
std::cout << "NonTransient window found: " << str_title << std::endl;
}
}
}

}
}
}
Expand Down