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



On Wed, 2003-08-06 at 03:10, Gilbert Fang wrote:

>   This patch will enhance the keyboard navigation of evolution which is
> one part of our group's tasks.

Comments in-line.  Thanks for the patch.  Please resubmit after rework.

        case GDK_KEY_PRESS: /* Fall Through */
        case GDK_KEY_RELEASE:
+
+               /* Handle S-F10 key binding here. */
+
+               if (event->type == GDK_KEY_PRESS 

You should add this code to the KEY_PRESS case instead and fall through
to the KEY_RELEASE case if the popup doesn't need to be displayed.

+                   && 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.

-- 
Mike Kestner <mkestner ximian com>




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