forked from quickshell/quickshell
all/window: use global screeninfo pool for screen getter
This commit is contained in:
parent
9cbd5abd96
commit
3026d3400a
4 changed files with 17 additions and 8 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <qwindow.h>
|
||||
|
||||
#include "generation.hpp"
|
||||
#include "qmlglobal.hpp"
|
||||
#include "qmlscreen.hpp"
|
||||
#include "region.hpp"
|
||||
#include "reload.hpp"
|
||||
|
@ -231,6 +232,8 @@ void ProxyWindowBase::setScreen(QuickshellScreenInfo* screen) {
|
|||
}
|
||||
|
||||
auto* qscreen = screen == nullptr ? nullptr : screen->screen;
|
||||
if (qscreen == this->mScreen) return;
|
||||
|
||||
if (qscreen != nullptr) {
|
||||
QObject::connect(qscreen, &QObject::destroyed, this, &ProxyWindowBase::onScreenDestroyed);
|
||||
}
|
||||
|
@ -257,10 +260,7 @@ QuickshellScreenInfo* ProxyWindowBase::screen() const {
|
|||
qscreen = this->window->screen();
|
||||
}
|
||||
|
||||
return new QuickshellScreenInfo(
|
||||
const_cast<ProxyWindowBase*>(this), // NOLINT
|
||||
qscreen
|
||||
);
|
||||
return QuickshellTracked::instance()->screenInfo(qscreen);
|
||||
}
|
||||
|
||||
QColor ProxyWindowBase::color() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue