13#include "../qtcommon/Screen_p.h"
14#include "../qtcommon/Window_p.h"
15#include "../qtcommon/Platform.h"
21#include <QtGui/private/qhighdpiscaling_p.h>
36void Window::onScreenChanged(
QObject *context, WindowScreenChangedCallback callback)
41 context = context ? context : m_window;
57QRect Window::geometry()
const
59 return m_window->geometry();
62void Window::setProperty(
const char *name,
const QVariant &value)
65 m_window->setProperty(name, value);
69void Window::setHasBeenMinimizedDirectlyFromRestore(
bool has)
74bool Window::hasBeenMinimizedDirectlyFromRestore()
const
79bool Window::isVisible()
const
81 return m_window->isVisible();
84WId Window::handle()
const
86 if (m_window->handle())
87 return m_window->winId();
91QWindow *Window::qtWindow()
const
96bool Window::equals(std::shared_ptr<Core::Window> other)
const
98 auto otherQt =
static_cast<Window *
>(other.get());
99 return other && otherQt->m_window == m_window;
102void Window::setFramePosition(
QPoint targetPos)
104 m_window->setFramePosition(targetPos);
107QRect Window::frameGeometry()
const
109 return m_window->frameGeometry();
112void Window::resize(
int width,
int height)
114 m_window->resize(width, height);
117bool Window::isActive()
const
119 return m_window->isActive();
124 return m_window->mapFromGlobal(globalPos);
129 return m_window->mapToGlobal(localPos);
132Core::Screen::Ptr Window::screen()
const
134 return std::make_shared<Screen_qt>(m_window->screen());
137void Window::destroy()
142QVariant Window::property(
const char *name)
const
144 return m_window->property(name);
147QSize Window::minSize()
const
149 return m_window->minimumSize();
152QSize Window::maxSize()
const
154 return m_window->maximumSize();
159 return QHighDpi::fromNativePixels(nativePos, m_window.data());
162void Window::startSystemMove()
164 m_window->startSystemMove();
167void Window::setGeometry(
QRect geo)
169 m_window->setGeometry(geo);
172void Window::setVisible(
bool is)
174 m_window->setVisible(is);
177bool Window::isFullScreen()
const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static const char *const s_kddw_hasBeenMinimizedDirectlyFromRestore
void screenChanged(QScreen *screen)