eekboard: quit gracefully
This commit is contained in:
		@ -136,6 +136,8 @@ static void       on_options_menu   (GtkAction       *action,
 | 
				
			|||||||
                                     GtkWidget       *window);
 | 
					                                     GtkWidget       *window);
 | 
				
			||||||
static void       on_about          (GtkAction       *action,
 | 
					static void       on_about          (GtkAction       *action,
 | 
				
			||||||
                                     GtkWidget       *window);
 | 
					                                     GtkWidget       *window);
 | 
				
			||||||
 | 
					static void       on_quit           (GtkAction *      action,
 | 
				
			||||||
 | 
					                                     GtkWidget       *window);
 | 
				
			||||||
#if 0
 | 
					#if 0
 | 
				
			||||||
static void       on_monitor_key_event_toggled
 | 
					static void       on_monitor_key_event_toggled
 | 
				
			||||||
                                    (GtkToggleAction *action,
 | 
					                                    (GtkToggleAction *action,
 | 
				
			||||||
@ -195,7 +197,7 @@ static const GtkActionEntry action_entry[] = {
 | 
				
			|||||||
    {"FileMenu", NULL, N_("_File")},
 | 
					    {"FileMenu", NULL, N_("_File")},
 | 
				
			||||||
    {"KeyboardMenu", NULL, N_("_Keyboard")},
 | 
					    {"KeyboardMenu", NULL, N_("_Keyboard")},
 | 
				
			||||||
    {"HelpMenu", NULL, N_("_Help")},
 | 
					    {"HelpMenu", NULL, N_("_Help")},
 | 
				
			||||||
    {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, G_CALLBACK (gtk_main_quit)},
 | 
					    {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, G_CALLBACK (on_quit)},
 | 
				
			||||||
    {"Country", NULL, N_("Country"), NULL, NULL,
 | 
					    {"Country", NULL, N_("Country"), NULL, NULL,
 | 
				
			||||||
     G_CALLBACK(on_countries_menu)},
 | 
					     G_CALLBACK(on_countries_menu)},
 | 
				
			||||||
    {"Language", NULL, N_("Language"), NULL, NULL,
 | 
					    {"Language", NULL, N_("Language"), NULL, NULL,
 | 
				
			||||||
@ -237,6 +239,19 @@ on_about (GtkAction * action, GtkWidget *window)
 | 
				
			|||||||
                         "wrap-license", TRUE, NULL);
 | 
					                         "wrap-license", TRUE, NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void
 | 
				
			||||||
 | 
					on_quit (GtkAction * action, GtkWidget *window)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    Eekboard *eekboard = g_object_get_data (G_OBJECT(window), "eekboard");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    g_object_unref (eekboard->keyboard);
 | 
				
			||||||
 | 
					    g_object_unref (eekboard->layout);
 | 
				
			||||||
 | 
					    g_object_unref (eekboard->registry);
 | 
				
			||||||
 | 
					    g_object_unref (eekboard->engine);
 | 
				
			||||||
 | 
					    g_slice_free (Eekboard, eekboard);
 | 
				
			||||||
 | 
					    gtk_main_quit ();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if 0
 | 
					#if 0
 | 
				
			||||||
static gint
 | 
					static gint
 | 
				
			||||||
key_snoop (AtkKeyEventStruct *event, gpointer func_data)
 | 
					key_snoop (AtkKeyEventStruct *event, gpointer func_data)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user