summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-06-18 18:14:48 +0200
committervaxerski <vaxry@vaxry.net>2023-06-18 18:14:52 +0200
commit2295bbdd80b48f580977fc80e9643841fbc9a496 (patch)
treed79d6ca91b632372d810b1031d562fee65174207 /src/managers/XWaylandManager.cpp
parent74ca81cc7942aa93e796ca794185675bae57003d (diff)
xwaylandmanager: fixup style
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r--src/managers/XWaylandManager.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 1801247d..c50d2b0d 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -36,10 +36,9 @@ void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate)
return;
if (wlr_xdg_surface_try_from_wlr_surface(pSurface)) {
- const auto PSURF = wlr_xdg_surface_try_from_wlr_surface(pSurface);
- if (PSURF && PSURF->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
+ if (const auto PSURF = wlr_xdg_surface_try_from_wlr_surface(pSurface); PSURF && PSURF->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
wlr_xdg_toplevel_set_activated(PSURF->toplevel, activate);
- }
+
} else if (wlr_xwayland_surface_try_from_wlr_surface(pSurface)) {
wlr_xwayland_surface_activate(wlr_xwayland_surface_try_from_wlr_surface(pSurface), activate);
@@ -84,9 +83,8 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
pbox->width = pWindow->m_uSurface.xwayland->width;
pbox->height = pWindow->m_uSurface.xwayland->height;
}
- } else {
+ } else
wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, pbox);
- }
}
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
@@ -123,20 +121,18 @@ std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
if (pWindow->m_uSurface.xdg->toplevel && pWindow->m_uSurface.xdg->toplevel->app_id) {
return std::string(pWindow->m_uSurface.xdg->toplevel->app_id);
}
- } else {
+ } 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) {
+ if (pWindow->m_bIsX11)
wlr_xwayland_surface_close(pWindow->m_uSurface.xwayland);
- } else {
+ else
wlr_xdg_toplevel_send_close(pWindow->m_uSurface.xdg->toplevel);
- }
}
void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool force) {
@@ -215,9 +211,8 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) {
return true;
}
- if (pWindow->m_iX11Type == 2) {
+ if (pWindow->m_iX11Type == 2)
return true; // override_redirect
- }
const auto SIZEHINTS = pWindow->m_uSurface.xwayland->size_hints;
if (SIZEHINTS && (pWindow->m_uSurface.xwayland->parent || ((SIZEHINTS->min_width == SIZEHINTS->max_width) && (SIZEHINTS->min_height == SIZEHINTS->max_height))))
@@ -237,9 +232,10 @@ void CHyprXWaylandManager::moveXWaylandWindow(CWindow* pWindow, const Vector2D&
if (!g_pCompositor->windowValidMapped(pWindow))
return;
- if (pWindow->m_bIsX11) {
- wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, pWindow->m_vRealSize.vec().x, pWindow->m_vRealSize.vec().y);
- }
+ if (!pWindow->m_bIsX11)
+ return;
+
+ wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, pWindow->m_vRealSize.vec().x, pWindow->m_vRealSize.vec().y);
}
void CHyprXWaylandManager::checkBorders(CWindow* pWindow) {
@@ -266,11 +262,10 @@ void CHyprXWaylandManager::checkBorders(CWindow* pWindow) {
}
void CHyprXWaylandManager::setWindowFullscreen(CWindow* pWindow, bool fullscreen) {
- if (pWindow->m_bIsX11) {
+ if (pWindow->m_bIsX11)
wlr_xwayland_surface_set_fullscreen(pWindow->m_uSurface.xwayland, fullscreen);
- } else {
+ else
wlr_xdg_toplevel_set_fullscreen(pWindow->m_uSurface.xdg->toplevel, fullscreen);
- }
if (pWindow->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_fullscreen(pWindow->m_phForeignToplevel, fullscreen);