summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUri Lublin <uril@redhat.com>2011-12-20 14:46:50 +0200
committerUri Lublin <uril@redhat.com>2011-12-21 13:05:04 +0200
commit7d8cc134bf0b2175cae69c08bfe07b859d45a306 (patch)
tree1e05c26acd4d33015f41c255bf21c581058bd68b
parent67e785f4fc853985ae968b44280c8985651e41ac (diff)
downloadspice-7d8cc134bf0b2175cae69c08bfe07b859d45a306.tar.gz
spice-7d8cc134bf0b2175cae69c08bfe07b859d45a306.tar.xz
spice-7d8cc134bf0b2175cae69c08bfe07b859d45a306.zip
client: update menu if needed when exiting full-screen mode (#758260)
(cherry picked from commit a91b0b3ff712eb2a7d91a951f2af7842495357c3)
-rw-r--r--client/screen.cpp7
-rw-r--r--client/screen.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/client/screen.cpp b/client/screen.cpp
index e0857814..851c74d9 100644
--- a/client/screen.cpp
+++ b/client/screen.cpp
@@ -97,6 +97,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);
@@ -781,6 +782,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;
@@ -872,7 +876,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 e7db4ef9..3b28aae5 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;