more vlc fixes

This commit is contained in:
vaxerski 2021-12-11 14:50:29 +01:00
parent f4148d1b24
commit 00eebae66c
6 changed files with 35 additions and 5 deletions

View File

@ -156,6 +156,12 @@ void KeybindManager::toggleActiveWindowFullscreen(std::string unusedArg) {
PWINDOW->setFullscreen(!PWINDOW->getFullscreen());
g_pWindowManager->getWorkspaceByID(PWINDOW->getWorkspaceID())->setHasFullscreenWindow(PWINDOW->getFullscreen());
// Fix windows over and below fullscreen.
if (PWINDOW->getFullscreen())
g_pWindowManager->setAllWorkspaceWindowsUnderFullscreen(g_pWindowManager->activeWorkspaces[MONITOR->ID]);
else
g_pWindowManager->setAllWorkspaceWindowsAboveFullscreen(g_pWindowManager->activeWorkspaces[MONITOR->ID]);
}
void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {

View File

@ -230,8 +230,6 @@ CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
g_pWindowManager->Values[0] = XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_FOCUS_CHANGE;
xcb_change_window_attributes_checked(g_pWindowManager->DisplayConnection, windowID, XCB_CW_EVENT_MASK, g_pWindowManager->Values);
g_pWindowManager->setFocusedWindow(windowID);
// Make all floating windows above
g_pWindowManager->setAllFloatingWindowsTop();
@ -403,6 +401,10 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
// Do ICCCM
g_pWindowManager->getICCCMWMProtocols(pNewWindow);
// Set not under
pNewWindow->setUnderFullscreen(false);
pNewWindow->setDirty(true);
}
void Events::eventButtonPress(xcb_generic_event_t* event) {

View File

@ -1,7 +1,7 @@
#include "window.hpp"
#include "windowManager.hpp"
CWindow::CWindow() { 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->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() { }
void CWindow::generateNodeID() {

View File

@ -61,6 +61,7 @@ public:
// For floating
EXPOSED_MEMBER(DefaultSize, Vector2D, vec);
EXPOSED_MEMBER(DefaultPosition, Vector2D, vec);
EXPOSED_MEMBER(UnderFullscreen, bool, b);
// Monitors
EXPOSED_MEMBER(Monitor, int, i);

View File

@ -345,9 +345,9 @@ void CWindowManager::refreshDirtyWindows() {
bool bHasFullscreenWindow = getWorkspaceByID(window.getWorkspaceID())->getHasFullscreenWindow();
// first and foremost, let's check if the window isn't on a hidden workspace
// or that it is not a non-fullscreen window in a fullscreen workspace
// or that it is not a non-fullscreen window in a fullscreen workspace thats under
if (!isWorkspaceVisible(window.getWorkspaceID())
|| (bHasFullscreenWindow && !window.getFullscreen())) {
|| (bHasFullscreenWindow && !window.getFullscreen() && (window.getUnderFullscreen() || !window.getIsFloating()))) {
// Move it to hades
Values[0] = (int)1500000; // hmu when monitors actually have that many pixels
Values[1] = (int)1500000; // and we are still using xorg =)
@ -1697,6 +1697,8 @@ void CWindowManager::moveWindowToMapped(int64_t id) {
unmappedWindows.push_back(t);
}
windows[windows.size() - 1].setUnderFullscreen(false);
return;
}
}
@ -1710,4 +1712,20 @@ bool CWindowManager::isWindowUnmapped(int64_t id) {
}
return false;
}
void CWindowManager::setAllWorkspaceWindowsAboveFullscreen(const int& workspace) {
for (auto& w : windows) {
if (w.getWorkspaceID() == workspace && w.getIsFloating()) {
w.setUnderFullscreen(false);
}
}
}
void CWindowManager::setAllWorkspaceWindowsUnderFullscreen(const int& workspace) {
for (auto& w : windows) {
if (w.getWorkspaceID() == workspace && w.getIsFloating()) {
w.setUnderFullscreen(true);
}
}
}

View File

@ -121,6 +121,9 @@ public:
void moveWindowToMapped(int64_t);
bool isWindowUnmapped(int64_t);
void setAllWorkspaceWindowsAboveFullscreen(const int&);
void setAllWorkspaceWindowsUnderFullscreen(const int&);
private:
// Internal WM functions that don't have to be exposed