mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
core/popupwindow: add grabFocus
Some checks failed
Build / Nix (push) Has been cancelled
Build / Nix-1 (push) Has been cancelled
Build / Nix-2 (push) Has been cancelled
Build / Nix-3 (push) Has been cancelled
Build / Nix-4 (push) Has been cancelled
Build / Nix-5 (push) Has been cancelled
Build / Nix-6 (push) Has been cancelled
Build / Nix-7 (push) Has been cancelled
Build / Nix-8 (push) Has been cancelled
Build / Nix-9 (push) Has been cancelled
Build / Nix-10 (push) Has been cancelled
Build / Nix-11 (push) Has been cancelled
Build / Nix-12 (push) Has been cancelled
Build / Nix-13 (push) Has been cancelled
Build / Nix-14 (push) Has been cancelled
Build / Nix-15 (push) Has been cancelled
Build / Nix-16 (push) Has been cancelled
Build / Nix-17 (push) Has been cancelled
Build / Nix-18 (push) Has been cancelled
Build / Nix-19 (push) Has been cancelled
Build / Nix-20 (push) Has been cancelled
Build / Nix-21 (push) Has been cancelled
Build / Nix-22 (push) Has been cancelled
Build / Nix-23 (push) Has been cancelled
Build / Nix-24 (push) Has been cancelled
Build / Nix-25 (push) Has been cancelled
Build / Nix-26 (push) Has been cancelled
Build / Nix-27 (push) Has been cancelled
Build / Nix-28 (push) Has been cancelled
Build / Nix-29 (push) Has been cancelled
Build / Nix-30 (push) Has been cancelled
Build / Nix-31 (push) Has been cancelled
Build / Archlinux (push) Has been cancelled
Lint / Lint (push) Has been cancelled
Some checks failed
Build / Nix (push) Has been cancelled
Build / Nix-1 (push) Has been cancelled
Build / Nix-2 (push) Has been cancelled
Build / Nix-3 (push) Has been cancelled
Build / Nix-4 (push) Has been cancelled
Build / Nix-5 (push) Has been cancelled
Build / Nix-6 (push) Has been cancelled
Build / Nix-7 (push) Has been cancelled
Build / Nix-8 (push) Has been cancelled
Build / Nix-9 (push) Has been cancelled
Build / Nix-10 (push) Has been cancelled
Build / Nix-11 (push) Has been cancelled
Build / Nix-12 (push) Has been cancelled
Build / Nix-13 (push) Has been cancelled
Build / Nix-14 (push) Has been cancelled
Build / Nix-15 (push) Has been cancelled
Build / Nix-16 (push) Has been cancelled
Build / Nix-17 (push) Has been cancelled
Build / Nix-18 (push) Has been cancelled
Build / Nix-19 (push) Has been cancelled
Build / Nix-20 (push) Has been cancelled
Build / Nix-21 (push) Has been cancelled
Build / Nix-22 (push) Has been cancelled
Build / Nix-23 (push) Has been cancelled
Build / Nix-24 (push) Has been cancelled
Build / Nix-25 (push) Has been cancelled
Build / Nix-26 (push) Has been cancelled
Build / Nix-27 (push) Has been cancelled
Build / Nix-28 (push) Has been cancelled
Build / Nix-29 (push) Has been cancelled
Build / Nix-30 (push) Has been cancelled
Build / Nix-31 (push) Has been cancelled
Build / Archlinux (push) Has been cancelled
Lint / Lint (push) Has been cancelled
Allows standard wayland focus grabs on non hyprland compositors.
This commit is contained in:
parent
de1bfe028d
commit
dca652366a
3 changed files with 16 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ set shell id.
|
||||||
- Pipewire service now reconnects if pipewire dies or a protocol error occurs.
|
- Pipewire service now reconnects if pipewire dies or a protocol error occurs.
|
||||||
- Added pipewire audio peak detection.
|
- Added pipewire audio peak detection.
|
||||||
- Added initial support for network management.
|
- Added initial support for network management.
|
||||||
|
- Added support for grabbing focus from popup windows.
|
||||||
|
|
||||||
## Other Changes
|
## Other Changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ void ProxyPopupWindow::completeWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->window->setTransientParent(bw);
|
this->window->setTransientParent(bw);
|
||||||
this->window->setFlag(Qt::ToolTip);
|
this->window->setFlag(this->bWantsGrab ? Qt::Popup : Qt::ToolTip);
|
||||||
|
|
||||||
this->mAnchor.markDirty();
|
this->mAnchor.markDirty();
|
||||||
PopupPositioner::instance()->reposition(&this->mAnchor, this->window);
|
PopupPositioner::instance()->reposition(&this->mAnchor, this->window);
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,15 @@ class ProxyPopupWindow: public ProxyWindowBase {
|
||||||
///
|
///
|
||||||
/// The popup will not be shown until @@anchor is valid, regardless of this property.
|
/// The popup will not be shown until @@anchor is valid, regardless of this property.
|
||||||
QSDOC_PROPERTY_OVERRIDE(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged);
|
QSDOC_PROPERTY_OVERRIDE(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged);
|
||||||
|
/// If true, the popup window will be dismissed and @@visible will change to false
|
||||||
|
/// if the user clicks outside of the popup or it is otherwise closed.
|
||||||
|
///
|
||||||
|
/// > [!WARNING] Changes to this property while the window is open will only take
|
||||||
|
/// > effect after the window is hidden and shown again.
|
||||||
|
///
|
||||||
|
/// > [!NOTE] Under Hyprland, @@Quickshell.Hyprland.HyprlandFocusGrab provides more advanced
|
||||||
|
/// > functionality such as detecting clicks outside without closing the popup.
|
||||||
|
Q_PROPERTY(bool grabFocus READ default WRITE default NOTIFY grabFocusChanged BINDABLE bindableGrabFocus);
|
||||||
/// The screen that the window currently occupies.
|
/// The screen that the window currently occupies.
|
||||||
///
|
///
|
||||||
/// This may be modified to move the window to the given screen.
|
/// This may be modified to move the window to the given screen.
|
||||||
|
|
@ -103,12 +112,15 @@ public:
|
||||||
[[nodiscard]] qint32 relativeY() const;
|
[[nodiscard]] qint32 relativeY() const;
|
||||||
void setRelativeY(qint32 y);
|
void setRelativeY(qint32 y);
|
||||||
|
|
||||||
|
[[nodiscard]] QBindable<bool> bindableGrabFocus() { return &this->bWantsGrab; }
|
||||||
|
|
||||||
[[nodiscard]] PopupAnchor* anchor();
|
[[nodiscard]] PopupAnchor* anchor();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void parentWindowChanged();
|
void parentWindowChanged();
|
||||||
void relativeXChanged();
|
void relativeXChanged();
|
||||||
void relativeYChanged();
|
void relativeYChanged();
|
||||||
|
void grabFocusChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onParentWindowChanged();
|
void onParentWindowChanged();
|
||||||
|
|
@ -131,4 +143,6 @@ private:
|
||||||
bTargetVisible,
|
bTargetVisible,
|
||||||
&ProxyPopupWindow::targetVisibleChanged
|
&ProxyPopupWindow::targetVisibleChanged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Q_OBJECT_BINDABLE_PROPERTY(ProxyPopupWindow, bool, bWantsGrab);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue