mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
core: derive incubation controllers from tracked windows list
Replaces the attempts to track incubation controllers directly with a list of all known windows, then pulls the first usable incubation controller when an assignment is requested. This should finally fix incubation controller related use after free crashes.
This commit is contained in:
parent
59f5744f30
commit
e9a574d919
3 changed files with 27 additions and 103 deletions
|
|
@ -153,13 +153,7 @@ void ProxyWindowBase::createWindow() {
|
|||
|
||||
void ProxyWindowBase::deleteWindow(bool keepItemOwnership) {
|
||||
if (this->window != nullptr) emit this->windowDestroyed();
|
||||
if (auto* window = this->disownWindow(keepItemOwnership)) {
|
||||
if (auto* generation = EngineGeneration::findObjectGeneration(this)) {
|
||||
generation->deregisterIncubationController(window->incubationController());
|
||||
}
|
||||
|
||||
window->deleteLater();
|
||||
}
|
||||
if (auto* window = this->disownWindow(keepItemOwnership)) window->deleteLater();
|
||||
}
|
||||
|
||||
ProxiedWindow* ProxyWindowBase::disownWindow(bool keepItemOwnership) {
|
||||
|
|
@ -185,7 +179,7 @@ void ProxyWindowBase::connectWindow() {
|
|||
if (auto* generation = EngineGeneration::findObjectGeneration(this)) {
|
||||
// All windows have effectively the same incubation controller so it dosen't matter
|
||||
// which window it belongs to. We do want to replace the delay one though.
|
||||
generation->registerIncubationController(this->window->incubationController());
|
||||
generation->trackWindowIncubationController(this->window);
|
||||
}
|
||||
|
||||
this->window->setProxy(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue