diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e802ce..4e92183c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.0) -project(win-vind VERSION 5.13.1) -set(INTERNAL_VERSION ${PROJECT_VERSION}.0) +project(win-vind VERSION 5.13.2) +set(INTERNAL_VERSION ${PROJECT_VERSION}.1) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) diff --git a/src/core/entry.cpp b/src/core/entry.cpp index ef9b6dc8..8bbcba1a 100644 --- a/src/core/entry.cpp +++ b/src/core/entry.cpp @@ -84,6 +84,7 @@ SOFTWARE. #include "opt/vcmdline.hpp" #include "util/debug.hpp" #include "util/interval_timer.hpp" +#include "util/screen_metrics.hpp" #include "util/type_traits.hpp" #include "util/winwrap.hpp" @@ -108,6 +109,8 @@ namespace vind DWORD previous_procid_ ; + std::size_t num_of_monitor_ ; + template Impl(ExitFuncType&& exitfunc, String&& memname, std::size_t memsize) : exit_(std::forward(exitfunc)), @@ -117,7 +120,8 @@ namespace vind subprocess_(false), memread_timer_(1000'000), //1 s bg_(opt::all_global_options()), - previous_procid_(0) + previous_procid_(0), + num_of_monitor_(util::get_all_monitor_metrics().size()) {} ~Impl() noexcept { @@ -372,6 +376,13 @@ namespace vind } } + // If the number of monitors changes, reload the settings. + auto current_num_of_monitor = util::get_all_monitor_metrics().size() ; + if(current_num_of_monitor != pimpl->num_of_monitor_) { + reconstruct() ; + pimpl->num_of_monitor_ = current_num_of_monitor ; + } + do { CmdUnit::SPtr input ; std::uint16_t count = 0 ; diff --git a/src/core/version.hpp b/src/core/version.hpp index b1a7e9c2..81bdb964 100644 --- a/src/core/version.hpp +++ b/src/core/version.hpp @@ -1,6 +1,6 @@ #ifndef _VERSION_HPP #define _VERSION_HPP -#define WIN_VIND_VERSION "5.13.1.0" +#define WIN_VIND_VERSION "5.13.2.1" #endif