[Spice-commits] Branch '0.6' - 3 commits - client/application.cpp client/application.h

Hans de Goede jwrdegoede at kemper.freedesktop.org
Tue Nov 9 04:38:02 PST 2010

 client/application.cpp |   15 +++++++++------
 client/application.h   |    4 ----
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 0bb53766fae863b927f82d06eb85e4f5a8e25280
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Nov 9 11:45:41 2010 +0100

    spicec: Don't show gui when connection info is specified on the cmdline
    Currently when compiled with the gui enabled if you specify a host to connect
    to on the cmdline the gui flashes by (show_gui gets called, then the connect
    handler calls hide_gui as soon as the connection is made).
    This patch removes this ugly flashing by of the gui.

diff --git a/client/application.cpp b/client/application.cpp
index 2701641..4b22e1f 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -602,14 +602,12 @@ void Application::on_start_running()
     //FIXME: _client.connect() or use the following instead?
 #ifdef USE_GUI
-    if (_gui_mode != GUI_MODE_FULL) {
-        connect();
+    if (_gui_mode == GUI_MODE_FULL) {
+        show_gui();
+        return;
-    show_gui();
-    connect();
 #endif // HAVE_GUI
+    connect();
 RedScreen* Application::find_screen(int id)
commit 8d6b124f2a0e4ab4e3d61415cec77038b94e517f
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Nov 9 11:32:07 2010 +0100

    spicec: Remove empty show / hide gui functions
    When compiling without gui support just don't call show / hide
    gui, rather then making them stubs, this makes it easier to follow what is
    going on.

diff --git a/client/application.cpp b/client/application.cpp
index 7ef2c78..2701641 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -841,7 +841,9 @@ void Application::on_disconnected(int error_code)
     // todo: display special notification for host switch (during migration)
+#ifdef USE_GUI
     if (host_switch) {
@@ -853,7 +855,9 @@ void Application::on_visibility_start(int screen_id)
+#ifdef USE_GUI
diff --git a/client/application.h b/client/application.h
index 19c68a5..0e761ec 100644
--- a/client/application.h
+++ b/client/application.h
@@ -322,10 +322,6 @@ private:
     void create_gui_barrier(RedScreen& screen, int id);
     void destroyed_gui_barrier(int id);
     void destroyed_gui_barriers();
-#else // USE_GUI
-    void show_gui() {}
-    void hide_gui() {}
 #endif // USE_GUI
     // returns the press value before operation (i.e., if it was already pressed)
commit 6fd1bbb846b0fc4b704c277ffa5974fc565ae05f
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Nov 9 11:24:59 2010 +0100

    spicec: Fix info layer sometimes not showing
    Currently we are calling show_info_layer from hide_gui in application.cpp, but
    there are 2 cases where this does not happen:
    1) When compiled without gui support hide_gui is a complete nop, so we never
       show the info layer when compiled without gui support
    2) When run with --controller we never show the gui, and hide_gui
       checks if there is a gui to hide as the first thing and if not returns
       resulting in show_info_layer not being called, and thus the info layer
       not showing when launched from the xpi
    This patch fixes both by adding a call to show_info_layer from
    on_visibility_start note that on_visibility_start also calls hide_gui,
    so in some cases show_info_layer may be called twice, this is not a
    problem as show_info_layer is protected against this.

diff --git a/client/application.cpp b/client/application.cpp
index d5b24a7..7ef2c78 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -854,6 +854,7 @@ void Application::on_visibility_start(int screen_id)
+    show_info_layer();
 void Application::on_disconnecting()

More information about the Spice-commits mailing list