mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 21:05:59 +01:00
nuke unmanagedx11 vector
This commit is contained in:
parent
ea717731a4
commit
86acdcf8b6
3 changed files with 2 additions and 32 deletions
|
@ -512,15 +512,6 @@ void CCompositor::removeWindowFromVectorSafe(CWindow* pWindow) {
|
||||||
if (w->m_pX11Parent == pWindow)
|
if (w->m_pX11Parent == pWindow)
|
||||||
std::erase_if(m_vWindows, [&](std::unique_ptr<CWindow>& el) { return el.get() == w.get(); });
|
std::erase_if(m_vWindows, [&](std::unique_ptr<CWindow>& el) { return el.get() == w.get(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& w : m_dUnmanagedX11Windows) {
|
|
||||||
if (w->m_pX11Parent == pWindow)
|
|
||||||
std::erase_if(m_dUnmanagedX11Windows, [&](std::unique_ptr<CWindow>& el) { return el.get() == w.get(); });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pWindow->m_bIsX11 && pWindow->m_iX11Type == 2) {
|
|
||||||
std::erase_if(m_dUnmanagedX11Windows, [&](std::unique_ptr<CWindow>& el) { return el.get() == pWindow; });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::erase_if(m_vWindows, [&](std::unique_ptr<CWindow>& el) { return el.get() == pWindow; });
|
std::erase_if(m_vWindows, [&](std::unique_ptr<CWindow>& el) { return el.get() == pWindow; });
|
||||||
|
@ -533,11 +524,6 @@ bool CCompositor::windowExists(CWindow* pWindow) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& u : m_dUnmanagedX11Windows) {
|
|
||||||
if (u.get() == pWindow)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1994,16 +1980,6 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode
|
||||||
g_pConfigManager->ensureVRR(PMONITOR);
|
g_pConfigManager->ensureVRR(PMONITOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCompositor::moveUnmanagedX11ToWindows(CWindow* pWindow) {
|
|
||||||
for (auto it = m_dUnmanagedX11Windows.begin(); it != m_dUnmanagedX11Windows.end(); it++) {
|
|
||||||
if (it->get() == pWindow) {
|
|
||||||
m_vWindows.emplace_back(std::move(*it));
|
|
||||||
m_dUnmanagedX11Windows.erase(it);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CWindow* CCompositor::getX11Parent(CWindow* pWindow) {
|
CWindow* CCompositor::getX11Parent(CWindow* pWindow) {
|
||||||
if (!pWindow->m_bIsX11)
|
if (!pWindow->m_bIsX11)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -87,7 +87,6 @@ class CCompositor {
|
||||||
std::vector<std::shared_ptr<CMonitor>> m_vMonitors;
|
std::vector<std::shared_ptr<CMonitor>> m_vMonitors;
|
||||||
std::vector<std::shared_ptr<CMonitor>> m_vRealMonitors; // for all monitors, even those turned off
|
std::vector<std::shared_ptr<CMonitor>> m_vRealMonitors; // for all monitors, even those turned off
|
||||||
std::vector<std::unique_ptr<CWindow>> m_vWindows;
|
std::vector<std::unique_ptr<CWindow>> m_vWindows;
|
||||||
std::deque<std::unique_ptr<CWindow>> m_dUnmanagedX11Windows;
|
|
||||||
std::vector<std::unique_ptr<SXDGPopup>> m_vXDGPopups;
|
std::vector<std::unique_ptr<SXDGPopup>> m_vXDGPopups;
|
||||||
std::vector<std::unique_ptr<CWorkspace>> m_vWorkspaces;
|
std::vector<std::unique_ptr<CWorkspace>> m_vWorkspaces;
|
||||||
std::vector<std::unique_ptr<SSubsurface>> m_vSubsurfaces;
|
std::vector<std::unique_ptr<SSubsurface>> m_vSubsurfaces;
|
||||||
|
@ -166,7 +165,6 @@ class CCompositor {
|
||||||
CMonitor* getMonitorFromString(const std::string&);
|
CMonitor* getMonitorFromString(const std::string&);
|
||||||
bool workspaceIDOutOfBounds(const int&);
|
bool workspaceIDOutOfBounds(const int&);
|
||||||
void setWindowFullscreen(CWindow*, bool, eFullscreenMode);
|
void setWindowFullscreen(CWindow*, bool, eFullscreenMode);
|
||||||
void moveUnmanagedX11ToWindows(CWindow*);
|
|
||||||
CWindow* getX11Parent(CWindow*);
|
CWindow* getX11Parent(CWindow*);
|
||||||
void scheduleFrameForMonitor(CMonitor*);
|
void scheduleFrameForMonitor(CMonitor*);
|
||||||
void addToFadingOutSafe(SLayerSurface*);
|
void addToFadingOutSafe(SLayerSurface*);
|
||||||
|
|
|
@ -61,9 +61,6 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
if (g_pInputManager->m_bLastFocusOnLS) // waybar fix
|
if (g_pInputManager->m_bLastFocusOnLS) // waybar fix
|
||||||
g_pInputManager->releaseAllMouseButtons();
|
g_pInputManager->releaseAllMouseButtons();
|
||||||
|
|
||||||
if (PWINDOW->m_iX11Type == 2)
|
|
||||||
g_pCompositor->moveUnmanagedX11ToWindows(PWINDOW);
|
|
||||||
|
|
||||||
// Set all windows tiled regardless of anything
|
// Set all windows tiled regardless of anything
|
||||||
g_pXWaylandManager->setWindowStyleTiled(PWINDOW, WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
|
g_pXWaylandManager->setWindowStyleTiled(PWINDOW, WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
|
||||||
|
|
||||||
|
@ -985,8 +982,7 @@ void Events::listener_surfaceXWayland(wl_listener* listener, void* data) {
|
||||||
if (XWSURFACE->parent)
|
if (XWSURFACE->parent)
|
||||||
Debug::log(LOG, "Window parent data: %s at %x", XWSURFACE->parent->_class, XWSURFACE->parent);
|
Debug::log(LOG, "Window parent data: %s at %x", XWSURFACE->parent->_class, XWSURFACE->parent);
|
||||||
|
|
||||||
const auto PNEWWINDOW = XWSURFACE->override_redirect ? g_pCompositor->m_dUnmanagedX11Windows.emplace_back(std::make_unique<CWindow>()).get() :
|
const auto PNEWWINDOW = (CWindow*)g_pCompositor->m_vWindows.emplace_back(std::make_unique<CWindow>()).get();
|
||||||
g_pCompositor->m_vWindows.emplace_back(std::make_unique<CWindow>()).get();
|
|
||||||
|
|
||||||
PNEWWINDOW->m_uSurface.xwayland = XWSURFACE;
|
PNEWWINDOW->m_uSurface.xwayland = XWSURFACE;
|
||||||
PNEWWINDOW->m_iX11Type = XWSURFACE->override_redirect ? 2 : 1;
|
PNEWWINDOW->m_iX11Type = XWSURFACE->override_redirect ? 2 : 1;
|
||||||
|
|
Loading…
Reference in a new issue