From 9b703fedb05851ebb2aa83fb3a14acecdc44286a Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 15 Mar 2017 07:59:32 +0100 Subject: [PATCH] Forward selected display size as window size in single window mode --- src/anbox/cmds/session_manager.cpp | 2 +- src/anbox/wm/single_window_manager.cpp | 5 +++-- src/anbox/wm/single_window_manager.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/anbox/cmds/session_manager.cpp b/src/anbox/cmds/session_manager.cpp index b158d5e7..f12d589d 100644 --- a/src/anbox/cmds/session_manager.cpp +++ b/src/anbox/cmds/session_manager.cpp @@ -151,7 +151,7 @@ anbox::cmds::SessionManager::SessionManager(const BusFactory &bus_factory) std::shared_ptr window_manager; if (single_window_) - window_manager = std::make_shared(policy, app_mgr); + window_manager = std::make_shared(policy, display_frame, app_mgr); else window_manager = std::make_shared(policy, android_api_stub, app_mgr); diff --git a/src/anbox/wm/single_window_manager.cpp b/src/anbox/wm/single_window_manager.cpp index f9586450..40c55c43 100644 --- a/src/anbox/wm/single_window_manager.cpp +++ b/src/anbox/wm/single_window_manager.cpp @@ -27,13 +27,14 @@ namespace anbox { namespace wm { SingleWindowManager::SingleWindowManager(const std::shared_ptr &policy, + const graphics::Rect &window_size const std::shared_ptr &app_db) - : platform_policy_(policy), app_db_(app_db) {} + : platform_policy_(policy), window_size_(window_size), app_db_(app_db) {} SingleWindowManager::~SingleWindowManager() {} void SingleWindowManager::setup() { - window_ = platform_policy_->create_window(0, {0, 0, 1024, 768}, "Android"); + window_ = platform_policy_->create_window(0, window_size_, "Anbox - Android in a Box"); if (!window_->attach()) WARNING("Failed to attach window to renderer"); } diff --git a/src/anbox/wm/single_window_manager.h b/src/anbox/wm/single_window_manager.h index a0d7c269..edb3d00f 100644 --- a/src/anbox/wm/single_window_manager.h +++ b/src/anbox/wm/single_window_manager.h @@ -36,6 +36,7 @@ class Window; class SingleWindowManager : public Manager { public: SingleWindowManager(const std::shared_ptr &policy, + const graphics::Rect &window_size const std::shared_ptr &app_db); ~SingleWindowManager(); @@ -52,6 +53,7 @@ class SingleWindowManager : public Manager { private: std::shared_ptr platform_policy_; + graphics::Rect window_size_; std::shared_ptr app_db_; std::shared_ptr window_; }; -- GitLab