sway/workspaces: use X11 class for XWayland windows
When using `window-rewrite`, the `class<>` rule would previously only match against the `app_id` of a window. However, XWayland windows don't have an app ID. This change falls back to checking the `class` window property if there is no app ID to support matching against XWayland windows.
This commit is contained in:
@ -260,7 +260,9 @@ void Workspaces::updateWindows(const Json::Value &node, std::string &windows) {
|
||||
if ((node["type"].asString() == "con" || node["type"].asString() == "floating_con") &&
|
||||
node["name"].isString()) {
|
||||
std::string title = g_markup_escape_text(node["name"].asString().c_str(), -1);
|
||||
std::string windowClass = node["app_id"].asString();
|
||||
std::string windowClass = node["app_id"].isString()
|
||||
? node["app_id"].asString()
|
||||
: node["window_properties"]["class"].asString();
|
||||
|
||||
// Only add window rewrites that can be looked up
|
||||
if (!windowClass.empty()) {
|
||||
|
Reference in New Issue
Block a user