Re: [evolution-patches] patch for review of bug 42128



this patch is wrong. since composer_keypressed_cb() returns FALSE if the
key wasn't Escape, the signal propogates to the children. The bonobo
menus are intercepting the signal and should be emitting the "activate"
signal for the menu item which should then be calling the callback that
handles cut, copy or paste.

Somehow the cut/copy/paste callbacks are not being called. Fixing that
is the correct solution.

Jeff

On Fri, 2003-05-09 at 08:35, Yuedong Du wrote:
> Hi all,
> 
> The bug lead to ctrl+c/v on composer  suject do not work.
> see  http://bugzilla.ximian.com/show_bug.cgi?id=42128
> 
> 
> Regards
> York
> 
> ______________________________________________________________________
> Index: e-msg-composer.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
> retrieving revision 1.391
> diff -u -r1.391 e-msg-composer.c
> --- e-msg-composer.c	29 Apr 2003 16:55:52 -0000	1.391
> +++ e-msg-composer.c	9 May 2003 07:27:57 -0000
> @@ -2808,12 +2808,25 @@
>  static int
>  composer_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
>  {
> +        EMsgComposer *composer = user_data;
> +        gboolean result;
> +
>  	if (event->keyval == GDK_Escape) {
>  		do_exit (E_MSG_COMPOSER (widget));
>  		
>  		g_signal_stop_emission_by_name (widget, "key-press-event");
>  		return TRUE; /* Handled.  */
>  	}
> +
> +        if (GTK_IS_ENTRY (composer->focused_entry)) {
> +                                                                                
> +                g_signal_emit_by_name(composer->focused_entry,
> +                                      "key_press_event", event, &result);
> +                if (result) {
> +                    g_signal_stop_emission_by_name (widget, "key_press_event");
> +                    return TRUE; /* Handled.  */
> +                }
> +        }
>  	
>  	return FALSE; /* Not handled. */
>  }
> @@ -2875,7 +2888,7 @@
>  	
>  	g_signal_connect (composer, "key-press-event",
>  			  G_CALLBACK (composer_key_pressed),
> -			  NULL);
> +			  composer);
>  	g_signal_connect (composer, "destroy",
>  			  G_CALLBACK (msg_composer_destroy_notify),
>  			  NULL);
> 
> ______________________________________________________________________
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
> retrieving revision 1.535
> diff -u -r1.535 ChangeLog
> --- ChangeLog	29 Apr 2003 16:55:52 -0000	1.535
> +++ ChangeLog	9 May 2003 12:15:29 -0000
> @@ -1,3 +1,9 @@
> +2003-05-09  Yuedong Du <yuedong du sun com>
> +
> +	* e-msg-composer.c(composer_key_pressed): if focus in subject,
> +	let the gtk widget handle key_pressed event first.
> +	fix bug #42128
> +
>  2003-04-28  Jeffrey Stedfast  <fejj ximian com>
>  
>  	* e-msg-composer.c (autosave_manager_query_load_orphans): Change
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]