From 69d17bf4240e41f2b26abd7a46dfd0e754e9ee9e Mon Sep 17 00:00:00 2001 From: FlafyDev Date: Fri, 19 Aug 2022 21:01:51 +0300 Subject: add input:kb_file --- src/helpers/WLClasses.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 6b0787bb..4c769202 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -103,6 +103,7 @@ struct SKeyboard { xkb_layout_index_t activeLayout = 0; std::string name = ""; + std::string xkbFilePath = ""; SStringRuleNames currentRules; int repeatRate = 0; @@ -316,4 +317,4 @@ struct SIMEPopup { bool operator==(const SIMEPopup& other) { return pSurface == other.pSurface; } -}; \ No newline at end of file +}; -- cgit v1.2.3 From f0ad77251b28fcf48dcaf25f23e3a140d69a4735 Mon Sep 17 00:00:00 2001 From: FlafyDev Date: Fri, 19 Aug 2022 23:18:09 +0300 Subject: move absolutePath to MiscFunctions --- src/helpers/MiscFunctions.cpp | 22 ++++++++++++++++++++++ src/helpers/MiscFunctions.hpp | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/helpers') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index b7285637..b27489ca 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -40,6 +40,28 @@ static const float transforms[][9] = {{ }, }; +std::string absolutePath(const std::string& rawpath, const std::string& currentPath) { + auto value = rawpath; + + if (value[0] == '.') { + auto currentDir = currentPath.substr(0, currentPath.find_last_of('/')); + + if (value[1] == '.') { + auto parentDir = currentDir.substr(0, currentDir.find_last_of('/')); + value.replace(0, 2, parentDir); + } else { + value.replace(0, 1, currentDir); + } + } + + if (value[0] == '~') { + static const char* const ENVHOME = getenv("HOME"); + value.replace(0, 1, std::string(ENVHOME)); + } + + return value; +} + void addWLSignal(wl_signal* pSignal, wl_listener* pListener, void* pOwner, std::string ownerString) { ASSERT(pSignal); ASSERT(pListener); diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index a40471a9..9f002c20 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -2,6 +2,7 @@ #include "../includes.hpp" +std::string absolutePath(const std::string&, const std::string&); void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString); void wlr_signal_emit_safe(struct wl_signal *signal, void *data); std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string @@ -17,4 +18,4 @@ std::string execAndGet(const char*); float getPlusMinusKeywordResult(std::string in, float relative); -void matrixProjection(float mat[9], int w, int h, wl_output_transform tr); \ No newline at end of file +void matrixProjection(float mat[9], int w, int h, wl_output_transform tr); -- cgit v1.2.3 From cc3f0ff9e7906bff60a041fc5556e7c5cbd71df5 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 20 Aug 2022 20:06:24 +0200 Subject: update wlroots dep --- src/helpers/MiscFunctions.cpp | 29 ----------------------------- src/helpers/MiscFunctions.hpp | 1 - 2 files changed, 30 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index b27489ca..405a53d8 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -75,35 +75,6 @@ void handleNoop(struct wl_listener *listener, void *data) { // Do nothing } -void wlr_signal_emit_safe(struct wl_signal *signal, void *data) { - struct wl_listener cursor; - struct wl_listener end; - - /* Add two special markers: one cursor and one end marker. This way, we know - * that we've already called listeners on the left of the cursor and that we - * don't want to call listeners on the right of the end marker. The 'it' - * function can remove any element it wants from the list without troubles. - * wl_list_for_each_safe tries to be safe but it fails: it works fine - * if the current item is removed, but not if the next one is. */ - wl_list_insert(&signal->listener_list, &cursor.link); - cursor.notify = handleNoop; - wl_list_insert(signal->listener_list.prev, &end.link); - end.notify = handleNoop; - - while (cursor.link.next != &end.link) { - struct wl_list *pos = cursor.link.next; - struct wl_listener *l = wl_container_of(pos, l, link); - - wl_list_remove(&cursor.link); - wl_list_insert(pos, &cursor.link); - - l->notify(l, data); - } - - wl_list_remove(&cursor.link); - wl_list_remove(&end.link); -} - std::string getFormat(const char *fmt, ...) { char* outputStr = nullptr; diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index 9f002c20..bbfb8ca2 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -4,7 +4,6 @@ std::string absolutePath(const std::string&, const std::string&); void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString); -void wlr_signal_emit_safe(struct wl_signal *signal, void *data); std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string std::string escapeJSONStrings(const std::string& str); void scaleBox(wlr_box*, float); -- cgit v1.2.3 From 04f0efadc33fd3ac9fb0ed176dbc00dde9906f8e Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Sun, 21 Aug 2022 20:21:21 +1000 Subject: add switching to previous workspace --- src/helpers/Workspace.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index 5a3a24ba..9243c9cc 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -18,6 +18,9 @@ public: int m_iID = -1; std::string m_szName = ""; uint64_t m_iMonitorID = -1; + // Previous workspace ID is stored during a workspace change, allowing travel + // to the previous workspace. + int m_iPrevWorkspaceID = -1; bool m_bHasFullscreenWindow = false; eFullscreenMode m_efFullscreenMode = FULLSCREEN_FULL; -- cgit v1.2.3 From 3c8c605541d6b3e046951ba8710dfb2e9452a3de Mon Sep 17 00:00:00 2001 From: Charles Taylor Date: Sun, 21 Aug 2022 21:58:46 +1000 Subject: fix style conflicts and config + monitor retrieval --- src/helpers/Workspace.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/helpers') diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index 9243c9cc..3faebdd8 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -20,7 +20,7 @@ public: uint64_t m_iMonitorID = -1; // Previous workspace ID is stored during a workspace change, allowing travel // to the previous workspace. - int m_iPrevWorkspaceID = -1; + int m_iPrevWorkspaceID = -1; bool m_bHasFullscreenWindow = false; eFullscreenMode m_efFullscreenMode = FULLSCREEN_FULL; -- cgit v1.2.3