aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:41:59 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:41:59 +0800
commit70a2a0c5f4d091e765ff4d8108e28a63bcf48b47 (patch)
treeb070c1d4ff625b3499049dcb1164c08833abdb49 /src
parent7c19aa9fc5d0c348c1354829f31f3ab5be73f67b (diff)
downloadgsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar.gz
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar.bz2
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar.lz
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar.xz
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.tar.zst
gsoc2013-empathy-70a2a0c5f4d091e765ff4d8108e28a63bcf48b47.zip
Fix load/save chat geometry
svn path=/trunk/; revision=844
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c57
-rw-r--r--src/empathy-chat-window.h10
2 files changed, 19 insertions, 48 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index eef891182..c9396fe7d 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -558,6 +558,22 @@ chat_window_info_activate_cb (GtkWidget *menuitem,
FALSE, FALSE);
}
+static const gchar *
+chat_get_window_id_for_geometry (EmpathyChat *chat)
+{
+ gboolean separate_windows;
+
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS,
+ &separate_windows);
+
+ if (separate_windows) {
+ return empathy_chat_get_id (chat);
+ } else {
+ return "chat-window";
+ }
+}
+
static gboolean
chat_window_save_geometry_timeout_cb (EmpathyChatWindow *window)
{
@@ -569,7 +585,8 @@ chat_window_save_geometry_timeout_cb (EmpathyChatWindow *window)
gtk_window_get_size (GTK_WINDOW (priv->dialog), &w, &h);
gtk_window_get_position (GTK_WINDOW (priv->dialog), &x, &y);
- empathy_chat_save_geometry (priv->current_chat, x, y, w, h);
+ empathy_geometry_save (chat_get_window_id_for_geometry (priv->current_chat),
+ x, y, w, h);
priv->save_geometry_id = 0;
@@ -1597,7 +1614,7 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
/* Reference the chat object */
g_object_ref (chat);
- empathy_chat_load_geometry (chat, &x, &y, &w, &h);
+ empathy_geometry_load (chat_get_window_id_for_geometry (chat), x, y, w, h);
if (x >= 0 && y >= 0) {
/* Let the window manager position it if we don't have
@@ -1790,40 +1807,4 @@ chat_should_play_sound (EmpathyChat *chat)
return !has_focus;
}
-static const gchar *
-chat_get_window_id_for_geometry (EmpathyChat *chat)
-{
- gboolean separate_windows;
-
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS,
- &separate_windows);
-
- if (separate_windows) {
- return empathy_chat_get_id (chat);
- } else {
- return "chat-window";
- }
-}
-
-void
-empathy_chat_save_geometry (EmpathyChat *chat,
- gint x,
- gint y,
- gint w,
- gint h)
-{
- empathy_geometry_save (chat_get_window_id_for_geometry (chat), x, y, w, h);
-}
-
-void
-empathy_chat_load_geometry (EmpathyChat *chat,
- gint *x,
- gint *y,
- gint *w,
- gint *h)
-{
- empathy_geometry_load (chat_get_window_id_for_geometry (chat), x, y, w, h);
-}
-
diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h
index 893642e7c..bf4cad27a 100644
--- a/src/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -71,16 +71,6 @@ gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window
EmpathyChat * empathy_chat_window_find_chat (McAccount *account,
const gchar *id);
void empathy_chat_window_present_chat (EmpathyChat *chat);
-void empathy_chat_save_geometry (EmpathyChat *chat,
- gint x,
- gint y,
- gint w,
- gint h);
-void empathy_chat_load_geometry (EmpathyChat *chat,
- gint *x,
- gint *y,
- gint *w,
- gint *h);
G_END_DECLS