From fe4535a27389624445b96450a7c338136c619c95 Mon Sep 17 00:00:00 2001 From: lisuke <1657787678@qq.com> Date: Mon, 9 Jan 2023 21:15:58 +0800 Subject: [PATCH] fix autocopy. (#26) * fix autocopy. --- src/events/Events.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/events/Events.cpp b/src/events/Events.cpp index 3fe80f3..61a5055 100644 --- a/src/events/Events.cpp +++ b/src/events/Events.cpp @@ -164,8 +164,8 @@ void Events::handlePointerButton(void *data, struct wl_pointer *wl_pointer, uint Debug::log(NONE, "%g%% %g%% %g%% %g%%", c, m, y, k); if (g_pHyprpicker->m_bAutoCopy) - g_pHyprpicker->finish(); Clipboard::copy("%g%% %g%% %g%% %g%%", c, m, y, k); + g_pHyprpicker->finish(); break; } case OUTPUT_HEX: @@ -187,8 +187,8 @@ void Events::handlePointerButton(void *data, struct wl_pointer *wl_pointer, uint Debug::log(NONE, "#%s%s%s", toHex(COL.r).c_str(), toHex(COL.g).c_str(), toHex(COL.b).c_str()); if (g_pHyprpicker->m_bAutoCopy) - g_pHyprpicker->finish(); Clipboard::copy("#%s%s%s", toHex(COL.r).c_str(), toHex(COL.g).c_str(), toHex(COL.b).c_str()); + g_pHyprpicker->finish(); break; } case OUTPUT_RGB: @@ -199,8 +199,8 @@ void Events::handlePointerButton(void *data, struct wl_pointer *wl_pointer, uint Debug::log(NONE, "%i %i %i", COL.r, COL.g, COL.b); if (g_pHyprpicker->m_bAutoCopy) - g_pHyprpicker->finish(); Clipboard::copy("%i %i %i", COL.r, COL.g, COL.b); + g_pHyprpicker->finish(); break; } case OUTPUT_HSL: @@ -250,14 +250,13 @@ void Events::handlePointerButton(void *data, struct wl_pointer *wl_pointer, uint Debug::log(NONE, "%g %g%% %g%%", h, s, l_or_v); if (g_pHyprpicker->m_bAutoCopy) - g_pHyprpicker->finish(); Clipboard::copy("%g %g%% %g%%", h, s, l_or_v); + g_pHyprpicker->finish(); break; } } - if (!g_pHyprpicker->m_bAutoCopy) - g_pHyprpicker->finish(); + g_pHyprpicker->finish(); } void Events::handleKeyboardKeymap(void* data, wl_keyboard* wl_keyboard, uint format, int fd, uint size) {