[ekiga/ds-gsettings3] Fixed flickering effect when windows are shown.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gsettings3] Fixed flickering effect when windows are shown.
- Date: Wed, 30 Oct 2013 19:12:07 +0000 (UTC)
commit be59b028d59893babee911733b08bb7be4829fca
Author: Damien Sandras <dsandras beip be>
Date: Wed Oct 30 20:07:04 2013 +0100
Fixed flickering effect when windows are shown.
This was due to the fact the window was first shown, then moved to the
last saved position. This seems to be "new" with GTK3. We can now move
the window to the correct position when the realize signal is emitted.
That prevents the flickering effect. However, it requires the GmWindow
to be initialized from the start with the correct GSettings key. The
call window and the main window were the only one with a differed key
setup. This is now fixed too.
The former gm_window_set_key methods have been removed as they can not
be used anymore.
lib/engine/gui/gtk-frontend/call-window.cpp | 9 ++++-----
lib/engine/gui/gtk-frontend/main_window.cpp | 5 +++--
lib/gui/gmwindow.c | 23 ++++++-----------------
lib/gui/gmwindow.h | 12 ------------
4 files changed, 13 insertions(+), 36 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index 0c091fe..efa1c16 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -2616,7 +2616,10 @@ call_window_new (Ekiga::ServiceCore & core)
{
EkigaCallWindow *cw;
- cw = EKIGA_CALL_WINDOW (g_object_new (EKIGA_TYPE_CALL_WINDOW, NULL));
+ cw = EKIGA_CALL_WINDOW (g_object_new (EKIGA_TYPE_CALL_WINDOW,
+ "key", USER_INTERFACE ".call-window",
+ "hide_on_delete", false,
+ "hide_on_esc", false, NULL));
cw->priv->libnotify = core.get ("libnotify");
cw->priv->videoinput_core = core.get<Ekiga::VideoInputCore> ("videoinput-core");
@@ -2632,10 +2635,6 @@ call_window_new (Ekiga::ServiceCore & core)
gm_conf_notifier_add (VIDEO_DISPLAY_KEY "stay_on_top",
stay_on_top_changed_nt, cw);
- gm_window_set_key (GM_WINDOW (cw), USER_INTERFACE ".call-window");
- gm_window_set_hide_on_delete (GM_WINDOW (cw), false);
- gm_window_set_hide_on_escape (GM_WINDOW (cw), false);
-
gtk_window_set_title (GTK_WINDOW (cw), _("Call Window"));
return GTK_WIDGET (cw);
diff --git a/lib/engine/gui/gtk-frontend/main_window.cpp b/lib/engine/gui/gtk-frontend/main_window.cpp
index 2ecec98..c1d297c 100644
--- a/lib/engine/gui/gtk-frontend/main_window.cpp
+++ b/lib/engine/gui/gtk-frontend/main_window.cpp
@@ -1608,8 +1608,9 @@ gm_main_window_new (Ekiga::ServiceCore & core)
EkigaMainWindow *mw;
/* basic gtk+ setup */
- mw = EKIGA_MAIN_WINDOW (g_object_new (EKIGA_TYPE_MAIN_WINDOW, NULL));
- gm_window_set_key (GM_WINDOW (mw), USER_INTERFACE ".main-window");
+ mw = EKIGA_MAIN_WINDOW (g_object_new (EKIGA_TYPE_MAIN_WINDOW,
+ "key", USER_INTERFACE ".main-window",
+ NULL));
/* fetching needed engine objects */
diff --git a/lib/gui/gmwindow.c b/lib/gui/gmwindow.c
index 9611944..447dd23 100644
--- a/lib/gui/gmwindow.c
+++ b/lib/gui/gmwindow.c
@@ -71,8 +71,8 @@ gm_window_delete_event_cb (GtkWidget *w,
gpointer data);
static void
-window_show_cb (GtkWidget *w,
- gpointer data);
+window_realize_cb (GtkWidget *w,
+ gpointer data);
static void
window_hide_cb (GtkWidget *w,
@@ -224,8 +224,8 @@ gm_window_init (GmWindow* self)
g_signal_connect (self, "delete-event",
G_CALLBACK (gm_window_delete_event_cb), NULL);
- g_signal_connect (self, "show",
- G_CALLBACK (window_show_cb), self);
+ g_signal_connect (self, "realize",
+ G_CALLBACK (window_realize_cb), self);
g_signal_connect (self, "hide",
G_CALLBACK (window_hide_cb), self);
@@ -256,8 +256,8 @@ gm_window_delete_event_cb (GtkWidget *w,
static void
-window_show_cb (GtkWidget *w,
- G_GNUC_UNUSED gpointer data)
+window_realize_cb (GtkWidget *w,
+ G_GNUC_UNUSED gpointer data)
{
int x = 0;
int y = 0;
@@ -372,17 +372,6 @@ gm_window_new_with_key (const char *key)
void
-gm_window_set_key (GmWindow *window,
- const char *key)
-{
- g_return_if_fail (GM_IS_WINDOW (window));
- g_return_if_fail (key != NULL);
-
- g_object_set (window, "key", key, NULL);
-}
-
-
-void
gm_window_get_size (GmWindow *self,
int *x,
int *y)
diff --git a/lib/gui/gmwindow.h b/lib/gui/gmwindow.h
index 171f748..f64631b 100644
--- a/lib/gui/gmwindow.h
+++ b/lib/gui/gmwindow.h
@@ -64,9 +64,6 @@ struct _GmWindowClass
/* Public API */
/** Create a new GmWindow.
- * It will be necessary to call gm_window_set_key
- * in order to allow saving and restoring the position
- * and size of the GmWindow.
* @return A GmWindow
*/
GtkWidget *gm_window_new ();
@@ -80,15 +77,6 @@ GtkWidget *gm_window_new ();
GtkWidget *gm_window_new_with_key (const char *key);
-/** Set a new key for a given GmWindow.
- * @param window is the GmWindow and key
- * is the key where the position and size of the
- * window will be saved.
- */
-void gm_window_set_key (GmWindow *window,
- const char *key);
-
-
/** Return the size of the GmWindow.
* @param window is the GmWindow
* @param x is the width
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]