[Spice-commits] 4 commits - client/application.cpp client/display_channel.cpp client/display_channel.h client/Makefile.am client/windows server/red_worker.c

Alexander Larsson alexl at kemper.freedesktop.org
Tue Jun 29 04:59:58 PDT 2010


 client/Makefile.am           |    4 ++--
 client/application.cpp       |    2 +-
 client/display_channel.cpp   |   25 +++++++++++++++----------
 client/display_channel.h     |    1 +
 client/windows/generate.bat  |    2 +-
 client/windows/generate1.bat |    2 +-
 server/red_worker.c          |    3 ---
 7 files changed, 21 insertions(+), 18 deletions(-)

New commits:
commit 59152e31f0d47ecc72d5d8c4690423771bf2ef75
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Tue Jun 29 13:57:17 2010 +0200

    client: add --include "common.h" for generated marshallers

diff --git a/client/Makefile.am b/client/Makefile.am
index 7a7420a..d5602b5 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -12,10 +12,10 @@ generated_demarshallers1.cpp: $(top_srcdir)/spice1.proto
 	$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include common.h --include messages.h --prefix 1 --ptrsize 8 $(top_srcdir)/spice1.proto generated_demarshallers1.cpp
 
 generated_marshallers.cpp: $(top_srcdir)/spice.proto
-	$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include messages.h --include marshallers.h --client $(top_srcdir)/spice.proto generated_marshallers.cpp
+	$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P  --include "common.h" --include messages.h --include marshallers.h --client $(top_srcdir)/spice.proto generated_marshallers.cpp
 
 generated_marshallers1.cpp: $(top_srcdir)/spice1.proto
-	$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include messages.h --include marshallers.h --client --prefix 1 --ptrsize 8 $(top_srcdir)/spice1.proto generated_marshallers1.cpp
+	$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P  --include "common.h" --include messages.h --include marshallers.h --client --prefix 1 --ptrsize 8 $(top_srcdir)/spice1.proto generated_marshallers1.cpp
 
 if SUPPORT_GL
 GL_SRCS =				\
diff --git a/client/windows/generate.bat b/client/windows/generate.bat
index 1bb62b4..6bd06d7 100644
--- a/client/windows/generate.bat
+++ b/client/windows/generate.bat
@@ -1,2 +1,2 @@
 python ..\..\spice_codegen.py -d -c  -i common.h -i messages.h ..\..\spice.proto ..\generated_demarshallers.cpp
-python ..\..\spice_codegen.py --generate-marshallers -P --include messages.h --include marshallers.h --client ..\..\spice.proto ..\generated_marshallers.cpp
+python ..\..\spice_codegen.py --generate-marshallers -P --include "common.h" --include messages.h --include marshallers.h --client ..\..\spice.proto ..\generated_marshallers.cpp
diff --git a/client/windows/generate1.bat b/client/windows/generate1.bat
index b22eaf1..559c670 100644
--- a/client/windows/generate1.bat
+++ b/client/windows/generate1.bat
@@ -1,2 +1,2 @@
 python ..\..\spice_codegen.py -d -c  -i common.h -i messages.h --prefix 1 --ptrsize 8 ..\..\spice1.proto ..\generated_demarshallers1.cpp
-python ..\..\spice_codegen.py --generate-marshallers -P --include messages.h  --include marshallers.h --client --prefix 1 --ptrsize 8 ..\..\spice1.proto ..\generated_marshallers1.cpp
+python ..\..\spice_codegen.py --generate-marshallers -P --include "common.h" --include messages.h  --include marshallers.h --client --prefix 1 --ptrsize 8 ..\..\spice1.proto ..\generated_marshallers1.cpp
commit 270a1e6df378702be9ed44d5f66ea9e0b7de91e3
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Sun Jun 27 12:45:13 2010 +0300

    fixed unhandled destroy screen in Application:restore_screens_size

diff --git a/client/application.cpp b/client/application.cpp
index 8d2c34f..482215c 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -1449,7 +1449,7 @@ void Application::enter_full_screen()
 void Application::restore_screens_size()
 {
     for (int i = 0; i < (int)_screens.size(); i++) {
-        if (_screens[i]->is_size_locked()) {
+        if (!_screens[i] || _screens[i]->is_size_locked()) {
             continue;
         }
         _screens[i]->resize(SCREEN_INIT_WIDTH, SCREEN_INIT_HEIGHT);
commit 3ca28ddf284acb9f1a90e3a1dbf020754db820b8
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Sun Jun 27 12:45:12 2010 +0300

    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).

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:
commit 8d21bce435e227403e535879eda2a7ac3c161a56
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Sun Jun 27 12:45:11 2010 +0300

    remove unnecessary send of SPICE_MSG_DISPLAY_RESET
    
    when SPICE_MSG_DISPLAY_RESET was sent, SPICE_MSG_DISPLAY_SURFACE_DESTROY had already
    been sent for all surfaces.
    It also caused a client crash since DisplayChannel::handle_reset assumes that screen
    exists.

diff --git a/server/red_worker.c b/server/red_worker.c
index e458d4b..8598e7a 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10979,9 +10979,6 @@ static inline void handle_dev_destroy_surfaces(RedWorker *worker)
     if (worker->display_channel) {
         red_pipe_add_type(&worker->display_channel->base, PIPE_ITEM_TYPE_INVAL_PALLET_CACHE);
         red_pipe_add_verb(&worker->display_channel->base, SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL);
-        if (!worker->display_channel->base.migrate) {
-            red_pipe_add_verb(&worker->display_channel->base, SPICE_MSG_DISPLAY_RESET);
-        }
     }
 
     //to handle better


More information about the Spice-commits mailing list