aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-07-12 01:27:52 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-07-12 16:48:15 +0800
commitee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880 (patch)
treefcc2f56caf1549cfc2bdc9850e6bb5aeb56f32b0 /libempathy-gtk
parent3535c55225076c649883aa4a497893b1f165a110 (diff)
downloadgsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar.gz
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar.bz2
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar.lz
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar.xz
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.tar.zst
gsoc2013-empathy-ee432f2c641a383ad8b32cb1ef7d2d2c2ee9c880.zip
CallWindow: save the window geometry without the sidebar
Since we don't show the sidebar when creating new call windows, we should not take the sidebar into account when saving the window geometry. https://bugzilla.gnome.org/show_bug.cgi?id=634809
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-geometry.c47
-rw-r--r--libempathy-gtk/empathy-geometry.h7
2 files changed, 38 insertions, 16 deletions
diff --git a/libempathy-gtk/empathy-geometry.c b/libempathy-gtk/empathy-geometry.c
index b549b8bad..986015452 100644
--- a/libempathy-gtk/empathy-geometry.c
+++ b/libempathy-gtk/empathy-geometry.c
@@ -126,14 +126,15 @@ geometry_get_key_file (void)
return key_file;
}
-static void
-empathy_geometry_save (GtkWindow *window)
+void
+empathy_geometry_save_values (GtkWindow *window,
+ gint x,
+ gint y,
+ gint w,
+ gint h,
+ gboolean maximized)
{
GKeyFile *key_file;
- GdkWindow *gdk_window;
- GdkWindowState window_state;
- gint x, y, w, h;
- gboolean maximized;
gchar *position_str = NULL;
GHashTable *names;
GHashTableIter iter;
@@ -144,16 +145,6 @@ empathy_geometry_save (GtkWindow *window)
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (names != NULL);
- if (!gtk_widget_get_visible (GTK_WIDGET (window)))
- return;
-
- /* Get window geometry */
- gtk_window_get_position (window, &x, &y);
- gtk_window_get_size (window, &w, &h);
- gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- window_state = gdk_window_get_state (gdk_window);
- maximized = (window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
-
/* Don't save off-screen positioning */
if (!EMPATHY_RECT_IS_ON_SCREEN (x, y, w, h))
return;
@@ -190,6 +181,30 @@ empathy_geometry_save (GtkWindow *window)
}
static void
+empathy_geometry_save (GtkWindow *window)
+{
+ GdkWindow *gdk_window;
+ GdkWindowState window_state;
+ gboolean maximized;
+ gint x, y, w, h;
+
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
+ if (!gtk_widget_get_visible (GTK_WIDGET (window)))
+ return;
+
+ /* Get window geometry */
+ gtk_window_get_position (window, &x, &y);
+ gtk_window_get_size (window, &w, &h);
+
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ window_state = gdk_window_get_state (gdk_window);
+ maximized = (window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
+
+ empathy_geometry_save_values (window, x, y, w, h, maximized);
+}
+
+static void
empathy_geometry_load (GtkWindow *window,
const gchar *name)
{
diff --git a/libempathy-gtk/empathy-geometry.h b/libempathy-gtk/empathy-geometry.h
index 80ea92ebf..f9f85c1c9 100644
--- a/libempathy-gtk/empathy-geometry.h
+++ b/libempathy-gtk/empathy-geometry.h
@@ -35,6 +35,13 @@ void empathy_geometry_bind (GtkWindow *window,
void empathy_geometry_unbind (GtkWindow *window,
const gchar *name);
+void empathy_geometry_save_values (GtkWindow *window,
+ gint x,
+ gint y,
+ gint w,
+ gint h,
+ gboolean maximized);
+
G_END_DECLS
#endif /* __EMPATHY_GEOMETRY_H__ */