diff --git a/AUR/PKGBUILD b/AUR/PKGBUILD index b66f6d4..8cf2e71 100644 --- a/AUR/PKGBUILD +++ b/AUR/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Daniel Dada pkgname=clrsync -pkgver=1.0.4 +pkgver=1.0.5 pkgrel=1 pkgdesc="Color scheme manager" arch=('x86_64') diff --git a/CMakeLists.txt b/CMakeLists.txt index d019c08..2439ec0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(clrsync VERSION 1.0.4 LANGUAGES CXX) +project(clrsync VERSION 1.0.5 LANGUAGES CXX) include(GNUInstallDirs) diff --git a/VERSION b/VERSION index ee90284..90a27f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 +1.0.5 diff --git a/src/core/common/version.hpp b/src/core/common/version.hpp index 735613c..14a2071 100644 --- a/src/core/common/version.hpp +++ b/src/core/common/version.hpp @@ -6,7 +6,7 @@ namespace clrsync::core { -const std::string GIT_SEMVER = "1.0.3+git.gd852d58"; +const std::string GIT_SEMVER = "1.0.4+git.g2b1c6d5"; const std::string version_string(); } // namespace clrsync::core diff --git a/src/gui/backend/glfw_opengl.cpp b/src/gui/backend/glfw_opengl.cpp index 40bf1a6..7c5d54b 100644 --- a/src/gui/backend/glfw_opengl.cpp +++ b/src/gui/backend/glfw_opengl.cpp @@ -16,6 +16,11 @@ glfw_opengl_backend::~glfw_opengl_backend() glfw_opengl_backend::shutdown(); } +void glfw_opengl_backend::focus_callback(GLFWwindow*, int focused) +{ + glfwSwapInterval(focused ? 1 : 0); +} + bool glfw_opengl_backend::initialize(const window_config &config) { glfwSetErrorCallback([](int error, const char* description) { @@ -48,6 +53,7 @@ bool glfw_opengl_backend::initialize(const window_config &config) glfwMakeContextCurrent(m_window); glfwSwapInterval(1); + glfwSetWindowFocusCallback(m_window, focus_callback); return true; } diff --git a/src/gui/backend/glfw_opengl.hpp b/src/gui/backend/glfw_opengl.hpp index 23e0fb8..b2a060b 100644 --- a/src/gui/backend/glfw_opengl.hpp +++ b/src/gui/backend/glfw_opengl.hpp @@ -32,6 +32,8 @@ namespace clrsync::gui::backend{ void imgui_render_draw_data(void* draw_data) override; private: + static void focus_callback(GLFWwindow* window, int focused); + GLFWwindow* m_window = nullptr; }; } diff --git a/src/gui/platform/linux/font_loader_linux.cpp b/src/gui/platform/linux/font_loader_linux.cpp index 7a7983a..47f99bc 100644 --- a/src/gui/platform/linux/font_loader_linux.cpp +++ b/src/gui/platform/linux/font_loader_linux.cpp @@ -9,9 +9,7 @@ #include std::string font_loader::find_font_linux(const char *font_name) -{ - glfwPollEvents(); - +{ FcInit(); FcPattern *pattern = FcNameParse(reinterpret_cast(font_name)); @@ -67,9 +65,6 @@ void font_loader::pop_font() std::vector font_loader::get_system_fonts() { std::vector fonts; - - glfwPollEvents(); - FcInit(); FcPattern *pattern = FcPatternCreate(); FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, nullptr); @@ -78,13 +73,7 @@ std::vector font_loader::get_system_fonts() if (fs) { for (int i = 0; i < fs->nfont; i++) - { - // TODO: should change this to something sane - if (i % 100 == 0) - { - glfwPollEvents(); - } - + { FcChar8 *family = nullptr; if (FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch) {