diff --git a/src/anbox/platform/sdl/window.cpp b/src/anbox/platform/sdl/window.cpp index 24b4c7973469aff4d1c7206b0048fc5ad5d07811..430cd27e0650fbed3a3086e6c9d80bee13b004f4 100755 --- a/src/anbox/platform/sdl/window.cpp +++ b/src/anbox/platform/sdl/window.cpp @@ -44,12 +44,19 @@ static const std::uint32_t HIDE_MINIMIZE = 0x02; static const std::uint32_t HIDE_MAXIMIZE = 0x04; static const std::uint32_t HIDE_CLOSE = 0x08; static const std::uint32_t SHOW_ALL = 0x00; +static const std::uint32_t MINI_WIDTH = 540; +static const std::uint32_t MINI_HEIGHT = 700; +static const std::uint32_t WX_MINI_WIDTH = 730; const std::map Window::property_map = { {"喜马拉雅", HIDE_MAXIMIZE}, {"i深圳", HIDE_MAXIMIZE} }; +const std::mapWindow::custom_window_map = { + {"微信", {WX_MINI_WIDTH, MINI_HEIGHT}} +}; + Window::Id Window::Invalid{-1}; Window::Observer::~Observer() {} @@ -134,7 +141,12 @@ Window::Window(const std::shared_ptr &renderer, gettimeofday(&now, NULL); last_update_time = USEC_PER_SEC * (now.tv_sec) + now.tv_usec; lastClickTime = last_update_time; - + auto window_size_ptr = custom_window_map.find(title); + if (window_size_ptr != custom_window_map.end()) { + SDL_SetWindowMinimumSize(window_, window_size_ptr->second.minimum_width, window_size_ptr->second.minimum_height); + } else { + SDL_SetWindowMinimumSize(window_, MINI_WIDTH, MINI_HEIGHT); + } SDL_ShowWindow(window_); } diff --git a/src/anbox/platform/sdl/window.h b/src/anbox/platform/sdl/window.h index 0afdf2338fdc6ac1fa4bf94ac6fac17ea7856763..c424276ba5241a00062b6f24b32c2b44698fc8a2 100755 --- a/src/anbox/platform/sdl/window.h +++ b/src/anbox/platform/sdl/window.h @@ -42,6 +42,12 @@ class Window : public std::enable_shared_from_this, public wm::Window { static const long long APP_START_MAX_TIME = 15 * USEC_PER_SEC; static const long long timespan_db_click = 500000; + struct mini_size { + int minimum_width; + int minimum_height; + }; + + static const std::map custom_window_map; static const std::map property_map; class Observer {