Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions hyprpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "hyprvibr"
authors = ["devcexx"]
commit_pins = [
["386376400119dd46a767c9f8c8791fd22c7b6e61", "803ee2b24005d9dbc75a1e97dda49b8a62fb683b"], # 0.52.2
["dd220efe7b1e292415bd0ea7161f63df9c95bfd3", "1176c131f054cbf62d4a50239a4f9ce1d786f954"], # 0.53.3
]

[hyprvibr]
Expand Down
9 changes: 4 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
#include <hyprland/src/protocols/core/Compositor.hpp>
#include <hyprland/src/desktop/state/FocusState.hpp>
#include <any>
#include <hyprland/src/event/EventBus.hpp>
#include <array>
#include <format>
#include <hyprutils/string/ConstVarList.hpp>
Expand Down Expand Up @@ -147,16 +147,15 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
throw std::runtime_error("[hyprvibr] Version mismatch");
}

static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", [&](void* self, SCallbackInfo& info, std::any data) {
const auto WIN = std::any_cast<PHLWINDOW>(data);
static auto P = Event::bus()->m_events.window.active.listen([](PHLWINDOW WIN, Desktop::eFocusReason reason) {
onActiveWindowChange(WIN);
});

static auto P2 = HyprlandAPI::registerCallbackDynamic(PHANDLE, "preConfigReload", [&](void* self, SCallbackInfo& info, std::any data) {
static auto P2 = Event::bus()->m_events.config.preReload.listen([]() {
g_appConfigs.clear();
});

static auto P3 = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", [&](void* self, SCallbackInfo& info, std::any data) {
static auto P3 = Event::bus()->m_events.config.reloaded.listen([]() {
onActiveWindowChange(Desktop::focusState()->window());
});

Expand Down