diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2010-06-27 12:45:12 +0300 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-06-29 13:59:46 +0200 |
commit | 3ca28ddf284acb9f1a90e3a1dbf020754db820b8 (patch) | |
tree | ca7031a4ea567cb704753081f53aa97652387fde /client/display_channel.cpp | |
parent | 8d21bce435e227403e535879eda2a7ac3c161a56 (diff) | |
download | spice-3ca28ddf284acb9f1a90e3a1dbf020754db820b8.tar.gz spice-3ca28ddf284acb9f1a90e3a1dbf020754db820b8.tar.xz spice-3ca28ddf284acb9f1a90e3a1dbf020754db820b8.zip |
detaching the screen when the primary surface is destoryed and closing the window if the primary surface is not recreated (the monitor has been detached).
Diffstat (limited to 'client/display_channel.cpp')
-rw-r--r-- | client/display_channel.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp index 95840b57..1bf0744b 100644 --- a/client/display_channel.cpp +++ b/client/display_channel.cpp @@ -1220,25 +1220,31 @@ void DisplayChannel::handle_mark(RedPeer::InMessage *message) set_rect_area(area); } -void DisplayChannel::handle_reset(RedPeer::InMessage *message) +void DisplayChannel::reset_screen() { + AutoRef<UnlockScreenEvent> unlock_event(new UnlockScreenEvent(screen())); + get_client().push_event(*unlock_event); + screen()->set_update_interrupt_trigger(NULL); + AutoRef<ResetTimer> reset_timer(new ResetTimer(screen()->ref(), get_client())); + detach_from_screen(get_client().get_application()); + + get_client().activate_interval_timer(*reset_timer, RESET_TIMEOUT); +} + + +void DisplayChannel::handle_reset(RedPeer::InMessage *message) +{ if (surfaces_mngr.is_present_canvas(0)) { Canvas *canvas; canvas = surfaces_mngr.get_canvas(0); canvas->clear(); } - AutoRef<ResetTimer> reset_timer(new ResetTimer(screen()->ref(), get_client())); - - AutoRef<UnlockScreenEvent> unlock_event(new UnlockScreenEvent(screen())); - get_client().push_event(*unlock_event); - - detach_from_screen(get_client().get_application()); _palette_cache.clear(); - get_client().activate_interval_timer(*reset_timer, RESET_TIMEOUT); + reset_screen(); } void DisplayChannel::handle_inval_list(RedPeer::InMessage* message) @@ -1464,8 +1470,7 @@ void DisplayChannel::destroy_primary_surface() } #endif - AutoRef<UnlockScreenEvent> unlock_event(new UnlockScreenEvent(screen())); - get_client().push_event(*unlock_event); + reset_screen(); } AutoRef<DestroyPrimarySurfaceEvent> event(new DestroyPrimarySurfaceEvent(*this)); |