core/reloader: trigger onPostReload if launched post-reload

This is similar to the check in Reloadable, and fixes a number of hard
to debug issues with Process, IpcHandler, NotificationServer, and
GlobalShortcut not working depending on where you put them in a QML file.
This commit is contained in:
outfoxxed 2025-07-04 15:58:41 -07:00
parent 0e6518a706
commit 9708d8212a
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
8 changed files with 36 additions and 38 deletions

View file

@ -32,9 +32,7 @@ namespace qs::hyprland::global_shortcuts {
///
/// [hyprland_global_shortcuts_v1]: https://github.com/hyprwm/hyprland-protocols/blob/main/protocols/hyprland-global-shortcuts-v1.xml
/// [the wiki]: https://wiki.hyprland.org/Configuring/Binds/#dbus-global-shortcuts
class GlobalShortcut
: public QObject
, public PostReloadHook {
class GlobalShortcut: public PostReloadHook {
using ShortcutImpl = impl::GlobalShortcut;
Q_OBJECT;
@ -59,7 +57,7 @@ class GlobalShortcut
QML_ELEMENT;
public:
explicit GlobalShortcut(QObject* parent = nullptr): QObject(parent) {}
explicit GlobalShortcut(QObject* parent = nullptr): PostReloadHook(parent) {}
~GlobalShortcut() override;
Q_DISABLE_COPY_MOVE(GlobalShortcut);