summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2010-06-27 12:45:12 +0300
committerAlexander Larsson <alexl@redhat.com>2010-06-29 13:59:46 +0200
commit3ca28ddf284acb9f1a90e3a1dbf020754db820b8 (patch)
treeca7031a4ea567cb704753081f53aa97652387fde /client
parent8d21bce435e227403e535879eda2a7ac3c161a56 (diff)
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')
-rw-r--r--client/display_channel.cpp25
-rw-r--r--client/display_channel.h1
2 files changed, 16 insertions, 10 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 95840b5..1bf0744 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));
diff --git a/client/display_channel.h b/client/display_channel.h
index c56adf6..e6cd227 100644
--- a/client/display_channel.h
+++ b/client/display_channel.h
@@ -188,6 +188,7 @@ private:
void streams_time();
void activate_streams_timer();
void stream_update_request(uint32_t update_time);
+ void reset_screen();
static void set_clip_rects(const SpiceClip& clip, uint32_t& num_clip_rects, SpiceRect*& clip_rects);
private: