aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDarksome <[email protected]>2022-07-16 15:28:17 +0300
committerDarksome <[email protected]>2022-07-16 15:28:17 +0300
commitce9efb7ae38acb84d72035e6b4a772a6fe5e9319 (patch)
treeac6d0312df8c4aefcea6b86a2b9150927b2a1934
parent2ae088d63102cf7c0281157c1845d27e3502048e (diff)
downloadHyprland-ce9efb7ae38acb84d72035e6b4a772a6fe5e9319.tar.gz
Hyprland-ce9efb7ae38acb84d72035e6b4a772a6fe5e9319.zip
Impl changeworkspace(e+{n})
-rw-r--r--example/hyprland.conf4
-rw-r--r--src/config/defaultConfig.hpp4
-rw-r--r--src/events/Devices.cpp4
-rw-r--r--src/helpers/MiscFunctions.cpp6
-rw-r--r--src/managers/input/InputManager.cpp6
5 files changed, 11 insertions, 13 deletions
diff --git a/example/hyprland.conf b/example/hyprland.conf
index a776559a..7c5918e7 100644
--- a/example/hyprland.conf
+++ b/example/hyprland.conf
@@ -103,5 +103,5 @@ bind=ALT,8,movetoworkspace,8
bind=ALT,9,movetoworkspace,9
bind=ALT,0,movetoworkspace,10
-bind=SUPER,mouse_down,workspace,+1
-bind=SUPER,mouse_up,workspace,-1 \ No newline at end of file
+bind=SUPER,mouse_down,workspace,e+1
+bind=SUPER,mouse_up,workspace,e-1 \ No newline at end of file
diff --git a/src/config/defaultConfig.hpp b/src/config/defaultConfig.hpp
index 15dbbe16..1897d93d 100644
--- a/src/config/defaultConfig.hpp
+++ b/src/config/defaultConfig.hpp
@@ -112,6 +112,6 @@ bind=ALT,8,movetoworkspace,8
bind=ALT,9,movetoworkspace,9
bind=ALT,0,movetoworkspace,10
-bind=SUPER,mouse_down,workspace,+1
-bind=SUPER,mouse_up,workspace,-1
+bind=SUPER,mouse_down,workspace,e+1
+bind=SUPER,mouse_up,workspace,e-1
)#"; \ No newline at end of file
diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp
index 5660772c..4b8762ba 100644
--- a/src/events/Devices.cpp
+++ b/src/events/Devices.cpp
@@ -49,9 +49,7 @@ void Events::listener_mouseButton(wl_listener* listener, void* data) {
}
void Events::listener_mouseAxis(wl_listener* listener, void* data) {
- const auto E = (wlr_pointer_axis_event*)data;
-
- wlr_seat_pointer_notify_axis(g_pCompositor->m_sSeat.seat, E->time_msec, E->orientation, E->delta, E->delta_discrete, E->source);
+ g_pInputManager->onMouseWheel((wlr_pointer_axis_event*)data);
}
void Events::listener_requestMouse(wl_listener* listener, void* data) {
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 126600f3..cf415847 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -193,7 +193,9 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) {
}
outName = WORKSPACENAME;
} else {
- if (in[0] == 'm') {
+ if (in[0] == 'm' || in[0] == 'e') {
+ bool onAllMonitors = in[0] == 'e';
+
if (!g_pCompositor->m_pLastMonitor) {
Debug::log(ERR, "Relative monitor workspace on monitor null!");
result = INT_MAX;
@@ -234,7 +236,7 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) {
}
if (const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(searchID); PWORKSPACE && PWORKSPACE->m_iID != SPECIAL_WORKSPACE_ID) {
- if (PWORKSPACE->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID) {
+ if (onAllMonitors || PWORKSPACE->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID) {
currentID = PWORKSPACE->m_iID;
if (remains < 0)
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 55890abc..c7fcfb7a 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -630,12 +630,10 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar
bool found = false;
if (e->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
- static const std::string empty = "";
-
for (int i = 0; i < syms; ++i)
- found = g_pKeybindManager->handleKeybinds(MODS, empty, keysyms[i], 0) || found;
+ found = g_pKeybindManager->handleKeybinds(MODS, "", keysyms[i], 0) || found;
- found = g_pKeybindManager->handleKeybinds(MODS, empty, 0, KEYCODE) || found;
+ found = g_pKeybindManager->handleKeybinds(MODS, "", 0, KEYCODE) || found;
} else if (e->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
// hee hee
}