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
|
@ -11,6 +11,7 @@
|
|||
#include <qqmlcontext.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qqmllist.h>
|
||||
#include <qscreen.h>
|
||||
#include <qtenvironmentvariables.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
|
@ -73,6 +74,14 @@ QuickshellTracked::QuickshellTracked() {
|
|||
}
|
||||
}
|
||||
|
||||
QuickshellScreenInfo* QuickshellTracked::screenInfo(QScreen* screen) const {
|
||||
for (auto* info: this->screens) {
|
||||
if (info->screen == screen) return info;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QuickshellTracked* QuickshellTracked::instance() {
|
||||
static QuickshellTracked* instance = nullptr; // NOLINT
|
||||
if (instance == nullptr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue