From 3e2785b9707348e918b61491bee5f69c43be9a66 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 19 Dec 2022 23:43:47 +0000 Subject: [PATCH] fix restack in xwayland stubs --- src/helpers/XWaylandStubs.hpp | 28 ++++++++++++++-------------- src/managers/XWaylandManager.cpp | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/helpers/XWaylandStubs.hpp b/src/helpers/XWaylandStubs.hpp index 256709c7..187f082b 100644 --- a/src/helpers/XWaylandStubs.hpp +++ b/src/helpers/XWaylandStubs.hpp @@ -8,21 +8,21 @@ typedef struct { /** User specified flags */ uint32_t flags; /** User-specified position */ - int32_t x, y; + int32_t x, y; /** User-specified size */ - int32_t width, height; + int32_t width, height; /** Program-specified minimum size */ - int32_t min_width, min_height; + int32_t min_width, min_height; /** Program-specified maximum size */ - int32_t max_width, max_height; + int32_t max_width, max_height; /** Program-specified resize increments */ - int32_t width_inc, height_inc; + int32_t width_inc, height_inc; /** Program-specified minimum aspect ratios */ - int32_t min_aspect_num, min_aspect_den; + int32_t min_aspect_num, min_aspect_den; /** Program-specified maximum aspect ratios */ - int32_t max_aspect_num, max_aspect_den; + int32_t max_aspect_num, max_aspect_den; /** Program-specified base size */ - int32_t base_width, base_height; + int32_t base_width, base_height; /** Program-specified window gravity */ uint32_t win_gravity; } xcb_size_hints_t; @@ -93,12 +93,12 @@ struct wlr_xwayland_surface { struct wl_event_source* ping_timer; // _NET_WM_STATE - bool modal; - bool fullscreen; - bool maximized_vert, maximized_horz; - bool minimized; + bool modal; + bool fullscreen; + bool maximized_vert, maximized_horz; + bool minimized; - bool has_alpha; + bool has_alpha; struct { struct wl_signal destroy; @@ -149,7 +149,7 @@ inline bool wlr_surface_is_xwayland_surface(void*) { inline void wlr_xwayland_surface_activate(wlr_xwayland_surface*, bool) {} -inline void wlr_xwayland_surface_restack(wlr_xwayland_surface*, int, xcb_stack_mode_t) {} +inline void wlr_xwayland_surface_restack(wlr_xwayland_surface*, void*, xcb_stack_mode_t) {} inline wlr_xwayland_surface* wlr_xwayland_surface_from_wlr_surface(void*) { return nullptr; diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index ed56ebf1..50be350b 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -44,7 +44,7 @@ void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate) wlr_xwayland_surface_activate(wlr_xwayland_surface_from_wlr_surface(pSurface), activate); if (activate) - wlr_xwayland_surface_restack(wlr_xwayland_surface_from_wlr_surface(pSurface), NULL, XCB_STACK_MODE_ABOVE); + wlr_xwayland_surface_restack(wlr_xwayland_surface_from_wlr_surface(pSurface), nullptr, XCB_STACK_MODE_ABOVE); } } @@ -53,7 +53,7 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) { if (activate) { wlr_xwayland_surface_set_minimized(pWindow->m_uSurface.xwayland, false); - wlr_xwayland_surface_restack(pWindow->m_uSurface.xwayland, NULL, XCB_STACK_MODE_ABOVE); + wlr_xwayland_surface_restack(pWindow->m_uSurface.xwayland, nullptr, XCB_STACK_MODE_ABOVE); } wlr_xwayland_surface_activate(pWindow->m_uSurface.xwayland, activate); @@ -175,7 +175,7 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) { pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DOCK"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_MENU"]) { - + if (pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_MENU"]) pWindow->m_bX11ShouldntFocus = true;