--- artha-1.0.3.old/src/gui.c +++ artha-1.0.3/src/gui.c @@ -27,6 +27,7 @@ #include "config.h" #endif +#include #include "gui.h" /* Global variables */ @@ -461,6 +462,37 @@ last_lookup_a_notification = TRUE; } +/* ---------------------------------------------------------------- */ + +/* "SignalForceVisible" is a signal handler that forces the main */ +/* GUI out of the system tray (if it's been collapsed into the */ +/* tray). Note: For this routine to work as planned, the main pro- */ +/* gram must be patched as follows: */ +/* */ +/* wordnet_terms_load(gui_builder); */ +/* + MainBuilder = gui_builder; */ +/* + signal (SIGUSR1, SignalForceVisible); */ +/* + SignalForceVisible (0); */ + +static GtkBuilder *MainBuilder = NULL; + +void SignalForceVisible (int kludge) +{ + GtkComboBoxEntry *combo_query = NULL; + GtkWindow *window = NULL; + + if (MainBuilder == NULL) return; + combo_query = GTK_COMBO_BOX_ENTRY + (gtk_builder_get_object (MainBuilder, COMBO_QUERY)); + + window = GTK_WINDOW + (gtk_builder_get_object (MainBuilder, WINDOW_MAIN)); + tomboy_window_present_hardcore (window); + gtk_widget_grab_focus (GTK_WIDGET (combo_query)); +} + +/* ---------------------------------------------------------------- */ + static GdkFilterReturn hotkey_pressed(GdkXEvent *xevent, GdkEvent *event, gpointer user_data) { gchar *selection = NULL; @@ -3734,6 +3766,9 @@ WordnetTermsLoaderData loader_data = { gui_builder }; wordnet_terms_load(&loader_data); + MainBuilder = gui_builder; + signal (SIGUSR1, SignalForceVisible); + SignalForceVisible (0); gtk_main(); /* on Win32 platform, icon stays even after app close, this is