# HG changeset patch # User Luke Schierer # Date 1036984680 0 # Node ID 49d42b275a684a29d2272bbc30c6b2b63d6a4a8c # Parent 5e390f6f8efce96c3f42107f9618eb980b5dff67 [gaim-migrate @ 4115] .todo file spelling fixes. (22:11:39) Robot101: Fixes bug with multiple consecutive docklet clicks not correctly showing and hiding the blist (22:12:26) Robot101: Fixes compile warning in docklet.c the correct way (without adding a default to the switch on an enum) (22:12:53) Robot101: Avoids the blist being moved off-screen by the position remembering code, and does the move before showing it instead of after (22:13:50) Robot101: Fix evil behaviour with disappearing blists when you switch desktop or minimise by removing the silly code (22:14:24) Robot101: Replace it with nice code that raises the blist when you click the docklet if it's fully obscured committer: Tailor Script diff -r 5e390f6f8efc -r 49d42b275a68 .todo --- a/.todo Mon Nov 11 02:50:14 2002 +0000 +++ b/.todo Mon Nov 11 03:18:00 2002 +0000 @@ -1,4 +1,4 @@ - + DISCUSSION: entries here are things i'm not sure are desirable or doable. @@ -80,9 +80,6 @@ UI stuff - - buddy ticker stays arou+nd when you sign off - showing the buddies who were online - text like <font color=blah>with only some text</font> being colored causes the whole line to be colored. @@ -242,6 +239,9 @@ im image + + buddy ticker stays around when you sign off - showing the buddies who were online + Prefs stuff @@ -798,16 +798,16 @@ File Transfer (do we really want this?) - - Zepher - - God help us. - - gtk1-stable with option to not report idle times set, gaim does not come back from auto-away. this is i most likely an issue for cvs also. + + Zephyr + + God help us. + + diff -r 5e390f6f8efc -r 49d42b275a68 plugins/docklet/docklet.c --- a/plugins/docklet/docklet.c Mon Nov 11 02:50:14 2002 +0000 +++ b/plugins/docklet/docklet.c Mon Nov 11 03:18:00 2002 +0000 @@ -164,6 +164,9 @@ } static void docklet_clicked(GtkWidget *button, GdkEventButton *event, void *data) { + if (event->type != GDK_BUTTON_PRESS) + return; + switch (event->button) { case 1: if (unread_message_queue) { @@ -182,7 +185,7 @@ } static void docklet_update_icon() { - gchar *filename; + gchar *filename = NULL; GdkPixbuf *unscaled; switch (status) { @@ -201,7 +204,7 @@ case connecting: filename = g_build_filename(DATADIR, "pixmaps", "gaim", "connect.png", NULL); break; - default: + case offline: filename = g_build_filename(DATADIR, "pixmaps", "gaim", "offline.png", NULL); } diff -r 5e390f6f8efc -r 49d42b275a68 src/buddy.c --- a/src/buddy.c Mon Nov 11 02:50:14 2002 +0000 +++ b/src/buddy.c Mon Nov 11 03:18:00 2002 +0000 @@ -101,6 +101,7 @@ static GSList *shows = NULL; int docklet_count = 0; +static gboolean obscured = FALSE; /* Predefine some functions */ static void new_bp_callback(GtkWidget *w, struct buddy *bs); @@ -2021,11 +2022,25 @@ /* mostly used by code in this file */ void unhide_buddy_list() { if (blist) { - gtk_window_present(GTK_WINDOW(blist)); if (blist_options & OPT_BLIST_SAVED_WINDOWS && blist_pos.width != 0) { + /* don't move it off screen */ + if (blist_pos.x >= gdk_screen_width()) { + blist_pos.x = gdk_screen_width() - 100; + } else if (blist_pos.x <= 0) { + blist_pos.x = 100; + } + + if (blist_pos.y >= gdk_screen_height()) { + blist_pos.y = gdk_screen_height() - 100; + } else if (blist_pos.y <= 0) { + blist_pos.y = 100; + } + gtk_window_move(GTK_WINDOW(blist), blist_pos.x, blist_pos.y); gtk_window_resize(GTK_WINDOW(blist), blist_pos.width, blist_pos.height); } + + gtk_window_present(GTK_WINDOW(blist)); } } @@ -2061,7 +2076,7 @@ buddy list/login window--depending on which is active */ if (connections && blist) { if (GTK_WIDGET_VISIBLE(blist)) { - if (GAIM_WINDOW_ICONIFIED(blist)) { + if (GAIM_WINDOW_ICONIFIED(blist) || obscured) { unhide_buddy_list(); } else { hide_buddy_list(); @@ -2472,10 +2487,11 @@ } } -static void change_state_blist_window(GtkWidget *w, GdkEventWindowState *event, void *dummy) { - if (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED && - docklet_count) { - gtk_widget_hide(blist); +static void visibility_blist_window(GtkWidget *w, GdkEventVisibility *event, void *data) { + if (event->state == GDK_VISIBILITY_FULLY_OBSCURED) { + obscured = TRUE; + } else { + obscured = FALSE; } } @@ -2785,7 +2801,9 @@ g_signal_connect(G_OBJECT(blist), "delete_event", G_CALLBACK(close_buddy_list), NULL); g_signal_connect(G_OBJECT(blist), "configure_event", G_CALLBACK(configure_blist_window), NULL); - g_signal_connect(G_OBJECT(blist), "window_state_event", G_CALLBACK(change_state_blist_window), NULL); + g_signal_connect(G_OBJECT(blist), "visibility_notify_event", G_CALLBACK(visibility_blist_window), NULL); + + gtk_widget_add_events(blist, GDK_VISIBILITY_NOTIFY_MASK); /* The edit tree */ gtk_container_add(GTK_CONTAINER(tbox), edittree);