changeset 3939:49d42b275a68

[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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 11 Nov 2002 03:18:00 +0000
parents 5e390f6f8efc
children f01dc9881321
files .todo plugins/docklet/docklet.c src/buddy.c
diffstat 3 files changed, 40 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/.todo	Mon Nov 11 02:50:14 2002 +0000
+++ b/.todo	Mon Nov 11 03:18:00 2002 +0000
@@ -1,4 +1,4 @@
-<!-- Automagically generated by the ToDo program on Sun Nov 10 21:48:44 2002 -->
+<!-- Automagically generated by the ToDo program on Sun Nov 10 22:08:29 2002 -->
 <todo version="0.1.14">
     <note priority="verylow" time="1036026433">
         DISCUSSION: entries here are things i'm not sure are desirable or doable.
@@ -80,9 +80,6 @@
     </note>
     <note priority="high" time="1036029816">
         UI stuff
-        <note priority="low" time="1035995742">
-            buddy ticker stays arou+nd when you sign off - showing the buddies who were online
-        </note>
         <note priority="medium" time="1035995788">
             text like &lt;font color=blah&gt;with only some text&lt;/font&gt; being colored causes the whole line to be colored.
         </note>
@@ -242,6 +239,9 @@
                 im image
             </note>
         </note>
+        <note priority="low" time="1035995742">
+            buddy ticker stays around when you sign off - showing the buddies who were online
+        </note>
     </note>
     <note priority="high" time="1036029923">
         Prefs stuff
@@ -798,16 +798,16 @@
             File Transfer (do we really want this?)
         </note>
     </note>
-    <note priority="medium" time="1036040706">
-        Zepher
-        <note priority="veryhigh" time="1036046748">
-            God help us.
-        </note>
-    </note>
     <note priority="high" time="1036978099">
         gtk1-stable
         <note priority="medium" time="1036978230">
             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.
         </note>
     </note>
+    <note priority="medium" time="1036040706">
+        Zephyr
+        <note priority="veryhigh" time="1036046748">
+            God help us.
+        </note>
+    </note>
 </todo>
--- 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);
 	}
 
--- 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);