GNOME Bugzilla – Bug 326795
"Esc" can't close the message window properly.
Last modified: 2013-09-13 00:49:02 UTC
"Esc" should close the active message window. Other information: Double click a message in the message list , then it will be show in a new window.We expect the window to be closed by "Esc", but it doesn't work.
Confirming. (Personal preference, I'm not sure how strict the HIG is WRT this, cause it's not a dialog, AFAIK.)
hmm, when composer can, why not mail window..?
Well, I didn't say we can't. Actually, my preference is to enable Esc to close the mail window and implement this. All I said is, that it likely wouldn't be correct according to HIG. I didn't read all of the HIG, though. And yes, I believe Esc clasing the Composer would be just as unwanted by the HIG as closing mail windows... If at all. So I'll leave the decision up to you.
I guess we'll do this. Its pretty handy to use (Enter and Escape) than Alt+F4.
Created attachment 57719 [details] [review] Pressing Esc key lets u close the window Please review it...
+static int +messagebrowser_key_pressed (EMMessageBrowser *emmb, GdkEventKey *event, void *user_data) +{ + if (event->keyval == GDK_Escape) { + printf("Escape pressed in e-msg-composer.c"); remove thsi printf, it's not even correct :) + gtk_widget_destroy(gtk_widget_get_toplevel((GtkWidget *)emmb)); + g_signal_stop_emission_by_name (emmb, "key-press-event"); //implemented later don't use c++ style comments in code that must compile as c89 + return TRUE; + } + + return FALSE; +} + GtkWidget *em_message_browser_window_new(void) { EMMessageBrowser *emmb; @@ -257,7 +272,7 @@ GtkWidget *em_message_browser_window_new gtk_window_set_default_size ((GtkWindow *) emmb->window, window_size.width, window_size.height); g_signal_connect (emmb->window, "size-allocate", G_CALLBACK (window_size_allocate), NULL); g_signal_connect (((EMFolderView *) emmb)->list, "message_selected", G_CALLBACK (emmb_list_message_selected), emmb); - + g_signal_connect (emmb, "key-press-event",G_CALLBACK (messagebrowser_key_pressed),NULL); put a SPACE after each comma. it just makes the code easier to read :) /* cleanup? */
Created attachment 57895 [details] [review] I have made the suggested changes
Fixed to head.