|
--- a/src/anbox/platform/sdl/platform.cpp 2020-06-30 13:15:49.448320901 +0300
|
|
+++ b/src/anbox/platform/sdl/platform.cpp 2020-06-30 13:39:02.464989017 +0300
|
|
@@ -446,6 +446,17 @@ void Platform::window_wants_focus(const
|
|
}
|
|
}
|
|
|
|
+void Platform::window_restored(const Window::Id &id) {
|
|
+ auto w = windows_.find(id);
|
|
+ if (w == windows_.end()) return;
|
|
+
|
|
+ if (auto window = w->second.lock()) {
|
|
+ auto new_frame = window->frame();
|
|
+ window->update_frame(new_frame);
|
|
+ window_manager_->resize_task(window->task(), new_frame, 3);
|
|
+ }
|
|
+}
|
|
+
|
|
void Platform::window_moved(const Window::Id &id, const std::int32_t &x,
|
|
const std::int32_t &y) {
|
|
auto w = windows_.find(id);
|
|
--- a/src/anbox/platform/sdl/platform.h 2020-06-30 13:16:06.144987589 +0300
|
|
+++ b/src/anbox/platform/sdl/platform.h 2020-06-30 13:39:35.294989051 +0300
|
|
@@ -54,6 +54,7 @@ class Platform : public std::enable_shar
|
|
|
|
void window_deleted(const Window::Id &id) override;
|
|
void window_wants_focus(const Window::Id &id) override;
|
|
+ void window_restored(const Window::Id &id) override;
|
|
void window_moved(const Window::Id &id, const std::int32_t &x,
|
|
const std::int32_t &y) override;
|
|
void window_resized(const Window::Id &id, const std::int32_t &width,
|
|
--- a/src/anbox/platform/sdl/window.cpp 2020-06-30 12:25:01.078318019 +0300
|
|
+++ b/src/anbox/platform/sdl/window.cpp 2020-06-30 13:40:04.924989082 +0300
|
|
@@ -193,6 +193,10 @@ void Window::process_event(const SDL_Eve
|
|
break;
|
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
|
break;
|
|
+ case SDL_WINDOWEVENT_RESTORED:
|
|
+ if (observer_)
|
|
+ observer_->window_restored(id_);
|
|
+ break;
|
|
// Not need to listen for SDL_WINDOWEVENT_RESIZED here as the
|
|
// SDL_WINDOWEVENT_SIZE_CHANGED is always sent.
|
|
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
|
--- a/src/anbox/platform/sdl/window.h 2020-06-30 13:14:34.174987490 +0300
|
|
+++ b/src/anbox/platform/sdl/window.h 2020-06-30 13:40:24.711655769 +0300
|
|
@@ -41,6 +41,7 @@ class Window : public std::enable_shared
|
|
virtual ~Observer();
|
|
virtual void window_deleted(const Id &id) = 0;
|
|
virtual void window_wants_focus(const Id &id) = 0;
|
|
+ virtual void window_restored(const Id &id) = 0;
|
|
virtual void window_moved(const Id &id, const std::int32_t &x,
|
|
const std::int32_t &y) = 0;
|
|
virtual void window_resized(const Id &id, const std::int32_t &x,
|