diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-24 18:22:01 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-24 18:22:01 +0100 |
| commit | ccbc0e4a2e4b1bcd9966b59edfbb0aaf6c27a52d (patch) | |
| tree | b4e80c8112416a408576d47ad7a7da2cfc4f66c9 /src/managers/XWaylandManager.cpp | |
| parent | 8cec07c39d17472a93c383683ca5c49f0119be77 (diff) | |
Added window rules
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
| -rw-r--r-- | src/managers/XWaylandManager.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index d17c1e5c..bbd8f9f0 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -54,19 +54,35 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) { if (pWindow->m_uSurface.xwayland) { return std::string(pWindow->m_uSurface.xwayland->title); } + } else if (pWindow->m_uSurface.xdg) { + if (pWindow->m_uSurface.xdg->toplevel) { + return std::string(pWindow->m_uSurface.xdg->toplevel->title); + } } else { return ""; } + } catch (std::logic_error& e) { + Debug::log(ERR, "Error in getTitle: %s", e.what()); + } - if (pWindow->m_uSurface.xdg) { + return ""; +} + +std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) { + try { + if (pWindow->m_bIsX11) { + if (pWindow->m_uSurface.xwayland) { + return std::string(pWindow->m_uSurface.xwayland->_class); + } + } else if (pWindow->m_uSurface.xdg) { if (pWindow->m_uSurface.xdg->toplevel) { - return std::string(pWindow->m_uSurface.xdg->toplevel->title); + return std::string(pWindow->m_uSurface.xdg->toplevel->app_id); } } else { return ""; } } catch (std::logic_error& e) { - Debug::log(ERR, "Error in getTitle: %s", e.what()); + Debug::log(ERR, "Error in getAppIDClass: %s", e.what()); } return ""; |
