[Commits] addr_compl.c 1.27.2.58 1.27.2.59

colin at claws-mail.org colin at claws-mail.org
Sat Oct 29 15:54:30 CEST 2011


Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv11980/src

Modified Files:
      Tag: gtk2
	addr_compl.c 
Log Message:
2011-10-29 [colin]	3.7.10cvs57

	* src/addr_compl.c
		Fix focus of completion window with gnome shell

Index: addr_compl.c
===================================================================
RCS file: /home/claws-mail/claws/src/addr_compl.c,v
retrieving revision 1.27.2.58
retrieving revision 1.27.2.59
diff -u -d -r1.27.2.58 -r1.27.2.59
--- addr_compl.c	22 Oct 2011 17:09:02 -0000	1.27.2.58
+++ addr_compl.c	29 Oct 2011 13:54:28 -0000	1.27.2.59
@@ -849,13 +849,20 @@
 	gtk_widget_hide_all( cw->window );
 	gtk_widget_show_all( cw->window );
 	gtk_widget_size_request( cw->list_view, &r );
-
+printf("%d  + %d < %d\n", y, r.height, gdk_screen_height());
 	/* Adjust window height to available screen space */
-	if( ( y + r.height ) > gdk_screen_height() ) {
-		gtk_window_set_resizable(GTK_WINDOW(cw->window), FALSE);
-		gtk_widget_set_size_request( cw->window, width, gdk_screen_height() - y );
-	} else
-		gtk_widget_set_size_request(cw->window, width, r.height);
+	if( y + r.height > gdk_screen_height())
+		r.height = gdk_screen_height() - y;
+
+	gtk_widget_set_size_request(cw->window, width, r.height);
+
+	gdk_pointer_grab(gtk_widget_get_window(cw->window), TRUE,
+			 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
+			 GDK_BUTTON_RELEASE_MASK,
+			 NULL, NULL, GDK_CURRENT_TIME);
+	gdk_keyboard_grab(gtk_widget_get_window(cw->window), FALSE, GDK_CURRENT_TIME);
+	gtk_grab_add(cw->window);
+
 }
 
 static GdkPixbuf *group_pixbuf = NULL;
@@ -1370,13 +1377,8 @@
 			 GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK |
 			 GDK_BUTTON_RELEASE_MASK,
 			 NULL, NULL, GDK_CURRENT_TIME);
+	gdk_keyboard_grab(gtk_widget_get_window(window), FALSE, GDK_CURRENT_TIME);
 	gtk_grab_add( window );
-
-	/* XXX: GTK2 too??? 
-	 *
-	 * GTK1: this gets rid of the irritating focus rectangle that doesn't
-	 * follow the selection */
-	gtkut_widget_set_can_focus(list_view, FALSE);
 }
 
 /**



More information about the Commits mailing list