Client: Refactor window active state
Let shell surface implementations decide if they manage activated state. Moves the logic out of QWaylandDisplay. Change-Id: I75c86df68a1a93f9b1d2bf378b6603215d0b0128 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
1e36cce9fe
commit
f70756c94d
@ -385,12 +385,6 @@ void QWaylandDisplay::setLastInputDevice(QWaylandInputDevice *device, uint32_t s
|
||||
mLastInputWindow = win;
|
||||
}
|
||||
|
||||
bool QWaylandDisplay::shellManagesActiveState() const
|
||||
{
|
||||
//TODO: This should be part of a shell interface used by the shell protocol implementations
|
||||
return mShellXdg;
|
||||
}
|
||||
|
||||
void QWaylandDisplay::handleWindowActivated(QWaylandWindow *window)
|
||||
{
|
||||
if (mActiveWindows.contains(window))
|
||||
@ -414,7 +408,7 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic
|
||||
{
|
||||
QWaylandWindow *keyboardFocus = inputDevice->keyboardFocus();
|
||||
|
||||
if (!shellManagesActiveState() && mLastKeyboardFocus != keyboardFocus) {
|
||||
if (!keyboardFocus->shellSurface()->shellManagesActiveState() && mLastKeyboardFocus != keyboardFocus) {
|
||||
if (keyboardFocus)
|
||||
handleWindowActivated(keyboardFocus);
|
||||
if (mLastKeyboardFocus)
|
||||
|
@ -169,7 +169,6 @@ public:
|
||||
QWaylandWindow *lastInputWindow() const;
|
||||
void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window);
|
||||
|
||||
bool shellManagesActiveState() const;
|
||||
void handleWindowActivated(QWaylandWindow *window);
|
||||
void handleWindowDeactivated(QWaylandWindow *window);
|
||||
void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice);
|
||||
|
@ -85,6 +85,7 @@ public:
|
||||
virtual void setContentOrientationMask(Qt::ScreenOrientations orientation) { Q_UNUSED(orientation) }
|
||||
|
||||
virtual void sendProperty(const QString &name, const QVariant &value);
|
||||
virtual bool shellManagesActiveState() const { return false; }
|
||||
|
||||
inline QWaylandWindow *window() { return m_window; }
|
||||
|
||||
|
@ -89,6 +89,8 @@ public:
|
||||
void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
|
||||
void sendProperty(const QString &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
|
||||
bool shellManagesActiveState() const Q_DECL_OVERRIDE { return true; }
|
||||
|
||||
bool isFullscreen() const { return m_fullscreen; }
|
||||
bool isMaximized() const { return m_maximized; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user