changeset 12279:234c25bc5d49

[gaim-migrate @ 14583] sf patch #1367212, from Casey Harkins 1) don't save window size when the blist is maximized 2) save whether the blist is maximized committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 01 Dec 2005 04:35:05 +0000
parents 25d7ef365dbf
children 45aa1d86428e
files src/gtkblist.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkblist.c	Thu Dec 01 01:01:26 2005 +0000
+++ b/src/gtkblist.c	Thu Dec 01 04:35:05 2005 +0000
@@ -175,6 +175,13 @@
 			gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", TRUE);
 	}
 
+	if(event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
+		if(event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
+			gaim_prefs_set_bool("/gaim/gtk/blist/list_maximized", TRUE);
+		else
+			gaim_prefs_set_bool("/gaim/gtk/blist/list_maximized", FALSE);
+	}
+
 	return FALSE;
 }
 
@@ -223,6 +230,10 @@
 		return FALSE; /* carry on normally */
 	}
 
+	/* ignore changes when maximized */
+	if(gaim_prefs_get_bool("/gaim/gtk/blist/list_maximized"))
+		return FALSE;
+
 	/* store the position */
 	gaim_prefs_set_int("/gaim/gtk/blist/x",      x);
 	gaim_prefs_set_int("/gaim/gtk/blist/y",      y);
@@ -3023,6 +3034,8 @@
 		/* ...and move it back. */
 		gtk_window_move(GTK_WINDOW(gtkblist->window), blist_x, blist_y);
 		gtk_window_resize(GTK_WINDOW(gtkblist->window), blist_width, blist_height);
+		if (gaim_prefs_get_bool("/gaim/gtk/blist/list_maximized"))
+			gtk_window_maximize(GTK_WINDOW(gtkblist->window));
 	}
 }
 
@@ -4913,6 +4926,7 @@
 	gaim_prefs_add_bool("/gaim/gtk/blist/show_empty_groups", FALSE);
 	gaim_prefs_add_bool("/gaim/gtk/blist/show_offline_buddies", FALSE);
 	gaim_prefs_add_bool("/gaim/gtk/blist/list_visible", TRUE);
+	gaim_prefs_add_bool("/gaim/gtk/blist/list_maximized", FALSE);
 	gaim_prefs_add_string("/gaim/gtk/blist/sort_type", "alphabetical");
 	gaim_prefs_add_int("/gaim/gtk/blist/x", 0);
 	gaim_prefs_add_int("/gaim/gtk/blist/y", 0);