-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
compositor: cleanup fading out on expired monitor #13179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gulafaran
wants to merge
1
commit into
hyprwm:main
Choose a base branch
from
gulafaran:cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+17
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1288,10 +1288,18 @@ void CCompositor::changeWindowZOrder(PHLWINDOW pWindow, bool top) { | |
| } | ||
|
|
||
| void CCompositor::cleanupFadingOut(const MONITORID& monid) { | ||
| bool windowsFadingDirty = false; | ||
|
|
||
| for (auto const& ww : m_windowsFadingOut) { | ||
|
|
||
| auto w = ww.lock(); | ||
|
|
||
| if (!w || !w->m_monitor) { | ||
| windowsFadingDirty = true; | ||
| Log::logger->log(Log::DEBUG, "Cleanup: m_windowsFadingOut had expired window or monitor"); | ||
| continue; | ||
| } | ||
|
|
||
| if (w->monitorID() != monid && w->m_monitor) | ||
| continue; | ||
|
|
||
|
|
@@ -1311,14 +1319,18 @@ void CCompositor::cleanupFadingOut(const MONITORID& monid) { | |
| } | ||
| } | ||
|
|
||
| if (windowsFadingDirty) | ||
| std::erase_if(m_windowsFadingOut, [](const auto& el) { return el.expired() || !el->m_monitor; }); | ||
|
|
||
| bool layersDirty = false; | ||
|
|
||
| for (auto const& lsr : m_surfacesFadingOut) { | ||
|
|
||
| auto ls = lsr.lock(); | ||
|
|
||
| if (!ls) { | ||
| if (!ls || !ls->m_monitor) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| layersDirty = true; | ||
| Log::logger->log(Log::DEBUG, "Cleanup: m_surfacesFadingOut had expired layer or monitor"); | ||
| continue; | ||
| } | ||
|
|
||
|
|
@@ -1349,8 +1361,10 @@ void CCompositor::cleanupFadingOut(const MONITORID& monid) { | |
| } | ||
| } | ||
|
|
||
| if (layersDirty) | ||
| std::erase_if(m_surfacesFadingOut, [](const auto& el) { return el.expired(); }); | ||
| if (layersDirty) { | ||
| std::erase_if(m_surfacesFadingOut, [](const auto& el) { return el.expired() || !el->m_monitor; }); | ||
| std::erase_if(m_layers, [](const auto& el) { return !el->m_monitor; }); | ||
| } | ||
| } | ||
|
|
||
| void CCompositor::addToFadingOutSafe(PHLLS pLS) { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, do not remove a window just because it has no monitor. It could still be alive but lost for some reason. If it's destroyed AND no monitor, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem doing && here would mean the
elmight be expired but monitor might notThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be yes, but in general you cant remove a window until it's marked as ready for destrtoy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well yeah but some of these containers get stuck with with some stuff when i hotplug the monitor. and && might segfault, el.expired && el->m_monitor will nullptr deref. but i might be going about this the wrong way then, perhaps m_layers or m_windows contains something that it shouldnt so it never expires on hotplugging the monitor hm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym by stuck, whats their state