Re: [evolution-patches] Re: FWD: Seeking review for bug 45631, "activate popup menu in mail composer's to/cc"



On Wed, 2003-08-06 at 10:39, Mike Kestner wrote:
> +                   && event->key.keyval == GDK_F10 
> +                   && (event->key.state&GDK_SHIFT_MASK)){
> +
> +                       /* Simulate a GdkEventButton here, so that we
> can call e_text_do_popup directly */
> +
> +                       GdkEventButton *button = g_new0 (GdkEventButton,
> 1);
> +                       button->type = GDK_BUTTON_PRESS;
> +                       button->time = GDK_CURRENT_TIME;
> +                       button->button = 0;
> 
> You should probably use gdk_event_new here instead of just g_new0. 
> Also, you need to call gdk_event_free on the event when you are done
> with it.  The patch currently leaks the button struct.

and probably copy event->time from the key press event as well.

--Larry




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