Skip to content

Commit

Permalink
Updates for Hyprland v0.46.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dawsers committed Dec 17, 2024
1 parent 9f7d9d7 commit 3c5e2f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/functions.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "functions.h"
#include "scroller.h"
#include "dispatchers.h"

#include <hyprland/src/Compositor.hpp>

SDispatchResult this_moveFocusTo(std::string args)
{
dispatchers::dispatch_movefocus(args);
Expand Down
1 change: 1 addition & 0 deletions src/functions.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef SCROLLER_FUNCTIONS_H
#define SCROLLER_FUNCTIONS_H

#include <hyprland/src/helpers/Timer.hpp>
#include <hyprland/src/desktop/Workspace.hpp>
#include <hyprland/src/managers/KeybindManager.hpp>

Expand Down
12 changes: 6 additions & 6 deletions src/scroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ void ScrollerLayout::onWindowCreatedTiling(PHLWINDOW window, eDirection)

// Check window rules
for (auto &r: window->m_vMatchedRules) {
if (r.szRule.starts_with("plugin:scroller:group")) {
const auto name = r.szRule.substr(r.szRule.find_first_of(' ') + 1);
if (r->szRule.starts_with("plugin:scroller:group")) {
const auto name = r->szRule.substr(r->szRule.find_first_of(' ') + 1);
s->move_active_window_to_group(name);
} else if (r.szRule.starts_with("plugin:scroller:alignwindow")) {
const auto dir = r.szRule.substr(r.szRule.find_first_of(' ') + 1);
} else if (r->szRule.starts_with("plugin:scroller:alignwindow")) {
const auto dir = r->szRule.substr(r->szRule.find_first_of(' ') + 1);
if (dir == "l" || dir == "left") {
s->align_column(Direction::Left);
} else if (dir == "r" || dir == "right") {
Expand All @@ -316,8 +316,8 @@ void ScrollerLayout::onWindowCreatedTiling(PHLWINDOW window, eDirection)
} else if (dir == "m" || dir == "middle") {
s->align_column(Direction::Middle);
}
} else if (r.szRule.starts_with("plugin:scroller:marksadd")) {
const auto mark_name = r.szRule.substr(r.szRule.find_first_of(' ') + 1);
} else if (r->szRule.starts_with("plugin:scroller:marksadd")) {
const auto mark_name = r->szRule.substr(r->szRule.find_first_of(' ') + 1);
marks.add(window, mark_name);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/sizes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ ConfigurationSize ScrollerSizes::get_window_default_height(PHLWINDOW window)
{
// Check window rules
for (auto &r: window->m_vMatchedRules) {
if (r.szRule.starts_with("plugin:scroller:windowheight")) {
const auto window_height = r.szRule.substr(r.szRule.find_first_of(' ') + 1);
if (r->szRule.starts_with("plugin:scroller:windowheight")) {
const auto window_height = r->szRule.substr(r->szRule.find_first_of(' ') + 1);
return get_window_default_height_fron_string(window_height);
}
}
Expand All @@ -103,8 +103,8 @@ ConfigurationSize ScrollerSizes::get_column_default_width(PHLWINDOW window)
{
// Check window rules
for (auto &r: window->m_vMatchedRules) {
if (r.szRule.starts_with("plugin:scroller:columnwidth")) {
const auto column_width = r.szRule.substr(r.szRule.find_first_of(' ') + 1);
if (r->szRule.starts_with("plugin:scroller:columnwidth")) {
const auto column_width = r->szRule.substr(r->szRule.find_first_of(' ') + 1);
return get_column_default_width_fron_string(column_width);
}
}
Expand Down

0 comments on commit 3c5e2f7

Please sign in to comment.