diff options
| author | Jasson <Jasson.cordones@hotmail.com> | 2024-09-20 07:32:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-20 12:32:04 +0100 |
| commit | 4414cd07e257a57362e73d1f6efe1df692ae3762 (patch) | |
| tree | d1dce478c3d1acf803089fbd9f793edef03a2391 /src/xwayland/XSurface.cpp | |
| parent | 9e98fb0167f8bc6c5eb4510a65b42aaa3b743421 (diff) | |
xwm: Minor cleanup, add wrappers for basic types (#7856)
Diffstat (limited to 'src/xwayland/XSurface.cpp')
| -rw-r--r-- | src/xwayland/XSurface.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/xwayland/XSurface.cpp b/src/xwayland/XSurface.cpp index 02fe2b3b..e734c153 100644 --- a/src/xwayland/XSurface.cpp +++ b/src/xwayland/XSurface.cpp @@ -5,8 +5,8 @@ #ifndef NO_XWAYLAND -#include "../Compositor.hpp" #include <ranges> +#include "../Compositor.hpp" CXWaylandSurface::CXWaylandSurface(uint32_t xID_, CBox geometry_, bool OR) : xID(xID_), geometry(geometry_), overrideRedirect(OR) { xcb_res_query_client_ids_cookie_t client_id_cookie = {0}; @@ -196,12 +196,11 @@ void CXWaylandSurface::restackToTop() { xcb_configure_window(g_pXWayland->pWM->connection, xID, XCB_CONFIG_WINDOW_STACK_MODE, values); - for (auto it = g_pXWayland->pWM->mappedSurfacesStacking.begin(); it != g_pXWayland->pWM->mappedSurfacesStacking.end(); ++it) { - if (*it == self) { - std::rotate(it, it + 1, g_pXWayland->pWM->mappedSurfacesStacking.end()); - break; - } - } + auto& stack = g_pXWayland->pWM->mappedSurfacesStacking; + auto it = std::find(stack.begin(), stack.end(), self); + + if (it != stack.end()) + std::rotate(it, it + 1, stack.end()); g_pXWayland->pWM->updateClientList(); |
