Added window rules

This commit is contained in:
vaxerski
2022-03-24 18:22:01 +01:00
parent 8cec07c39d
commit ccbc0e4a2e
8 changed files with 178 additions and 11 deletions

View File

@@ -54,11 +54,7 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
if (pWindow->m_uSurface.xwayland) {
return std::string(pWindow->m_uSurface.xwayland->title);
}
} else {
return "";
}
if (pWindow->m_uSurface.xdg) {
} else if (pWindow->m_uSurface.xdg) {
if (pWindow->m_uSurface.xdg->toplevel) {
return std::string(pWindow->m_uSurface.xdg->toplevel->title);
}
@@ -72,6 +68,26 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
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->app_id);
}
} else {
return "";
}
} catch (std::logic_error& e) {
Debug::log(ERR, "Error in getAppIDClass: %s", e.what());
}
return "";
}
void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) {
if (pWindow->m_bIsX11) {
wlr_xwayland_surface_close(pWindow->m_uSurface.xwayland);

View File

@@ -14,6 +14,7 @@ public:
void activateSurface(wlr_surface*, bool);
void getGeometryForWindow(CWindow*, wlr_box*);
std::string getTitle(CWindow*);
std::string getAppIDClass(CWindow*);
void sendCloseWindow(CWindow*);
void setWindowSize(CWindow*, const Vector2D&);
void setWindowStyleTiled(CWindow*, uint32_t);