[Spice-devel] [PATCH 3/4] client: update menu if needed when exiting full-screen mode (#758260)

Uri Lublin uril at redhat.com
Tue Dec 20 08:52:43 PST 2011


---
 client/screen.cpp |    7 ++++++-
 client/screen.h   |    1 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/client/screen.cpp b/client/screen.cpp
index 94f3bdc..0b3ba6f 100644
--- a/client/screen.cpp
+++ b/client/screen.cpp
@@ -100,6 +100,7 @@ RedScreen::RedScreen(Application& owner, int id, const std::string& name, int wi
     , _mouse_captured (false)
     , _active_layer_change_event (false)
     , _pointer_on_screen (false)
+    , _menu_needs_update (false)
 {
     region_init(&_dirty_region);
     set_name(name);
@@ -784,6 +785,9 @@ void RedScreen::exit_full_screen()
     _origin.x = _origin.y = 0;
     _window.set_origin(0, 0);
     show();
+    if (_menu_needs_update) {
+        update_menu();
+    }
     _full_screen = false;
     _out_of_sync = false;
     _frame_area = false;
@@ -875,7 +879,8 @@ void RedScreen::external_show()
 void RedScreen::update_menu()
 {
     AutoRef<Menu> menu(_owner.get_app_menu());
-    _window.set_menu(*menu);
+    int ret = _window.set_menu(*menu);
+    _menu_needs_update = (ret != 0); /* try again if menu update failed */
 }
 
 void RedScreen::on_exposed_rect(const SpiceRect& area)
diff --git a/client/screen.h b/client/screen.h
index a08415a..6c470ca 100644
--- a/client/screen.h
+++ b/client/screen.h
@@ -178,6 +178,7 @@ private:
     bool _key_interception;
     bool _update_by_timer;
     bool _size_locked;
+    bool _menu_needs_update;
     int _forec_update_timer;
     AutoRef<UpdateTimer> _update_timer;
     RedDrawable* _composit_area;
-- 
1.7.1



More information about the Spice-devel mailing list