diff --git a/native/os_x11_linux.cc b/native/os_x11_linux.cc index 8791d71..9cefad2 100644 --- a/native/os_x11_linux.cc +++ b/native/os_x11_linux.cc @@ -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 reply { xcb_get_property_reply(connection, cookie, NULL), &free }; + if(reply) { + char* title = reinterpret_cast(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; + } + } } + } } }