fixed vlc being wack on fullscreen

This commit is contained in:
vaxerski 2021-12-11 12:54:45 +01:00
parent 21eab55ffb
commit 477b23f224
4 changed files with 69 additions and 7 deletions

View file

@ -118,6 +118,14 @@ void Events::eventUnmapWindow(xcb_generic_event_t* event) {
RETURNIFBAR; RETURNIFBAR;
const auto PCLOSEDWINDOW = g_pWindowManager->getWindowFromDrawable(E->window);
if (!PCLOSEDWINDOW)
return; // bullshit window?
if (PCLOSEDWINDOW->getIsFloating())
g_pWindowManager->moveWindowToUnmapped(E->event); // If it's floating, just unmap it.
else
g_pWindowManager->closeWindowAllChecks(E->window); g_pWindowManager->closeWindowAllChecks(E->window);
// refocus on new window // refocus on new window
@ -369,6 +377,12 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
if (E->window == g_pWindowManager->barWindowID) if (E->window == g_pWindowManager->barWindowID)
return; return;
// Check if it's not unmapped
if (g_pWindowManager->isWindowUnmapped(E->window)) {
g_pWindowManager->moveWindowToMapped(E->window);
return;
}
// We check if the window is not on our tile-blacklist and if it is, we have a special treatment procedure for it. // We check if the window is not on our tile-blacklist and if it is, we have a special treatment procedure for it.
// this func also sets some stuff // this func also sets some stuff

View file

@ -88,6 +88,7 @@ public:
EXPOSED_MEMBER(RealBorderColor, CFloatingColor, c); EXPOSED_MEMBER(RealBorderColor, CFloatingColor, c);
EXPOSED_MEMBER(EffectiveBorderColor, CFloatingColor, c); EXPOSED_MEMBER(EffectiveBorderColor, CFloatingColor, c);
private: private:
}; };

View file

@ -1045,13 +1045,15 @@ void CWindowManager::eatWindow(CWindow* a, CWindow* toEat) {
void CWindowManager::closeWindowAllChecks(int64_t id) { void CWindowManager::closeWindowAllChecks(int64_t id) {
// fix last window if tile // fix last window if tile
const auto CLOSEDWINDOW = g_pWindowManager->getWindowFromDrawable(id); const auto CLOSEDWINDOW = g_pWindowManager->getWindowFromDrawable(id);
if (CLOSEDWINDOW) {
if (!CLOSEDWINDOW)
return; // It's not in the vec, ignore. (weird)
if (!CLOSEDWINDOW->getIsFloating()) if (!CLOSEDWINDOW->getIsFloating())
g_pWindowManager->fixWindowOnClose(CLOSEDWINDOW); g_pWindowManager->fixWindowOnClose(CLOSEDWINDOW);
if (const auto WORKSPACE = getWorkspaceByID(CLOSEDWINDOW->getWorkspaceID()); WORKSPACE && CLOSEDWINDOW->getFullscreen()) if (const auto WORKSPACE = getWorkspaceByID(CLOSEDWINDOW->getWorkspaceID()); WORKSPACE && CLOSEDWINDOW->getFullscreen())
WORKSPACE->setHasFullscreenWindow(false); WORKSPACE->setHasFullscreenWindow(false);
}
// delete off of the arr // delete off of the arr
g_pWindowManager->removeWindowFromVectorSafe(id); g_pWindowManager->removeWindowFromVectorSafe(id);
@ -1673,3 +1675,43 @@ void CWindowManager::recalcAllWorkspaces() {
recalcEntireWorkspace(workspace.getID()); recalcEntireWorkspace(workspace.getID());
} }
} }
void CWindowManager::moveWindowToUnmapped(int64_t id) {
for (auto& w : windows) {
if (w.getDrawable() == id) {
// Move it
unmappedWindows.push_back(w);
removeWindowFromVectorSafe(w.getDrawable());
return;
}
}
}
void CWindowManager::moveWindowToMapped(int64_t id) {
for (auto& w : unmappedWindows) {
if (w.getDrawable() == id) {
// Move it
windows.push_back(w);
// manually remove
auto temp = unmappedWindows;
unmappedWindows.clear();
for (auto& t : temp) {
if (t.getDrawable() != id)
unmappedWindows.push_back(t);
}
return;
}
}
}
bool CWindowManager::isWindowUnmapped(int64_t id) {
for (auto& w : unmappedWindows) {
if (w.getDrawable() == id) {
return true;
}
}
return false;
}

View file

@ -41,6 +41,7 @@ public:
xcb_colormap_t Colormap; xcb_colormap_t Colormap;
std::vector<CWindow> windows; // windows never left. It has always been hiding amongst us. std::vector<CWindow> windows; // windows never left. It has always been hiding amongst us.
std::vector<CWindow> unmappedWindows;
xcb_drawable_t LastWindow = -1; xcb_drawable_t LastWindow = -1;
std::vector<CWorkspace> workspaces; std::vector<CWorkspace> workspaces;
@ -117,6 +118,10 @@ public:
void recalcAllWorkspaces(); void recalcAllWorkspaces();
void moveWindowToUnmapped(int64_t);
void moveWindowToMapped(int64_t);
bool isWindowUnmapped(int64_t);
private: private:
// Internal WM functions that don't have to be exposed // Internal WM functions that don't have to be exposed