Mercurial > pidgin
changeset 3540:785292d72aed
[gaim-migrate @ 3615]
fixed the saving of the buddy list possition and size(thanks robot101)
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 23 Sep 2002 01:31:26 +0000 |
parents | 88a0068fc048 |
children | 593567405d48 |
files | src/buddy.c |
diffstat | 1 files changed, 15 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy.c Sat Sep 21 23:55:09 2002 +0000 +++ b/src/buddy.c Mon Sep 23 01:31:26 2002 +0000 @@ -2036,12 +2036,9 @@ void unhide_buddy_list() { if (blist) { gtk_window_present(GTK_WINDOW(blist)); - if (blist_options & OPT_BLIST_SAVED_WINDOWS) { - if (blist_pos.width != 0) { /* Sanity check! */ - gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff, - blist_pos.y - blist_pos.yoff); - gtk_widget_set_usize(blist, blist_pos.width, blist_pos.height); - } + if (blist_options & OPT_BLIST_SAVED_WINDOWS && blist_pos.width != 0) { + gtk_window_move(GTK_WINDOW(blist), blist_pos.x, blist_pos.y); + gtk_window_resize(GTK_WINDOW(blist), blist_pos.width, blist_pos.height); } } } @@ -2448,35 +2445,19 @@ } } - -static void move_blist_window(GtkWidget *w, GdkEventConfigure *e, void *dummy) -{ - int x, y, width, height; - int save = 0; - gdk_window_get_position(blist->window, &x, &y); - gdk_window_get_size(blist->window, &width, &height); - - if (e->send_event) { /* Is a position event */ - if (blist_pos.x != x || blist_pos.y != y) - save = 1; - blist_pos.x = x; - blist_pos.y = y; - } else { /* Is a size event */ - if (blist_pos.xoff != x || blist_pos.yoff != y || blist_pos.width != width || blist_pos.height != height) - save = 1; - - blist_pos.width = width; - blist_pos.height = height; - blist_pos.xoff = x; - blist_pos.yoff = y; +static void configure_blist_window(GtkWidget *w, GdkEventConfigure *event, void *data) { + if (event->x != blist_pos.x || + event->y != blist_pos.y || + event->width != blist_pos.width || + event->height != blist_pos.height) { + blist_pos.x = event->x; + blist_pos.y = event->y; + blist_pos.width = event->width; + blist_pos.height = event->height; + save_prefs(); } - - if (save) - save_prefs(); - } - /******************************************************************* * * Helper funs for making the menu @@ -2671,6 +2652,7 @@ gtk_widget_realize(blist); + gtk_window_set_gravity(GTK_WINDOW(blist), GDK_GRAVITY_STATIC); gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE); accel = gtk_accel_group_new(); @@ -2909,7 +2891,7 @@ gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(close_buddy_list), NULL); - gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(move_blist_window), + gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(configure_blist_window), NULL);