Mercurial > pidgin
comparison src/buddy.c @ 4108:274cb26ba8dc
[gaim-migrate @ 4323]
(21:13:00) Robot101: little docklet description change, respacing messy file transfer entries in struct
aim_user, fixing retrieval of window position, and avoiding un-needed moves of the blist
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 21 Dec 2002 02:14:02 +0000 |
parents | 4b04ecb3eb97 |
children | 4efc492cf16f |
comparison
equal
deleted
inserted
replaced
4107:06435b94c3d7 | 4108:274cb26ba8dc |
---|---|
2006 } | 2006 } |
2007 | 2007 |
2008 /* mostly used by code in this file */ | 2008 /* mostly used by code in this file */ |
2009 void unhide_buddy_list() { | 2009 void unhide_buddy_list() { |
2010 if (blist) { | 2010 if (blist) { |
2011 if (blist_options & OPT_BLIST_SAVED_WINDOWS && blist_pos.width != 0) { | 2011 if (!GTK_WIDGET_VISIBLE(blist) && blist_options & OPT_BLIST_SAVED_WINDOWS && |
2012 blist_pos.width != 0) { | |
2012 /* don't move it off screen */ | 2013 /* don't move it off screen */ |
2013 if (blist_pos.x >= gdk_screen_width()) { | 2014 if (blist_pos.x >= gdk_screen_width()) { |
2014 blist_pos.x = gdk_screen_width() - 100; | 2015 blist_pos.x = gdk_screen_width() - 100; |
2015 } else if (blist_pos.x <= 0) { | 2016 } else if (blist_pos.x <= 0) { |
2016 blist_pos.x = 100; | 2017 blist_pos.x = 100; |
2468 bs->sound = 1; | 2469 bs->sound = 1; |
2469 } | 2470 } |
2470 } | 2471 } |
2471 | 2472 |
2472 static void configure_blist_window(GtkWidget *w, GdkEventConfigure *event, void *data) { | 2473 static void configure_blist_window(GtkWidget *w, GdkEventConfigure *event, void *data) { |
2473 if (event->x != blist_pos.x || | 2474 /* unfortunately GdkEventConfigure ignores the window gravity, but * |
2474 event->y != blist_pos.y || | 2475 * the only way we have of setting the position doesn't. we have to * |
2475 event->width != blist_pos.width || | 2476 * call get_position and get_size because they do pay attention to * |
2476 event->height != blist_pos.height) { | 2477 * the gravity. this is inefficient and I agree it sucks, but it's * |
2477 blist_pos.x = event->x > 0 ? event->x : 0; | 2478 * more likely to work correctly. - Robot101 */ |
2478 blist_pos.y = event->y > 0 ? event->y : 0; | 2479 gint x, y, width, height; |
2479 blist_pos.width = event->width; | 2480 |
2480 blist_pos.height = event->height; | 2481 gtk_window_get_position(GTK_WINDOW(blist), &x, &y); |
2482 gtk_window_get_size(GTK_WINDOW(blist), &width, &height); | |
2483 | |
2484 if (x != blist_pos.x || | |
2485 y != blist_pos.y || | |
2486 width != blist_pos.width || | |
2487 height != blist_pos.height) { | |
2488 blist_pos.x = x; | |
2489 blist_pos.y = y; | |
2490 blist_pos.width = width; | |
2491 blist_pos.height = height; | |
2481 save_prefs(); | 2492 save_prefs(); |
2482 } | 2493 } |
2483 } | 2494 } |
2484 | 2495 |
2485 static void visibility_blist_window(GtkWidget *w, GdkEventVisibility *event, void *data) { | 2496 static void visibility_blist_window(GtkWidget *w, GdkEventVisibility *event, void *data) { |