mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-29 03:05:05 +00:00
all/window: use global screeninfo pool for screen getter
This commit is contained in:
4 files changed
+17
-8
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user