[ekiga] Call Window: Fix incorrect call window positionning.



commit a896f681319036c3c93731e33eaa955208ec2baf
Author: Damien Sandras <dsandras beip be>
Date:   Sat Feb 11 12:34:12 2012 +0100

    Call Window: Fix incorrect call window positionning.
    
    We show/hide it when preview button is toggled. The reason is that if we
    bind those actions to the X videooutput device opening/closing, we could
    hide the window when it has not been created yet.

 src/gui/call_window.cpp |    3 ---
 src/gui/main_window.cpp |   14 +++++++++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/call_window.cpp b/src/gui/call_window.cpp
index 15104e1..206ea9b 100644
--- a/src/gui/call_window.cpp
+++ b/src/gui/call_window.cpp
@@ -757,9 +757,6 @@ on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */, gpoi
   gtk_menu_section_set_sensitive (cw->priv->main_menu, "local_video", FALSE);
   gtk_menu_section_set_sensitive (cw->priv->main_menu, "fullscreen", TRUE);
   gtk_menu_section_set_sensitive (cw->priv->main_menu, "zoom_in", FALSE);
-
-  if (cw->priv->calling_state == Standby)
-    gtk_widget_hide (GTK_WIDGET (cw));
 }
 
 //FIXME Set_stay_on_top "window_show object"
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 4c4252f..19bd0fb 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -1165,6 +1165,18 @@ static void
 video_preview_action_toggled_cb (GtkToggleToolButton *b,
                                  G_GNUC_UNUSED gpointer data)
 {
+  EkigaMainWindow *mw = EKIGA_MAIN_WINDOW (data);
+  GtkWidget *call_window = GnomeMeeting::Process ()->GetCallWindow ();
+
+  g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
+
+  if (mw->priv->calling_state == Standby) {
+    if (gtk_toggle_tool_button_get_active (b))
+      gtk_widget_hide (call_window);
+    else
+      gtk_widget_show_all (call_window);
+  }
+
   gm_conf_set_bool (VIDEO_DEVICES_KEY "enable_preview", gtk_toggle_tool_button_get_active (b));
 }
 
@@ -1661,7 +1673,7 @@ ekiga_main_window_init_actions_toolbar (EkigaMainWindow *mw)
   gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (mw->priv->preview_button),
                                      gm_conf_get_bool (VIDEO_DEVICES_KEY "enable_preview"));
   g_signal_connect (mw->priv->preview_button, "toggled",
-                    G_CALLBACK (video_preview_action_toggled_cb), NULL);
+                    G_CALLBACK (video_preview_action_toggled_cb), (gpointer) mw);
 
   /* Separator */
   item = gtk_separator_tool_item_new ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]