History

Added an API function to check if an overlay has keyboard focus

ksuprynowicz committed 3 years ago

Commit 025f5301 parent 3d4a9932 files · +11 −1Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.h (1 of 2 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.h+8−0
@@ -104,6 +104,13 @@ public: · 103 unmodified lines
104104 int getWidth();
105105 int getHeight();
106106
107+ /*@jsdoc
108+ * Checks whether the keyboard focus belongs to overlay UI window.
109+ * @function Desktop.isOverlayWindowFocused
110+ * @returns {boolean} <code>true</code> if the keyboard focus is on overlay UI window, <code>false</code> if not.
111+ */
112+ Q_INVOKABLE bool isOverlayWindowFocused() { return _isOverlayWindowFocused; };
113+
107114 signals:
108115
109116 /*@jsdoc
@@ -124,6 +131,7 @@ private: · 14 unmodified lines
124131 static QVariantMap getRelativePositionAnchor();
125132 Q_INVOKABLE static QVariantMap getPresentationMode();
126133 const bool _restricted;
134+ std::atomic<bool> _isOverlayWindowFocused { false };
127135 };
128136
129137