Revert "give bullshit windows 500ms to unbullshit themselves before unmanaging"

This reverts commit e886d957d9.
This commit is contained in:
vaxerski 2022-01-09 15:13:17 +01:00
parent 154cf2ff01
commit 95d0e67f5c
5 changed files with 14 additions and 27 deletions

View file

@ -175,6 +175,11 @@ CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
return nullptr; return nullptr;
} }
if (PWINDOWINARR->getClassName() == "") {
Debug::log(WARN, "remapFloatingWindow with Error, not managing.");
return nullptr;
}
PWINDOWINARR->setIsFloating(true); PWINDOWINARR->setIsFloating(true);
PWINDOWINARR->setDirty(true); PWINDOWINARR->setDirty(true);
@ -416,6 +421,12 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating, int forcemonitor) {
return nullptr; return nullptr;
} }
if (PWINDOWINARR->getClassName() == "Error") {
Debug::log(LOG, "Class error -> we wont manage this.");
return nullptr;
}
PWINDOWINARR->setIsFloating(false); PWINDOWINARR->setIsFloating(false);
PWINDOWINARR->setDirty(true); PWINDOWINARR->setDirty(true);
@ -624,8 +635,8 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
} }
} }
if (!pNewWindow) { if (!pNewWindow || pNewWindow->getClassName() == "") {
Debug::log(LOG, "Removing, NULLPTR."); Debug::log(LOG, "Removing, NULL.");
g_pWindowManager->removeWindowFromVectorSafe(E->window); g_pWindowManager->removeWindowFromVectorSafe(E->window);
return; return;
} }

View file

@ -1,8 +1,7 @@
#include "window.hpp" #include "window.hpp"
#include "windowManager.hpp" #include "windowManager.hpp"
CWindow::CWindow() { this->setRealBorderColor(0); this->setEffectiveBorderColor(0); this->setFirstOpen(true); this->setConstructed(false); this->setTransient(false); this->setLastUpdatePosition(Vector2D(0,0)); this->setLastUpdateSize(Vector2D(0,0)); this->setDock(false); this->setUnderFullscreen(false); this->setIsSleeping(true); this->setFirstAnimFrame(true); this->setIsAnimated(false); this->setDead(false); this->setMasterChildIndex(0); this->setMaster(false); this->setCanKill(false); this->setImmovable(false); this->setNoInterventions(false); this->setDirty(true); this->setFullscreen(false); this->setIsFloating(false); this->setParentNodeID(0); this->setChildNodeAID(0); this->setChildNodeBID(0); this->setName(""); CWindow::CWindow() { this->setRealBorderColor(0); this->setEffectiveBorderColor(0); this->setFirstOpen(true); this->setConstructed(false); this->setTransient(false); this->setLastUpdatePosition(Vector2D(0,0)); this->setLastUpdateSize(Vector2D(0,0)); this->setDock(false); this->setUnderFullscreen(false); this->setIsSleeping(true); this->setFirstAnimFrame(true); this->setIsAnimated(false); this->setDead(false); this->setMasterChildIndex(0); this->setMaster(false); this->setCanKill(false); this->setImmovable(false); this->setNoInterventions(false); this->setDirty(true); this->setFullscreen(false); this->setIsFloating(false); this->setParentNodeID(0); this->setChildNodeAID(0); this->setChildNodeBID(0); this->setName(""); }
this->m_tOpenTimestamp = std::chrono::high_resolution_clock::now(); }
CWindow::~CWindow() { } CWindow::~CWindow() { }
void CWindow::generateNodeID() { void CWindow::generateNodeID() {

View file

@ -3,7 +3,6 @@
#include "defines.hpp" #include "defines.hpp"
#include "utilities/Workspace.hpp" #include "utilities/Workspace.hpp"
#include "utilities/Util.hpp" #include "utilities/Util.hpp"
#include <chrono>
class CWindow { class CWindow {
public: public:
@ -39,7 +38,6 @@ public:
EXPOSED_MEMBER(RoleName, std::string, sz); EXPOSED_MEMBER(RoleName, std::string, sz);
EXPOSED_MEMBER(Constructed, bool, b); EXPOSED_MEMBER(Constructed, bool, b);
EXPOSED_MEMBER(FirstOpen, bool, b); EXPOSED_MEMBER(FirstOpen, bool, b);
EXPOSED_MEMBER(OpenTimestamp, std::chrono::high_resolution_clock::time_point, t);
// Tells the window manager to reload the window's params // Tells the window manager to reload the window's params
EXPOSED_MEMBER(Dirty, bool, b); EXPOSED_MEMBER(Dirty, bool, b);

View file

@ -2280,23 +2280,3 @@ void CWindowManager::dispatchQueuedWarp() {
warpCursorTo(QueuedPointerWarp); warpCursorTo(QueuedPointerWarp);
QueuedPointerWarp = Vector2D(-1,-1); QueuedPointerWarp = Vector2D(-1,-1);
} }
void CWindowManager::unmanageUnnamedWindows() {
std::deque<int64_t> toRemove;
for (auto& w : windows) {
if (w.getClassName() == "Error" || w.getClassName() == "") {
const auto DELTA = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - w.getOpenTimestamp()).count();
if (DELTA > 500) {
Debug::log(LOG, "Class error after 500ms -> we wont manage this.");
toRemove.push_back(w.getDrawable());
}
}
}
for (auto& wid : toRemove) {
closeWindowAllChecks(wid);
}
}

View file

@ -164,7 +164,6 @@ private:
void focusOnWorkspace(const int&); void focusOnWorkspace(const int&);
void dispatchQueuedWarp(); void dispatchQueuedWarp();
CWindow* getMasterForWorkspace(const int&); CWindow* getMasterForWorkspace(const int&);
void unmanageUnnamedWindows();
}; };
inline std::unique_ptr<CWindowManager> g_pWindowManager = std::make_unique<CWindowManager>(); inline std::unique_ptr<CWindowManager> g_pWindowManager = std::make_unique<CWindowManager>();