From 3d051a40568e45d4e3fc868376ba10828388ef20 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Thu, 22 Dec 2016 08:33:26 +0100 Subject: [PATCH] Update window frame when window is moved rathern when state was updated This leads to incorrect calculations of the layer position calculation inside the window. --- src/anbox/ubuntu/platform_policy.cpp | 1 + src/anbox/wm/window.cpp | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/anbox/ubuntu/platform_policy.cpp b/src/anbox/ubuntu/platform_policy.cpp index 3d717d0..ae01d7e 100644 --- a/src/anbox/ubuntu/platform_policy.cpp +++ b/src/anbox/ubuntu/platform_policy.cpp @@ -237,6 +237,7 @@ void PlatformPolicy::window_moved(const Window::Id &id, const std::int32_t &x, if (auto window = w->second.lock()) { auto new_frame = window->frame(); new_frame.translate(x, y); + window->update_frame(new_frame); android_api_->resize_task(window->task(), new_frame, 3); } } diff --git a/src/anbox/wm/window.cpp b/src/anbox/wm/window.cpp index 81dfd90..9203416 100644 --- a/src/anbox/wm/window.cpp +++ b/src/anbox/wm/window.cpp @@ -27,15 +27,7 @@ Window::Window(const std::shared_ptr &renderer, const Task::Id &task, Window::~Window() {} void Window::update_state(const WindowState::List &states) { - graphics::Rect new_frame = graphics::Rect::Invalid; - for (const auto &s : states) { - if (new_frame == graphics::Rect::Invalid) - new_frame = s.frame(); - else - new_frame.merge(s.frame()); - } - - update_frame(new_frame); + (void)states; } void Window::update_frame(const graphics::Rect &frame) {