Custom Anbox installation files & patches, including patched Android OS image file.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.4 KiB

  1. --- a/src/anbox/platform/sdl/platform.cpp 2020-06-30 13:15:49.448320901 +0300
  2. +++ b/src/anbox/platform/sdl/platform.cpp 2020-06-30 13:39:02.464989017 +0300
  3. @@ -446,6 +446,17 @@ void Platform::window_wants_focus(const
  4. }
  5. }
  6. +void Platform::window_restored(const Window::Id &id) {
  7. + auto w = windows_.find(id);
  8. + if (w == windows_.end()) return;
  9. +
  10. + if (auto window = w->second.lock()) {
  11. + auto new_frame = window->frame();
  12. + window->update_frame(new_frame);
  13. + window_manager_->resize_task(window->task(), new_frame, 3);
  14. + }
  15. +}
  16. +
  17. void Platform::window_moved(const Window::Id &id, const std::int32_t &x,
  18. const std::int32_t &y) {
  19. auto w = windows_.find(id);
  20. --- a/src/anbox/platform/sdl/platform.h 2020-06-30 13:16:06.144987589 +0300
  21. +++ b/src/anbox/platform/sdl/platform.h 2020-06-30 13:39:35.294989051 +0300
  22. @@ -54,6 +54,7 @@ class Platform : public std::enable_shar
  23. void window_deleted(const Window::Id &id) override;
  24. void window_wants_focus(const Window::Id &id) override;
  25. + void window_restored(const Window::Id &id) override;
  26. void window_moved(const Window::Id &id, const std::int32_t &x,
  27. const std::int32_t &y) override;
  28. void window_resized(const Window::Id &id, const std::int32_t &width,
  29. --- a/src/anbox/platform/sdl/window.cpp 2020-06-30 12:25:01.078318019 +0300
  30. +++ b/src/anbox/platform/sdl/window.cpp 2020-06-30 13:40:04.924989082 +0300
  31. @@ -193,6 +193,10 @@ void Window::process_event(const SDL_Eve
  32. break;
  33. case SDL_WINDOWEVENT_FOCUS_LOST:
  34. break;
  35. + case SDL_WINDOWEVENT_RESTORED:
  36. + if (observer_)
  37. + observer_->window_restored(id_);
  38. + break;
  39. // Not need to listen for SDL_WINDOWEVENT_RESIZED here as the
  40. // SDL_WINDOWEVENT_SIZE_CHANGED is always sent.
  41. case SDL_WINDOWEVENT_SIZE_CHANGED:
  42. --- a/src/anbox/platform/sdl/window.h 2020-06-30 13:14:34.174987490 +0300
  43. +++ b/src/anbox/platform/sdl/window.h 2020-06-30 13:40:24.711655769 +0300
  44. @@ -41,6 +41,7 @@ class Window : public std::enable_shared
  45. virtual ~Observer();
  46. virtual void window_deleted(const Id &id) = 0;
  47. virtual void window_wants_focus(const Id &id) = 0;
  48. + virtual void window_restored(const Id &id) = 0;
  49. virtual void window_moved(const Id &id, const std::int32_t &x,
  50. const std::int32_t &y) = 0;
  51. virtual void window_resized(const Id &id, const std::int32_t &x,