mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 03:05:59 +01:00
parent
38132ffaf5
commit
18ee9ece9c
3 changed files with 22 additions and 2 deletions
|
@ -1361,6 +1361,10 @@ void CCompositor::addToFadingOutSafe(PHLLS pLS) {
|
||||||
m_vSurfacesFadingOut.emplace_back(pLS);
|
m_vSurfacesFadingOut.emplace_back(pLS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCompositor::removeFromFadingOutSafe(PHLLS ls) {
|
||||||
|
std::erase(m_vSurfacesFadingOut, ls);
|
||||||
|
}
|
||||||
|
|
||||||
void CCompositor::addToFadingOutSafe(PHLWINDOW pWindow) {
|
void CCompositor::addToFadingOutSafe(PHLWINDOW pWindow) {
|
||||||
const auto FOUND = std::find_if(m_vWindowsFadingOut.begin(), m_vWindowsFadingOut.end(), [&](PHLWINDOWREF& other) { return other.lock() == pWindow; });
|
const auto FOUND = std::find_if(m_vWindowsFadingOut.begin(), m_vWindowsFadingOut.end(), [&](PHLWINDOWREF& other) { return other.lock() == pWindow; });
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,7 @@ class CCompositor {
|
||||||
PHLWINDOW getX11Parent(PHLWINDOW);
|
PHLWINDOW getX11Parent(PHLWINDOW);
|
||||||
void scheduleFrameForMonitor(CMonitor*);
|
void scheduleFrameForMonitor(CMonitor*);
|
||||||
void addToFadingOutSafe(PHLLS);
|
void addToFadingOutSafe(PHLLS);
|
||||||
|
void removeFromFadingOutSafe(PHLLS);
|
||||||
void addToFadingOutSafe(PHLWINDOW);
|
void addToFadingOutSafe(PHLWINDOW);
|
||||||
PHLWINDOW getWindowByRegex(const std::string&);
|
PHLWINDOW getWindowByRegex(const std::string&);
|
||||||
void warpCursorTo(const Vector2D&, bool force = false);
|
void warpCursorTo(const Vector2D&, bool force = false);
|
||||||
|
|
|
@ -119,6 +119,10 @@ void CLayerSurface::onMap() {
|
||||||
mapped = true;
|
mapped = true;
|
||||||
interactivity = layerSurface->current.interactivity;
|
interactivity = layerSurface->current.interactivity;
|
||||||
|
|
||||||
|
// this layer might be re-mapped.
|
||||||
|
fadingOut = false;
|
||||||
|
g_pCompositor->removeFromFadingOutSafe(self.lock());
|
||||||
|
|
||||||
// fix if it changed its mon
|
// fix if it changed its mon
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
|
||||||
|
|
||||||
|
@ -204,8 +208,6 @@ void CLayerSurface::onUnmap() {
|
||||||
|
|
||||||
const bool WASLASTFOCUS = g_pCompositor->m_pLastFocus == surface->resource();
|
const bool WASLASTFOCUS = g_pCompositor->m_pLastFocus == surface->resource();
|
||||||
|
|
||||||
surface.reset();
|
|
||||||
|
|
||||||
if (!PMONITOR)
|
if (!PMONITOR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -221,12 +223,25 @@ void CLayerSurface::onUnmap() {
|
||||||
g_pHyprRenderer->damageBox(&geomFixed);
|
g_pHyprRenderer->damageBox(&geomFixed);
|
||||||
|
|
||||||
g_pInputManager->sendMotionEventsToFocused();
|
g_pInputManager->sendMotionEventsToFocused();
|
||||||
|
|
||||||
|
g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLayerSurface::onCommit() {
|
void CLayerSurface::onCommit() {
|
||||||
if (!layerSurface)
|
if (!layerSurface)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!mapped) {
|
||||||
|
// we're re-mapping if this is the case
|
||||||
|
if (layerSurface->surface && !layerSurface->surface->current.buffer) {
|
||||||
|
fadingOut = false;
|
||||||
|
geometry = {};
|
||||||
|
g_pHyprRenderer->arrangeLayersForMonitor(monitorID);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
|
||||||
|
|
||||||
if (!PMONITOR)
|
if (!PMONITOR)
|
||||||
|
|
Loading…
Reference in a new issue