diff --git a/src/events/events.cpp b/src/events/events.cpp index efcd4e7..14059e7 100644 --- a/src/events/events.cpp +++ b/src/events/events.cpp @@ -100,19 +100,6 @@ CWindow* Events::remapFloatingWindow(int windowID) { CWindow* Events::remapWindow(int windowID, bool wasfloating) { // Do the setup of the window's params and stuf - - // For all floating windows, get their default size - const auto GEOMETRYCOOKIE = xcb_get_geometry(g_pWindowManager->DisplayConnection, windowID); - const auto GEOMETRY = xcb_get_geometry_reply(g_pWindowManager->DisplayConnection, GEOMETRYCOOKIE, 0); - - if (GEOMETRY) { - // Check if the window isn't bullshit. - if (GEOMETRY->width < 2 || GEOMETRY->height < 2) { - // Bullshit window. set to floating. - return Events::remapFloatingWindow(windowID); - } - } - CWindow window; window.setDrawable(windowID); window.setIsFloating(false); @@ -125,6 +112,10 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating) { window.setWorkspaceID(g_pWindowManager->activeWorkspaces[CURRENTSCREEN]); window.setMonitor(CURRENTSCREEN); + // For all floating windows, get their default size + const auto GEOMETRYCOOKIE = xcb_get_geometry(g_pWindowManager->DisplayConnection, windowID); + const auto GEOMETRY = xcb_get_geometry_reply(g_pWindowManager->DisplayConnection, GEOMETRYCOOKIE, 0); + if (GEOMETRY) { window.setDefaultPosition(Vector2D(GEOMETRY->x, GEOMETRY->y)); window.setDefaultSize(Vector2D(GEOMETRY->width, GEOMETRY->height));