revert bullshit windows, apparently some apps create those...

This commit is contained in:
vaxerski 2021-11-24 19:24:56 +01:00
parent a7f53b5dfa
commit 36b89e7152

View file

@ -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));