Control: tags -1 + patch
Control: block -1 with 955873

Please find attached a patch -- I tested it a lot but chances are that
I've missed something.

As there is no GtkStatusIcon (aka "trayicon") anymore, the
notifications are sent when the window is closed (and of course, when
they are enabled which was and still is the default).

The "Notify" toolbar item is now permanent (unlike in the original
code) because if a user disables notifications there is no way to
enable them again apart from editing the configuration file (since
there is no systray icon with a popup menu having a "Notify"
GtkCheckMenuItem).

Also please note that this patch formally depends on the patch I sent
to #955873 (hence the block) as that patch is its parent.  It cannot
be applied cleanly to current git master because of that but otherwise
this bug does not depend on it; they're completely orthogonal.
>From 5c15a90a1b6e4f912d1fd326d055c4bca2093ea6 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <ya...@gnu.org>
Date: Fri, 8 Mar 2024 00:26:46 +0200
Subject: [PATCH] Port to GTK 3 (#967258)

---
 debian/changelog          |    4 +-
 debian/control            |    3 +-
 debian/patches/gtk3.patch | 2406 +++++++++++++++++++++++++++++++++++++
 debian/patches/series     |    1 +
 4 files changed, 2411 insertions(+), 3 deletions(-)
 create mode 100644 debian/patches/gtk3.patch

diff --git a/debian/changelog b/debian/changelog
index abf4b48..5086ebd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,10 @@ artha (1.0.5-4) UNRELEASED; urgency=medium
   * Team upload.
   * debian/patches/no-dbus-glib.patch: New; stop using dbus-glib in favor
     of dbus-gmain as recommended (Closes: #955873).
+  * debian/patches/gtk3.patch: New; port to GTK 3 (Closes: #967258).
   * debian/control (Build-Depends): Replace libdbus-glib-1-dev with
-    libdbus-1-dev.
+    libdbus-1-dev and libgtk2.0-dev with libgtk-3-dev.
+    (Recommends): Drop libnotify4, the program uses GNotification now.
 
  -- Yavor Doganov <ya...@gnu.org>  Mon, 04 Mar 2024 16:53:11 +0200
 
diff --git a/debian/control b/debian/control
index 83103fa..d2cc751 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Section: utils
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                wordnet-dev,
-               libgtk2.0-dev,
+               libgtk-3-dev,
                libdbus-1-dev
 Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/science-team/artha
@@ -20,7 +20,6 @@ Depends: ${misc:Depends},
          ${shlibs:Depends},
          wordnet
 Recommends: wordnet-sense-index,
-            libnotify4,
             libenchant-2-2
 Suggests: aspell-en
 Description: Handy off-line thesaurus based on WordNet
diff --git a/debian/patches/gtk3.patch b/debian/patches/gtk3.patch
new file mode 100644
index 0000000..2fa388a
--- /dev/null
+++ b/debian/patches/gtk3.patch
@@ -0,0 +1,2406 @@
+Description: Port to GTK 3.
+Bug-Debian: https://bugs.debian.org/967258
+Author: Yavor Doganov <ya...@gnu.org>
+Forwarded: no
+Last-Update: 2024-03-08
+---
+
+--- artha.orig/configure.ac
++++ artha/configure.ac
+@@ -55,12 +55,10 @@
+ AC_SUBST([WORDNET_LIB])
+ 
+ 
+-# GtkComboBox with entry only since 2.24 only, hence check for GTK+-2.0 >= 
2.24
+-# check for GTK+ and GLib
+-PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.24 glib-2.0 >= 2.40], , [
++PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.21.4 glib-2.0 >= 2.40], , [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
+-You must have GTK+ 2.0 (version 2.24 or above) and GLib 2.0 (version 2.40
++You must have GTK+ 3.0 (version 3.21.4 or above) and GLib 2.0 (version 2.40
+ or above) development headers installed to build.
+ 
+ If you have these installed already you may need to install pkg-config so 
+--- artha.orig/src/gui.c
++++ artha/src/gui.c
+@@ -54,7 +54,7 @@
+ static gboolean               was_double_click = FALSE, 
last_search_successful = FALSE, advanced_mode = FALSE, auto_contract = FALSE;
+ static gboolean               hotkey_set = FALSE, mod_suggest = FALSE;
+ // options which default to true
+-static gboolean               notifier_enabled = TRUE, show_polysemy = TRUE, 
launch_minimized = TRUE, show_trayicon = TRUE;
++static gboolean               notifier_enabled = TRUE, show_polysemy = TRUE, 
launch_minimized = TRUE;
+ static gboolean               last_lookup_a_notification = FALSE;
+ static gchar          last_search[MAX_LEMMA_LEN] = "";
+ #ifdef X11_AVAILABLE
+@@ -63,13 +63,11 @@
+ guint32                       last_hotkey_time = 0;
+ static guint                  num_lock_mask = 0, caps_lock_mask = 0, 
scroll_lock_mask = 0;
+ #endif
+-static guint                  hotkey_trials[] = {GDK_w, GDK_a, GDK_t, GDK_q};
++static guint                  hotkey_trials[] = {GDK_KEY_w, GDK_KEY_a, 
GDK_KEY_t, GDK_KEY_q};
+ GtkAccelKey           app_hotkey = {0};
+ static gint                   notify_toolbar_index = -1;
+ static guint                  status_msg_context_id = 0;
+ static GString                        *wordnet_terms = NULL;
+-NotifyNotification    *mod_notifier = NULL;
+-static GtkCheckMenuItem       *menu_notify = NULL;
+ static GKeyFile                       *config_file = NULL;
+       
+ #ifdef G_OS_WIN32
+@@ -83,9 +81,9 @@
+ static int x_error_handler(Display *dpy, XErrorEvent *xevent);
+ #endif        // X11_AVAILABLE
+ static void show_window(GtkWindow *window);
++static void send_notification(gboolean normal, gchar *title, gchar *body);
+ static void notification_toggled(GObject *obj, gpointer user_data);
+ static void mode_toggled(GtkToggleToolButton *toggle_button, gpointer 
user_data);
+-static void trayicon_menu_toggled(GtkMenuItem *menu, GtkBuilder *gui_builder);
+ static gchar* strip_invalid_edges(gchar *selection);
+ static gchar* strip_non_alpha_num(const gchar *str);
+ static gboolean are_same_after_strip(const gchar *strA, const gchar *strB);
+@@ -97,8 +95,6 @@
+ #endif
+ static void notification_lookup(gchar *selection, GtkComboBox *combo_query);
+ static GdkFilterReturn hotkey_pressed(GdkXEvent *xevent, GdkEvent *event, 
gpointer user_data);
+-static void status_icon_activate(GtkStatusIcon *status_icon, gpointer 
user_data);
+-static void status_icon_popup(GtkStatusIcon *status_icon, guint button, guint 
active_time, gpointer user_data);
+ static void about_response_handle(GtkDialog *about_dialog, gint response_id, 
gpointer user_data);
+ static void about_activate(GtkToolButton *menu_item, gpointer user_data);
+ static void quit_activate(GtkWidget *widget, gpointer user_data);
+@@ -153,7 +149,6 @@
+ static gboolean close_window(GtkAccelGroup *accel_group, GObject 
*acceleratable, guint keyval,
+                                                        GdkModifierType 
modifier, GObject *user_data);
+ static void setup_toolbar(GtkBuilder *gui_builder);
+-static GtkMenu *create_popup_menu(GtkBuilder *gui_builder);
+ static void create_text_view_tags(GtkBuilder *gui_builder);
+ static void load_preference_hotkey(gboolean *first_run);
+ static gboolean load_preferences(GtkWindow *parent);
+@@ -198,7 +193,6 @@
+ static void setup_settings_dialog(GtkBuilder *gui_builder);
+ static void set_settings_to_check_boxes(GtkBuilder *gui_builder);
+ static void get_settings_from_check_boxes(GtkBuilder *gui_builder,
+-                                                                              
        gboolean *new_trayicon_show,
+                                                                               
        gboolean *new_launch_min,
+                                                                               
        gboolean *new_polysemy_show);
+ static void apply_and_save_settings(GtkBuilder *gui_builder);
+@@ -248,9 +242,9 @@
+       g_object_get(obj, "active", &notifier_enabled, NULL);
+ 
+       g_object_set(G_OBJECT(toolbar_notify), "active", notifier_enabled, 
NULL);
+-      gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(toolbar_notify), 
notifier_enabled ? GTK_STOCK_YES : GTK_STOCK_NO);
+ 
+-      gtk_check_menu_item_set_active(menu_notify, notifier_enabled);
++      gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_notify),
++                                notifier_enabled ? "_Yes" : "_No");
+ 
+       save_preferences();
+ 
+@@ -278,15 +272,6 @@
+       save_preferences();
+ }
+ 
+-static void trayicon_menu_toggled(GtkMenuItem *menu, GtkBuilder *gui_builder)
+-{
+-      GtkStatusIcon *status_icon = 
GTK_STATUS_ICON(gtk_builder_get_object(gui_builder, STATUS_ICON));
+-
+-      show_trayicon = FALSE;
+-      gtk_status_icon_set_visible(status_icon, show_trayicon);
+-      save_preferences();
+-}
+-
+ static gchar* strip_invalid_edges(gchar *selection)
+ {
+       guint i = 0;
+@@ -422,6 +407,35 @@
+ }
+ #endif
+ 
++static void send_notification(gboolean normal, gchar *title, gchar *body)
++{
++      GNotification *notification;
++      GIcon *icon;
++      const gchar *id;
++
++      g_return_if_fail(title != NULL);
++      g_return_if_fail(body != NULL);
++
++      notification = g_notification_new(title);
++      g_notification_set_body(notification, body);
++      if(normal)
++      {
++              icon = g_themed_icon_new("dialog-information");
++              id = "query-successful";
++      }
++      else
++      {
++              icon = g_themed_icon_new("dialog-warning");
++              id = "query-failed";
++      }
++      g_notification_set_icon(notification, icon);
++      g_application_send_notification(g_application_get_default(),
++                                      id, notification);
++
++      g_object_unref(icon);
++      g_object_unref(notification);
++}
++
+ static void notification_lookup(gchar *selection, GtkComboBox *combo_query)
+ {
+       gchar *stripped_lookup = g_strstrip(strip_invalid_edges(selection));
+@@ -447,14 +461,8 @@
+               }
+               else
+               {
+-                      gboolean update_successful = 
notify_notification_update(mod_notifier,
+-                                                                              
                                                        stripped_lookup,
+-                                                                              
                                                        STR_STATUS_QUERY_FAILED,
+-                                                                              
                                                        "gtk-dialog-warning");
+-                      if(!update_successful || (FALSE == 
notify_notification_show(mod_notifier, NULL)))
+-                      {
+-                              g_warning("Failed to display notification!\n");
+-                      }
++                      send_notification(FALSE, stripped_lookup,
++                                        STR_STATUS_QUERY_FAILED);
+                       last_search_successful = FALSE;
+               }
+       }
+@@ -506,7 +514,7 @@
+                               gtk_button_clicked(button_search);
+                       }
+                       // if notifier_enabled and notifier mod is present
+-                      else if(mod_notifier)
++                      else if(notifier_enabled)
+                       {
+                               notification_lookup(selection, combo_query);
+                       }
+@@ -536,32 +544,6 @@
+       return GDK_FILTER_CONTINUE;
+ }
+ 
+-static void status_icon_activate(GtkStatusIcon *status_icon, gpointer 
user_data)
+-{
+-      GtkBuilder *gui_builder = GTK_BUILDER(user_data);
+-      GtkWindow *window = GTK_WINDOW(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
+-      GtkComboBox *combo_query = NULL;
+-
+-      if(gtk_widget_get_visible(GTK_WIDGET(window)))
+-              gtk_widget_hide(GTK_WIDGET(window));
+-      else
+-      {
+-
+-              /* close notifications, if any */
+-              if(mod_notifier)
+-                      notify_notification_close(mod_notifier, NULL);
+-              show_window(window);
+-              combo_query = GTK_COMBO_BOX(gtk_builder_get_object(gui_builder, 
COMBO_QUERY));
+-              gtk_widget_grab_focus(GTK_WIDGET(combo_query));
+-      }
+-}
+-
+-static void status_icon_popup(GtkStatusIcon *status_icon, guint button, guint 
active_time, gpointer user_data)
+-{
+-      GtkMenu *menu = GTK_MENU(user_data);
+-      gtk_menu_popup(menu, NULL, NULL, gtk_status_icon_position_menu, 
status_icon, button, active_time);
+-}
+-
+ static void about_response_handle(GtkDialog *about_dialog, gint response_id, 
gpointer user_data)
+ {
+       switch(response_id)
+@@ -570,7 +552,7 @@
+               {
+ #ifndef G_OS_WIN32
+                       GError *err = NULL;
+-                      if(!gtk_show_uri(NULL, STR_BUG_WEBPAGE, 
GDK_CURRENT_TIME, &err))
++                      if(!gtk_show_uri_on_window(NULL, STR_BUG_WEBPAGE, 
GDK_CURRENT_TIME, &err))
+                       {
+                               GtkDialog *err_msg = 
GTK_DIALOG(gtk_message_dialog_new(
+                                                                               
                                        GTK_WINDOW(about_dialog),
+@@ -589,6 +571,8 @@
+ #endif
+                       break;
+               }
++              case GTK_RESPONSE_DELETE_EVENT:
++                      break;
+               default:
+                       g_warning("About Dialog: Unhandled response_id: %d!\n", 
response_id);
+                       break;
+@@ -620,7 +604,19 @@
+ {
+       G_DEBUG("Destroy called!\n");
+ 
+-      gtk_main_quit();
++      GtkBuilder *gui_builder = GTK_BUILDER(user_data);
++      GtkWidget *settings_dialog = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, DIALOG_OPTIONS));
++      GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
++
++      while(gtk_events_pending())
++              gtk_main_iteration();
++
++      destructor(gui_builder);
++
++      /* GtkBuilder drops references to any held, except toplevel widgets */
++      gtk_widget_destroy(settings_dialog);
++      gtk_widget_destroy(window);
++      g_application_quit(g_application_get_default());
+ }
+ 
+ static guint8 get_frequency(guint sense_count)
+@@ -1289,7 +1285,6 @@
+ 
+ static gboolean handle_wildmat_expr(GtkBuilder *gui_builder, GtkTextBuffer 
*buffer)
+ {
+-      GtkWindow *window = GTK_WINDOW(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
+       GtkExpander *expander = 
GTK_EXPANDER(gtk_builder_get_object(gui_builder, EXPANDER));
+       GtkStatusbar *status_bar = 
GTK_STATUSBAR(gtk_builder_get_object(gui_builder, STATUSBAR));
+       GtkComboBox *combo_query = 
GTK_COMBO_BOX(gtk_builder_get_object(gui_builder, COMBO_QUERY));
+@@ -1325,12 +1320,6 @@
+                       status_msg_context_id = 
gtk_statusbar_get_context_id(status_bar, STATUS_DESC_REGEX_SEARCHING);
+                       gtk_statusbar_push(status_bar, status_msg_context_id, 
status_msg);
+ 
+-                      // if visible, update the statusbar; the window will 
usually go on a freeze
+-                      // without updating the statusbar, until GDK is idle
+-                      // this call forces GDK to first redraw the statusbar 
and proceed
+-                      if(gtk_widget_get_visible(GTK_WIDGET(window)))
+-                              
gdk_window_process_updates(((GtkWidget*)status_bar)->window, FALSE);
+-
+                       /* if the results were set rightly, then add it to the 
search history */
+                       if(set_regex_results(regex_text, gui_builder))
+                               update_history(combo_query, regex_text);
+@@ -1562,23 +1551,16 @@
+ 
+ static void construct_show_notification()
+ {
+-      const gchar *lemma = 
((WNIDefinitionItem*)((WNIOverview*)((WNINym*)results->data)->data)->definitions_list->data)->lemma;
++      gchar *lemma = 
((WNIDefinitionItem*)((WNIOverview*)((WNINym*)results->data)->data)->definitions_list->data)->lemma;
+       gchar *definition = 
+       
g_strconcat(partnames[((WNIDefinitionItem*)((WNIOverview*)((WNINym*)results->data)->data)->definitions_list->data)->pos],
+                               ". ",
+                               
((WNIDefinition*)((WNIDefinitionItem*)((WNIOverview*)((WNINym*)results->data)->data)->definitions_list->data)->definitions->data)->definition,
+                               NULL);
+ 
+-      // close any previous updates
+-      notify_notification_close(mod_notifier, NULL);
+-
+       if(definition)
+       {
+-              gboolean update_successful = 
notify_notification_update(mod_notifier, lemma, definition, "gtk-dialog-info");
+-              if(!update_successful || (FALSE == 
notify_notification_show(mod_notifier, NULL)))
+-              {
+-                      g_warning("Failed to display notification\n");
+-              }
++              send_notification(TRUE, lemma, definition);
+               g_free(definition);
+               definition = NULL;
+       }
+@@ -1587,7 +1569,6 @@
+ static void show_searching(GtkBuilder *gui_builder)
+ {
+       gchar status_msg[MAX_STATUS_MSG] = "";
+-      GtkWindow *window = GTK_WINDOW(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
+       GtkStatusbar *status_bar = 
GTK_STATUSBAR(gtk_builder_get_object(gui_builder, STATUSBAR));
+ 
+       // set the status bar and update the window
+@@ -1595,9 +1576,6 @@
+       g_snprintf(status_msg, MAX_STATUS_MSG, STR_STATUS_SEARCHING);
+       status_msg_context_id = gtk_statusbar_get_context_id(status_bar, 
STATUS_DESC_REGEX_SEARCHING);
+       gtk_statusbar_push(status_bar, status_msg_context_id, status_msg);
+-      // if visible, repaint the statusbar after setting the status message, 
for it to get reflected
+-      if(gtk_widget_get_visible(GTK_WIDGET(window)))
+-              gdk_window_process_updates(((GtkWidget*)status_bar)->window, 
FALSE);
+ }
+ 
+ static void query_wni(gchar *search_str,
+@@ -2343,8 +2321,8 @@
+       GtkFileChooser *dialog = 
GTK_FILE_CHOOSER(gtk_file_chooser_dialog_new("Save As",
+                                                                               
                                                                  NULL,
+                                                                               
                                                                  
GTK_FILE_CHOOSER_ACTION_SAVE,
+-                                                                              
                                                                  
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+-                                                                              
                                                                  
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
++                                                                              
                                                                  "_Cancel", 
GTK_RESPONSE_CANCEL,
++                                                                              
                                                                  "_Save", 
GTK_RESPONSE_OK,
+                                                                               
                                                                  NULL));
+       gchar *dest_filename = NULL;
+       gint response = 0;
+@@ -2428,6 +2406,9 @@
+ static void query_combo_popup(GtkEntry *query_entry_widget, GtkMenu 
*popup_menu, GtkListStore *list_store_query)
+ {
+       GtkWidget *menu_item = NULL;
++      GtkWidget *box;
++      GtkWidget *icon;
++      GtkWidget *label;
+       GtkTreeIter iter = {0};
+       gboolean menu_item_enabled = 
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list_store_query), &iter);
+ 
+@@ -2435,19 +2416,30 @@
+       gtk_menu_shell_prepend(GTK_MENU_SHELL(popup_menu), menu_item);
+       gtk_widget_show(menu_item);
+ 
+-      menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_SAVE, NULL);
+-      gtk_menu_item_set_label(GTK_MENU_ITEM(menu_item), "_Save History");
++      box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
++      icon = gtk_image_new_from_icon_name("document-save",
++                                          GTK_ICON_SIZE_MENU);
++      menu_item = gtk_menu_item_new();
++      label = gtk_label_new_with_mnemonic("_Save History");
++      gtk_container_add(GTK_CONTAINER(box), icon);
++      gtk_container_add(GTK_CONTAINER(box), label);
++      gtk_container_add(GTK_CONTAINER(menu_item), box);
+       gtk_widget_set_sensitive(menu_item, menu_item_enabled);
+       g_signal_connect(menu_item, "activate", 
G_CALLBACK(save_history_to_file), NULL);
+       gtk_menu_shell_prepend(GTK_MENU_SHELL(popup_menu), menu_item);
+-      gtk_widget_show(menu_item);
++      gtk_widget_show_all(menu_item);
+ 
+-      menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLEAR, NULL);
+-      gtk_menu_item_set_label(GTK_MENU_ITEM(menu_item), "Cl_ear History");
++      box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
++      icon = gtk_image_new_from_icon_name("edit-clear", GTK_ICON_SIZE_MENU);
++      menu_item = gtk_menu_item_new();
++      label = gtk_label_new_with_mnemonic("Cl_ear History");
++      gtk_container_add(GTK_CONTAINER(box), icon);
++      gtk_container_add(GTK_CONTAINER(box), label);
++      gtk_container_add(GTK_CONTAINER(menu_item), box);
+       gtk_widget_set_sensitive(menu_item, menu_item_enabled);
+       g_signal_connect(menu_item, "activate", G_CALLBACK(clear_history), 
list_store_query);
+       gtk_menu_shell_prepend(GTK_MENU_SHELL(popup_menu), menu_item);
+-      gtk_widget_show(menu_item);
++      gtk_widget_show_all(menu_item);
+ }
+ 
+ static void load_history(GtkListStore *list_store_query)
+@@ -2631,7 +2623,9 @@
+       // toolbar code starts here
+       toolbar = GTK_TOOLBAR(gtk_builder_get_object(gui_builder, TOOLBAR));
+ 
+-      toolbar_item = gtk_tool_button_new_from_stock(GTK_STOCK_GO_BACK);
++      toolbar_item = gtk_tool_button_new(NULL, NULL);
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item),
++                                    "go-previous");
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_PREV);
+       gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_PREV);
+@@ -2639,7 +2633,8 @@
+       g_signal_connect(toolbar_item, "clicked", 
G_CALLBACK(button_prev_clicked), gui_builder);
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      toolbar_item = gtk_tool_button_new_from_stock(GTK_STOCK_GO_FORWARD);
++      toolbar_item = gtk_tool_button_new(NULL, NULL);
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item), "go-next");
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_NEXT);
+       gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_NEXT);
+@@ -2650,7 +2645,9 @@
+       toolbar_item = gtk_separator_tool_item_new();
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      toolbar_item = 
gtk_toggle_tool_button_new_from_stock(GTK_STOCK_DIALOG_INFO);
++      toolbar_item = gtk_toggle_tool_button_new();
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item),
++                                    "dialog-information");
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_MODE);
+       gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toolbar_item), 
advanced_mode);
+@@ -2658,42 +2655,45 @@
+       g_signal_connect(toolbar_item, "toggled", G_CALLBACK(mode_toggled), 
gui_builder);
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      toolbar_item = gtk_tool_button_new_from_stock(GTK_STOCK_PREFERENCES);
++      toolbar_item = gtk_tool_button_new(NULL, NULL);
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item),
++                                    "preferences-system");
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_OPTIONS);
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_OPTIONS);
+       g_signal_connect(toolbar_item, "clicked", 
G_CALLBACK(show_settings_dialog), gui_builder);
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      /* if mod notify is present */
+-      if(mod_notifier)
+-      {
+-              toolbar_item = 
gtk_toggle_tool_button_new_from_stock(notifier_enabled ? GTK_STOCK_YES : 
GTK_STOCK_NO);
+-              
gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+-              gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_NOTIFY);
+-              
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toolbar_item), 
notifier_enabled);
+-              gtk_tool_item_set_tooltip_text(toolbar_item, 
TOOLITEM_TOOLTIP_NOTIFY);
+-              g_signal_connect(toolbar_item, "toggled", 
G_CALLBACK(notification_toggled), gui_builder);
+-              gtk_toolbar_insert(toolbar, toolbar_item, -1);
++      toolbar_item = gtk_toggle_tool_button_new();
++      gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
++      gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_NOTIFY);
++      gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toolbar_item), 
notifier_enabled);
++      gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_NOTIFY);
++      g_signal_connect(toolbar_item, "toggled", 
G_CALLBACK(notification_toggled), gui_builder);
++      gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-              notify_toolbar_index = gtk_toolbar_get_item_index(toolbar, 
toolbar_item);
+-      }
++      notify_toolbar_index = gtk_toolbar_get_item_index(toolbar, 
toolbar_item);
+ 
+       toolbar_item = gtk_separator_tool_item_new();
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      toolbar_item = gtk_tool_button_new_from_stock(GTK_STOCK_ABOUT);
++      toolbar_item = gtk_tool_button_new(NULL, NULL);
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item),
++                                    "help-about");
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_ABOUT);
+       gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_ABOUT);
+       g_signal_connect(toolbar_item, "clicked", G_CALLBACK(about_activate), 
NULL);
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+ 
+-      toolbar_item = gtk_tool_button_new_from_stock(GTK_STOCK_QUIT);
++      toolbar_item = gtk_tool_button_new(NULL, NULL);
++      gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolbar_item),
++                                    "application-exit");
+       gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(toolbar_item), TRUE);
+       gtk_tool_button_set_label(GTK_TOOL_BUTTON(toolbar_item), 
STR_TOOLITEM_QUIT);
+       gtk_tool_item_set_tooltip_text(toolbar_item, TOOLITEM_TOOLTIP_QUIT);
+-      g_signal_connect(toolbar_item, "clicked", G_CALLBACK(quit_activate), 
NULL);
++      g_signal_connect(toolbar_item, "clicked", G_CALLBACK(quit_activate),
++                       gui_builder);
+       gtk_toolbar_insert(toolbar, toolbar_item, -1);
+       
+       // add accelerators
+@@ -2703,7 +2703,7 @@
+       gtk_widget_add_accelerator(GTK_WIDGET(toolbar_item),
+                                                          "clicked",
+                                                          accel_group,
+-                                                         GDK_q,
++                                                         GDK_KEY_q,
+                                                          GDK_CONTROL_MASK,
+                                                          0);
+       close_window_closure = g_cclosure_new_object(G_CALLBACK(close_window), 
G_OBJECT(gui_builder));
+@@ -2711,49 +2711,12 @@
+          refer: gtk_accel_group_connect documentation */
+       close_window_closure_dummy = 
g_cclosure_new_object(G_CALLBACK(close_window), G_OBJECT(gui_builder));
+ 
+-      gtk_accel_group_connect(accel_group, GDK_w, GDK_CONTROL_MASK, 0, 
close_window_closure);
+-      gtk_accel_group_connect(accel_group, GDK_Escape, 0, 0, 
close_window_closure_dummy);
++      gtk_accel_group_connect(accel_group, GDK_KEY_w, GDK_CONTROL_MASK, 0, 
close_window_closure);
++      gtk_accel_group_connect(accel_group, GDK_KEY_Escape, 0, 0, 
close_window_closure_dummy);
+ 
+       gtk_widget_show_all(GTK_WIDGET(toolbar));
+ }
+ 
+-static GtkMenu *create_popup_menu(GtkBuilder *gui_builder)
+-{
+-      GtkMenu *menu = NULL;
+-      GtkSeparatorMenuItem *menu_separator = NULL;
+-      GtkImageMenuItem *menu_item = NULL;
+-      
+-      // Initialize popup menu/sub menus
+-      menu = GTK_MENU(gtk_menu_new());
+-
+-      /* if mod notify is present, setup a notifications menu */
+-      if(mod_notifier)
+-      {
+-              menu_notify = 
GTK_CHECK_MENU_ITEM(gtk_check_menu_item_new_with_mnemonic(STR_TOOLITEM_NOTIFY));
+-              // load the settings value
+-              gtk_check_menu_item_set_active(menu_notify, notifier_enabled);
+-
+-              menu_separator = 
GTK_SEPARATOR_MENU_ITEM(gtk_separator_menu_item_new());
+-              gtk_menu_shell_append(GTK_MENU_SHELL(menu), 
GTK_WIDGET(menu_notify));
+-              gtk_menu_shell_append(GTK_MENU_SHELL(menu), 
GTK_WIDGET(menu_separator));
+-              g_signal_connect(menu_notify, "toggled", 
G_CALLBACK(notification_toggled), gui_builder);
+-      }
+-
+-      menu_item = 
GTK_IMAGE_MENU_ITEM(gtk_image_menu_item_new_from_stock(GTK_STOCK_CLOSE, NULL));
+-      gtk_menu_item_set_use_underline(GTK_MENU_ITEM(menu_item), TRUE);
+-      gtk_menu_item_set_label(GTK_MENU_ITEM(menu_item), "_Hide");
+-      g_signal_connect(menu_item, "activate", 
G_CALLBACK(trayicon_menu_toggled), gui_builder);
+-      gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(menu_item));
+-
+-      menu_item = 
GTK_IMAGE_MENU_ITEM(gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL));
+-      g_signal_connect(menu_item, "activate", G_CALLBACK(quit_activate), 
NULL);
+-      gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(menu_item));
+-
+-      gtk_widget_show_all(GTK_WIDGET(menu));
+-
+-      return menu;
+-}
+-
+ static void create_text_view_tags(GtkBuilder *gui_builder)
+ {
+       guint8 i = 0;
+@@ -2853,12 +2816,6 @@
+                       show_polysemy = TRUE;
+                       g_clear_error(&err);
+               }
+-              show_trayicon = g_key_file_get_boolean(config_file, 
GROUP_SETTINGS, KEY_TRAYICON, &err);
+-              if(err)
+-              {
+-                      show_trayicon = TRUE;
+-                      g_clear_error(&err);
+-              }
+               load_preference_hotkey(&first_run);
+               launch_minimized = g_key_file_get_boolean(config_file, 
GROUP_SETTINGS, KEY_LAUNCH_HIDDEN, &err);
+               if(err)
+@@ -2942,7 +2899,6 @@
+       g_key_file_set_boolean(config_file, GROUP_SETTINGS, KEY_MODE, 
advanced_mode);
+       g_key_file_set_boolean(config_file, GROUP_SETTINGS, KEY_NOTIFICATIONS, 
notifier_enabled);
+       g_key_file_set_boolean(config_file, GROUP_SETTINGS, KEY_POLYSEMY, 
show_polysemy);
+-      g_key_file_set_boolean(config_file, GROUP_SETTINGS, KEY_TRAYICON, 
show_trayicon);
+       g_key_file_set_boolean(config_file, GROUP_SETTINGS, KEY_LAUNCH_HIDDEN, 
launch_minimized);
+ 
+       save_preferences_to_file();
+@@ -2967,17 +2923,12 @@
+ static void show_loading(GtkBuilder *gui_builder)
+ {
+       gchar status_msg[MAX_STATUS_MSG] = "";
+-      GtkWindow *window = GTK_WINDOW(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
+       GtkStatusbar *status_bar = 
GTK_STATUSBAR(gtk_builder_get_object(gui_builder, STATUSBAR));
+       // set the loading message on status bar
+       gtk_statusbar_pop(status_bar, status_msg_context_id);
+       g_snprintf(status_msg, MAX_STATUS_MSG, STR_STATUS_INDEXING);
+       status_msg_context_id = gtk_statusbar_get_context_id(status_bar, 
STATUS_DESC_LOADING_INDEX);
+       gtk_statusbar_push(status_bar, status_msg_context_id, status_msg);
+-
+-      // if visible, repaint the statusbar after setting the status message, 
for it to get reflected
+-      if(gtk_widget_get_visible(GTK_WIDGET(window)))
+-              gdk_window_process_updates(((GtkWidget*)status_bar)->window, 
FALSE);
+ }
+ 
+ static void attach_loaded_terms(WordnetTermsLoaderData *loader_data)
+@@ -3073,7 +3024,7 @@
+ #ifdef X11_AVAILABLE
+ static void lookup_ignorable_modifiers ()
+ {
+-      GdkKeymap *keymap = gdk_keymap_get_default();
++      GdkKeymap *keymap = 
gdk_keymap_get_for_display(gdk_display_get_default());
+ 
+       /* caps_lock */
+       egg_keymap_resolve_virtual_modifiers (keymap, EGG_VIRTUAL_LOCK_MASK, 
&caps_lock_mask);
+@@ -3100,7 +3051,7 @@
+               num_lock_mask  | caps_lock_mask | scroll_lock_mask,
+       };
+ 
+-      egg_keymap_resolve_virtual_modifiers (gdk_keymap_get_default(), 
(EggVirtualModifierType) binding->accel_mods, &actual_mods);
++      egg_keymap_resolve_virtual_modifiers 
(gdk_keymap_get_for_display(gdk_display_get_default()), 
(EggVirtualModifierType) binding->accel_mods, &actual_mods);
+ 
+       for(i = 0; (i < G_N_ELEMENTS (mod_masks) && (False == x_error)); i++) 
+       {
+@@ -3284,28 +3235,23 @@
+ static void set_settings_to_check_boxes(GtkBuilder *gui_builder)
+ {
+       GtkToggleButton *polysemy_show_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_POLYSEMY));
+-      GtkToggleButton *status_show_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_STATUS));
+       GtkToggleButton *launch_min_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_LAUNCH_MIN));
+       
+       // show_trayicon is the variable, while the checkbox is "hide status 
icon"
+       // hence the NOT op.; same goes for launch_minimized too
+-      gtk_toggle_button_set_active(status_show_btn, !show_trayicon);
+       gtk_toggle_button_set_active(launch_min_btn, !launch_minimized);
+       gtk_toggle_button_set_active(polysemy_show_btn, show_polysemy);
+ }
+ 
+ static void get_settings_from_check_boxes(GtkBuilder *gui_builder,
+-                                                                              
        gboolean *new_trayicon_show,
+                                                                               
        gboolean *new_launch_min,
+                                                                               
        gboolean *new_polysemy_show)
+ {
+       GtkToggleButton *polysemy_show_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_POLYSEMY));
+-      GtkToggleButton *status_show_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_STATUS));
+       GtkToggleButton *launch_min_btn = 
GTK_TOGGLE_BUTTON(gtk_builder_get_object(gui_builder, CHKBTN_LAUNCH_MIN));
+ 
+       // show_trayicon is the variable, while the checkbox is "hide status 
icon"
+       // hence the NOT op.; same goes for launch_minimized
+-      *new_trayicon_show = !gtk_toggle_button_get_active(status_show_btn);
+       *new_launch_min = !gtk_toggle_button_get_active(launch_min_btn);
+       *new_polysemy_show = gtk_toggle_button_get_active(polysemy_show_btn);
+ }
+@@ -3313,21 +3259,15 @@
+ static void apply_and_save_settings(GtkBuilder *gui_builder)
+ {
+       GtkButton *search_button = 
GTK_BUTTON(gtk_builder_get_object(gui_builder, BUTTON_SEARCH));
+-      gboolean new_show_trayicon = FALSE, new_show_polysemy = FALSE;
++      gboolean new_show_polysemy = FALSE;
+ 
+-      get_settings_from_check_boxes(gui_builder, &new_show_trayicon, 
&launch_minimized, &new_show_polysemy);
++      get_settings_from_check_boxes(gui_builder, &launch_minimized, 
&new_show_polysemy);
+       if(show_polysemy != new_show_polysemy)
+       {
+               show_polysemy = new_show_polysemy;
+               last_search_successful = FALSE;
+               gtk_button_clicked(search_button);
+       }
+-      if(show_trayicon != new_show_trayicon)
+-      {
+-              GtkStatusIcon *status_icon = 
GTK_STATUS_ICON(gtk_builder_get_object(gui_builder, STATUS_ICON));
+-              show_trayicon = new_show_trayicon;
+-              gtk_status_icon_set_visible(status_icon, show_trayicon);
+-      }
+ 
+       save_preferences();     
+ }
+@@ -3428,10 +3368,7 @@
+               mod_suggest = FALSE;
+       }
+ 
+-      if(mod_notifier)
+-      {
+-              mod_notify_uninit();
+-      }
++      g_object_unref(gui_builder);
+ }
+ 
+ static void show_message_dlg(GtkWidget *parent_window, MessageResposeCode 
msg_code)
+@@ -3515,269 +3452,242 @@
+       return FALSE;
+ }
+ 
+-int main(int argc, char *argv[])
++static void app_activate(GtkApplication *app, gpointer data)
+ {
+       GtkBuilder *gui_builder = NULL;
+-      GtkWidget *window = NULL, *button_search = NULL, *combo_query = NULL, 
*combo_entry = NULL, *settings_dialog = NULL;
+-      GtkMenu *popup_menu = NULL;
++      GtkWidget *window = NULL, *button_search = NULL, *combo_query = NULL, 
*combo_entry = NULL;
+       GtkExpander *expander = NULL;
+       GdkPixbuf *app_icon = NULL;
+       GError *err = NULL;
+       gboolean first_run = FALSE, hotkey_reg_failed = FALSE;
+       gchar *ui_file_path = NULL, *icon_file_path = NULL;
+ 
+-#ifdef G_OS_WIN32
+-      /* logic for single instance apps. on Win32 */
+-      HANDLE single_instance_mutex = CreateMutex(NULL, FALSE, 
TEXT(PACKAGE_NAME));
+-
+-      if(ERROR_ALREADY_EXISTS == GetLastError() || !single_instance_mutex)
+-      {
+-              hMainWindow = FindWindow(NULL, TEXT(STR_APP_TITLE));
+-              if(hMainWindow)
+-                      PostMessage(hMainWindow, WM_ARTHA_RELAUNCH, 0, 0);
+-              return 0;
+-      }
+-#endif
+-
+-      g_set_application_name(PACKAGE_NAME);
+-
+-      if(gtk_init_check(&argc, &argv))
+-      {
+ #ifdef DBUS_AVAILABLE
+-              /* if we're not the first instance of artha, then quit */
+-              if(FALSE == instance_handler_am_i_unique())
+-              {
+-                      /* signal the primary instance of this invocation */
+-                      instance_handler_send_signal();
++      /* if we're not the first instance of artha, then quit */
++      if(FALSE == instance_handler_am_i_unique())
++      {
++              /* signal the primary instance of this invocation */
++              instance_handler_send_signal();
+ 
+-                      /* notify the desktop env. that the start up is 
complete */
+-                      gdk_notify_startup_complete();
++              /* notify the desktop env. that the start up is complete */
++              gdk_notify_startup_complete();
+ 
+-                      return 0;
+-              }
++              return;
++      }
+ #endif
+-              gui_builder = gtk_builder_new();
+-              if(gui_builder)
+-              {
+-                      ui_file_path = g_build_filename(APP_DIR, UI_FILE, NULL);
+-                      if(gtk_builder_add_from_file(gui_builder, ui_file_path, 
&err))
+-                      {
+-                              /* if WordNet's database files are not opened, 
open it */
+-                              if((OpenDB != 1) && (wninit() != 0))
+-                                              show_message_dlg(NULL, 
MSG_DB_LOAD_ERROR);
+ 
+-                              window = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, WINDOW_MAIN));
+-                              if(window)
+-                              {
+-                                      GtkStatusIcon *status_icon = NULL;
++      gui_builder = gtk_builder_new();
++      if(gui_builder)
++      {
++              ui_file_path = g_build_filename(APP_DIR, UI_FILE, NULL);
++              if(gtk_builder_add_from_file(gui_builder, ui_file_path, &err))
++              {
++                      /* if WordNet's database files are not opened, open it 
*/
++                      if((OpenDB != 1) && (wninit() != 0))
++                              show_message_dlg(NULL, MSG_DB_LOAD_ERROR);
++
++                      window = GTK_WIDGET(gtk_builder_get_object(gui_builder, 
WINDOW_MAIN));
++                      if(window)
++                      {
+ #ifdef DBUS_AVAILABLE
+-                                      /* if the control's here, then it's 
sure that we're the unique instance;
+-                                      register for dbus signals from possible 
duplicate instances */
+-                                      
if(!instance_handler_register_signal(GTK_WINDOW(window)))
+-                                      {
+-                                              g_error("Unable to register for 
duplicate instance signals!\n");
+-                                      }
++                              /* if the control's here, then it's sure that 
we're the unique instance;
++                                 register for dbus signals from possible 
duplicate instances */
++                              
if(!instance_handler_register_signal(GTK_WINDOW(window)))
++                              {
++                                      g_error("Unable to register for 
duplicate instance signals!\n");
++                              }
+ #endif
+-                                      /* try to load preferences and see if 
this is the first run */
+-                                      first_run = 
load_preferences(GTK_WINDOW(window));
++                              /* try to load preferences and see if this is 
the first run */
++                              first_run = 
load_preferences(GTK_WINDOW(window));
++                              gtk_window_set_application(GTK_WINDOW(window),
++                                                         app);
+ 
+ #ifdef X11_AVAILABLE
+ 
+-                                      /* Most Important: do not use the 
XServer's XGetDisplay, you will have to do XNextEvent (blocking) to 
+-                                         get the event call, so get GDK's 
display; its X11 display equivalent */
+-                                      dpy = 
gdk_x11_display_get_xdisplay(gdk_display_get_default());
+-                                      if(NULL == dpy)
+-                                      {
+-                                              g_error("Can't open Display 
%s!\n", gdk_display_get_name(gdk_display_get_default()));
+-                                              return -1;
+-                                      }
+-
+-                                      G_DEBUG("XDisplay Opened!\n");
+-
+-                                      XSynchronize(dpy, True);                
/* Without calling this you get the error call back dealyed, much delayed! */
+-                                      XSetErrorHandler(x_error_handler);      
/* Set the error handler for setting the flag */
+-
+-                                      lookup_ignorable_modifiers();
+-
+-                                      /* Add a filter function to handle low 
level events, like X events.
+-                                              For Param1 use 
gdk_get_default_root_window() instead of NULL or window, so that
+-                                              only when hotkey combo is 
pressed will the filter func. be called, unlike
+-                                              others, where it will be called 
for all events beforehand GTK handles */
+-                                      
gdk_window_add_filter(gdk_get_default_root_window(), hotkey_pressed, 
gui_builder);
++                              /* Most Important: do not use the XServer's 
XGetDisplay, you will have to do XNextEvent (blocking) to
++                                 get the event call, so get GDK's display; 
its X11 display equivalent */
++                              dpy = 
gdk_x11_display_get_xdisplay(gdk_display_get_default());
++                              if(NULL == dpy)
++                              {
++                                      g_error("Can't open Display %s!\n", 
gdk_display_get_name(gdk_display_get_default()));
++                              }
++
++                              G_DEBUG("XDisplay Opened!\n");
++
++                              XSynchronize(dpy, True);                /* 
Without calling this you get the error call back dealyed, much delayed! */
++                              XSetErrorHandler(x_error_handler);      /* Set 
the error handler for setting the flag */
++
++                              lookup_ignorable_modifiers();
++
++                              /* Add a filter function to handle low level 
events, like X events.
++                                 For Param1 use gdk_get_default_root_window() 
instead of NULL or window, so that
++                                 only when hotkey combo is pressed will the 
filter func. be called, unlike
++                                 others, where it will be called for all 
events beforehand GTK handles */
++                              
gdk_window_add_filter(gdk_get_default_root_window(), hotkey_pressed, 
gui_builder);
+ 
+ #elif defined G_OS_WIN32
+ 
+-                                      /* if the main window widget is not yet 
realised, then the underlying 
+-                                      GdkWindow will be a NULL member, so 
realise it and get the HWND */
+-                                      if(!window->window)
+-                                              gtk_widget_realize(window);
++                              /* if the main window widget is not yet 
realised, then the underlying
++                                 GdkWindow will be a NULL member, so realise 
it and get the HWND */
++                              if(!window->window)
++                                      gtk_widget_realize(window);
+ 
+-                                      hMainWindow = (HWND) 
GDK_WINDOW_HWND(window->window);
+-                                      gdk_window_add_filter(window->window, 
hotkey_pressed, gui_builder);
++                              hMainWindow = (HWND) 
GDK_WINDOW_HWND(window->window);
++                              gdk_window_add_filter(window->window, 
hotkey_pressed, gui_builder);
+ 
+ #endif // X11_AVAILABLE
+ 
+-                                      if(app_hotkey.accel_key || first_run)
+-                                      {
+-                                              
if(register_unregister_hotkey(first_run, TRUE))
+-                                              {
+-                                                      hotkey_set = TRUE;
+-
+-                                                      if(first_run)
+-                                                      {
+-                                                              
show_message_dlg(window, MSG_HOTKEY_SUCCEEDED_FIRST_RUN);
+-                                                      }
+-                                              }
+-                                              else
+-                                              {
+-                                                      if(first_run)
+-                                                              
show_message_dlg(window, MSG_HOTKEY_FAILED_FIRST_RUN);
+-                                                      else
+-                                                      {
+-                                                              
hotkey_reg_failed = TRUE;
+-
+-                                                              
show_message_dlg(window, MSG_HOTKEY_FAILED);
+-                                                              /* since the 
previously set hotkey is now not registerable, memzero
+-                                                                 (i.e. 
disable) app_hotkey and save prefs */
+-                                                              
app_hotkey.accel_key = app_hotkey.accel_mods = (GdkModifierType) 
(app_hotkey.accel_flags = 0);
+-                                                      }
+-                                              }
+-                                      }
+-
+-                                      /* save preferences here - after all 
setting based loads are done */
+-                                      save_preferences();
+-
+-                                      setup_settings_dialog(gui_builder);
+-                                      settings_dialog = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, DIALOG_OPTIONS));
+-
+-                                      icon_file_path = 
g_build_filename(ICON_DIR, ICON_FILE, NULL);
+-                                      if(g_file_test(icon_file_path, 
G_FILE_TEST_IS_REGULAR))
+-                                      {
+-                                              status_icon = 
GTK_STATUS_ICON(gtk_builder_get_object(gui_builder, STATUS_ICON));
+-                                              
gtk_status_icon_set_from_file(status_icon, icon_file_path);
+-                                              
gtk_status_icon_set_tooltip_text(status_icon, STR_APP_TITLE);
+-                                              
gtk_status_icon_set_visible(status_icon, show_trayicon);
+-                                      }
+-                                      else
+-                                      {
+-                                              g_warning("Error loading icon 
file!\n%s not found!\n", icon_file_path);
+-                                      }
+-                                      g_free(icon_file_path);
+-                                      icon_file_path = NULL;
+-
+-                                      mod_notify_init();
+-                                      
+-                                      setup_toolbar(gui_builder);
+-
+-                                      /* pop-up menu creation should be after 
assessing the availability of notifications
+-                                         since if it is not available, the 
Notify menu option can be stripped
+-                                         create pop-up menu */
+-                                      popup_menu = 
create_popup_menu(gui_builder);
+-
+-                                      /* status icon connections made here 
since popup menu should be ready for this
+-                                       * which wouldn't be ready when 
status_icon is inited */
+-                                       if(status_icon)
+-                                       {
+-                                               g_signal_connect(status_icon, 
"activate", G_CALLBACK(status_icon_activate), gui_builder);
+-                                               g_signal_connect(status_icon, 
"popup-menu", G_CALLBACK(status_icon_popup), GTK_WIDGET(popup_menu));
+-                                       }
+-
+-
+-                                      // using the status icon, app. icon is 
also set
+-                                      g_object_get(status_icon, "pixbuf", 
&app_icon, NULL);
+-                                      if(app_icon)
+-                                      {
+-                                              
gtk_window_set_default_icon(app_icon);
+-                                              g_object_unref(app_icon);
+-                                              app_icon = NULL;
+-                                      }
+-
+-
+-                                      button_search = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, BUTTON_SEARCH));
+-                                      g_signal_connect(button_search, 
"clicked", G_CALLBACK(button_search_click), gui_builder);
++                              if(app_hotkey.accel_key || first_run)
++                              {
++                                      
if(register_unregister_hotkey(first_run, TRUE))
++                                      {
++                                              hotkey_set = TRUE;
++
++                                              if(first_run)
++                                              {
++                                                      
show_message_dlg(window, MSG_HOTKEY_SUCCEEDED_FIRST_RUN);
++                                              }
++                                      }
++                                      else
++                                      {
++                                              if(first_run)
++                                                      
show_message_dlg(window, MSG_HOTKEY_FAILED_FIRST_RUN);
++                                              else
++                                              {
++                                                      hotkey_reg_failed = 
TRUE;
++
++                                                      
show_message_dlg(window, MSG_HOTKEY_FAILED);
++                                                      /* since the previously 
set hotkey is now not registerable, memzero
++                                                         (i.e. disable) 
app_hotkey and save prefs */
++                                                      app_hotkey.accel_key = 
app_hotkey.accel_mods = (GdkModifierType) (app_hotkey.accel_flags = 0);
++                                              }
++                                      }
++                              }
++
++                              /* save preferences here - after all setting 
based loads are done */
++                              save_preferences();
++
++                              setup_settings_dialog(gui_builder);
++
++                              icon_file_path = g_build_filename(ICON_DIR, 
ICON_FILE, NULL);
++                              if(g_file_test(icon_file_path, 
G_FILE_TEST_IS_REGULAR))
++                              {
++                                      app_icon = 
gdk_pixbuf_new_from_file(icon_file_path, NULL);
++                              }
++                              else
++                              {
++                                      g_warning("Error loading icon file!\n%s 
not found!\n", icon_file_path);
++                              }
++                              g_free(icon_file_path);
++                              icon_file_path = NULL;
++
++                              setup_toolbar(gui_builder);
++
++                              if(app_icon)
++                              {
++                                      gtk_window_set_default_icon(app_icon);
++                                      g_object_unref(app_icon);
++                                      app_icon = NULL;
++                              }
++
++
++                              button_search = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, BUTTON_SEARCH));
++                              g_signal_connect(button_search, "clicked", 
G_CALLBACK(button_search_click), gui_builder);
++
++                              combo_query = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, COMBO_QUERY));
++                              g_signal_connect(combo_query, "changed", 
G_CALLBACK(combo_query_changed), gui_builder);
++
++                              /* get the GtkEntry in GtkComboBox and set 
activates-default to TRUE; so that
++                                 it pass the ENTER key signal to query button 
*/
++                              combo_entry = 
gtk_bin_get_child(GTK_BIN(combo_query));
++                              g_object_set(combo_entry, "activates-default", 
TRUE, NULL);
++
++                              create_text_view_tags(gui_builder);
++
++                              /* do main window specific connects */
++                              g_signal_connect(window, "delete-event", 
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
++                              g_signal_connect(window, 
"visibility-notify-event", G_CALLBACK(window_visibility_toggled), 
button_search);
++
++                              g_signal_connect(combo_query, "scroll-event", 
G_CALLBACK(combo_query_scroll), button_search);
++
++                              expander = 
GTK_EXPANDER(gtk_builder_get_object(gui_builder, EXPANDER));
++                              g_signal_connect(expander, "activate", 
G_CALLBACK(expander_clicked), gui_builder);
++
++                              gtk_widget_grab_focus(GTK_WIDGET(combo_query));
++
++                              G_DEBUG("GUI loaded successfully!\n");
++
++                              create_stores_renderers(gui_builder);
++
++                              mod_suggest = suggestions_init();
++
++                              // show the window if it's a first run or a 
hotkey couldn't be set
++                              // if the window is not shown, set notify the 
startup is complete
++                              if(first_run || hotkey_reg_failed || 
!launch_minimized)
++                                      gtk_widget_show_all(window);
++                              else
++                                      gdk_notify_startup_complete();
++
++                              // index all wordnet terms from the index.sense 
onto memory
++                              WordnetTermsLoaderData loader_data = { 
gui_builder };
++                              wordnet_terms_load(&loader_data);
++
++                              while(gtk_events_pending())
++                                      gtk_main_iteration();
++                      }
++                      else
++                      {
++                              g_error("Error loading GUI!\n Corrupted data in 
UI file!\n");
++                      }
++              }
++              else
++              {
++                      /* shouldn't call g_error directly, since it's a 
terminating call;
++                         so print the error, free the resources and then do 
it */
++                      g_print("%s: ", err->message);
++                      g_error_free(err);
++                      err = NULL;
++                      g_error("Error loading GUI from %s!\n", ui_file_path);
++              }
+ 
+-                                      combo_query = 
GTK_WIDGET(gtk_builder_get_object(gui_builder, COMBO_QUERY));
+-                                      g_signal_connect(combo_query, 
"changed", G_CALLBACK(combo_query_changed), gui_builder);
+-
+-                                      /* get the GtkEntry in GtkComboBox and 
set activates-default to TRUE; so that
+-                                         it pass the ENTER key signal to 
query button */
+-                                      combo_entry = 
gtk_bin_get_child(GTK_BIN(combo_query));
+-                                      g_object_set(combo_entry, 
"activates-default", TRUE, NULL);
+-
+-                                      create_text_view_tags(gui_builder);
+-
+-                                      /* do main window specific connects */
+-                                      g_signal_connect(window, 
"delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);
+-                                      g_signal_connect(window, 
"visibility-notify-event", G_CALLBACK(window_visibility_toggled), 
button_search);
+-
+-                                      g_signal_connect(combo_query, 
"scroll-event", G_CALLBACK(combo_query_scroll), button_search);
+-
+-                                      expander = 
GTK_EXPANDER(gtk_builder_get_object(gui_builder, EXPANDER));
+-                                      g_signal_connect(expander, "activate", 
G_CALLBACK(expander_clicked), gui_builder);
+-
+-                                      
gtk_widget_grab_focus(GTK_WIDGET(combo_query));
+-
+-                                      G_DEBUG("GUI loaded successfully!\n");
+-
+-                                      create_stores_renderers(gui_builder);
+-
+-                                      mod_suggest = suggestions_init();
+-
+-                                      // show the window if it's a first run 
or a hotkey couldn't be set
+-                                      // if the window is not shown, set 
notify the startup is complete
+-                                      if(first_run || hotkey_reg_failed || 
!launch_minimized)
+-                                              gtk_widget_show_all(window);
+-                                      else
+-                                              gdk_notify_startup_complete();
+-
+-                                      // index all wordnet terms from the 
index.sense onto memory
+-                                      WordnetTermsLoaderData loader_data = { 
gui_builder };
+-                                      wordnet_terms_load(&loader_data);
+-
+-                                      gtk_main();
++              g_free(ui_file_path);
++              ui_file_path = NULL;
++      }
++      else
++      {
++              g_error("Error creating GtkBuilder!\n");
++      }
++}
+ 
+-                                      /* on Win32 platform, icon stays even 
after app close, this is
+-                                         a workaround to fix that */
+-                                      
gtk_status_icon_set_visible(status_icon, FALSE);
+-                                      destructor(gui_builder);
++int main(int argc, char *argv[])
++{
++      GtkApplication *app;
++      int status;
+ 
+-                                      /* GtkBuilder drops references to any 
held, except toplevel widgets */
+-                                      
gtk_widget_destroy(GTK_WIDGET(popup_menu));
+-                                      gtk_widget_destroy(settings_dialog);
+-                                      gtk_widget_destroy(window);
+-                              }
+-                              else
+-                              {
+-                                      g_error("Error loading GUI!\n Corrupted 
data in UI file!\n");
+-                              }
+-                      }
+-                      else
+-                      {
+-                              /* shouldn't call g_error directly, since it's 
a terminating call;
+-                                 so print the error, free the resources and 
then do it */
+-                              g_print("%s: ", err->message);
+-                              g_error_free(err);
+-                              err = NULL;
+-                              g_error("Error loading GUI from %s!\n", 
ui_file_path);
+-                      }
++#ifdef G_OS_WIN32
++      /* logic for single instance apps. on Win32 */
++      HANDLE single_instance_mutex = CreateMutex(NULL, FALSE, 
TEXT(PACKAGE_NAME));
+ 
+-                      g_free(ui_file_path);
+-                      ui_file_path = NULL;
+-              }
+-              else
+-              {
+-                      g_error("Error creating GtkBuilder!\n");
+-              }
+-      }
+-      else
++      if(ERROR_ALREADY_EXISTS == GetLastError() || !single_instance_mutex)
+       {
+-              g_error("Error initializing GUI!\n");
++              hMainWindow = FindWindow(NULL, TEXT(STR_APP_TITLE));
++              if(hMainWindow)
++                      PostMessage(hMainWindow, WM_ARTHA_RELAUNCH, 0, 0);
++              return 0;
+       }
++#endif
++
++      app = gtk_application_new("net.sourceforge.artha",
++                                G_APPLICATION_DEFAULT_FLAGS);
++      g_signal_connect(app, "activate", G_CALLBACK(app_activate), NULL);
++      g_set_application_name(PACKAGE_NAME);
++      status = g_application_run(G_APPLICATION(app), argc, argv);
++      g_object_unref(app);
+ 
+ #ifdef G_OS_WIN32
+       CloseHandle(single_instance_mutex);
+ #endif
+ 
+-      return 0;
++      return status;
+ }
+ 
+--- artha.orig/src/hotkey_editor.c
++++ artha/src/hotkey_editor.c
+@@ -48,25 +48,25 @@
+ static const guint forbidden_keyvals[] = 
+ {
+       /* Navigation keys */
+-      GDK_Home,
+-      GDK_Left,
+-      GDK_Up,
+-      GDK_Right,
+-      GDK_Down,
+-      GDK_Page_Up,
+-      GDK_Page_Down,
+-      GDK_End,
+-      GDK_Tab,
++      GDK_KEY_Home,
++      GDK_KEY_Left,
++      GDK_KEY_Up,
++      GDK_KEY_Right,
++      GDK_KEY_Down,
++      GDK_KEY_Page_Up,
++      GDK_KEY_Page_Down,
++      GDK_KEY_End,
++      GDK_KEY_Tab,
+ 
+       /* Return */
+-      GDK_KP_Enter,
+-      GDK_Return,
++      GDK_KEY_KP_Enter,
++      GDK_KEY_Return,
+ 
+-      GDK_space,
+-      GDK_Mode_switch,
+-      GDK_Delete,
+-      GDK_Print,
+-      GDK_Insert
++      GDK_KEY_space,
++      GDK_KEY_Mode_switch,
++      GDK_KEY_Delete,
++      GDK_KEY_Print,
++      GDK_KEY_Insert
+ };
+ 
+ gboolean grab_ungrab_with_ignorable_modifiers(GtkAccelKey *binding, gboolean 
grab);
+@@ -120,17 +120,17 @@
+       /* Check for unmodified keys */
+       if(temp_key.accel_mods == 0 && temp_key.accel_key != 0)
+       {
+-              if ((temp_key.accel_key >= GDK_a && temp_key.accel_key <= GDK_z)
+-                 || (temp_key.accel_key >= GDK_A && temp_key.accel_key <= 
GDK_Z)
+-                 || (temp_key.accel_key >= GDK_0 && temp_key.accel_key <= 
GDK_9)
+-                 || (temp_key.accel_key >= GDK_kana_fullstop && 
temp_key.accel_key <= GDK_semivoicedsound)
+-                 || (temp_key.accel_key >= GDK_Arabic_comma && 
temp_key.accel_key <= GDK_Arabic_sukun)
+-                 || (temp_key.accel_key >= GDK_Serbian_dje && 
temp_key.accel_key <= GDK_Cyrillic_HARDSIGN)
+-                 || (temp_key.accel_key >= GDK_Greek_ALPHAaccent && 
temp_key.accel_key <= GDK_Greek_omega)
+-                 || (temp_key.accel_key >= GDK_hebrew_doublelowline && 
temp_key.accel_key <= GDK_hebrew_taf)
+-                 || (temp_key.accel_key >= GDK_Thai_kokai && 
temp_key.accel_key <= GDK_Thai_lekkao)
+-                 || (temp_key.accel_key >= GDK_Hangul && temp_key.accel_key 
<= GDK_Hangul_Special)
+-                 || (temp_key.accel_key >= GDK_Hangul_Kiyeog && 
temp_key.accel_key <= GDK_Hangul_J_YeorinHieuh)
++              if ((temp_key.accel_key >= GDK_KEY_a && temp_key.accel_key <= 
GDK_KEY_z)
++                 || (temp_key.accel_key >= GDK_KEY_A && temp_key.accel_key <= 
GDK_KEY_Z)
++                 || (temp_key.accel_key >= GDK_KEY_0 && temp_key.accel_key <= 
GDK_KEY_9)
++                 || (temp_key.accel_key >= GDK_KEY_kana_fullstop && 
temp_key.accel_key <= GDK_KEY_semivoicedsound)
++                 || (temp_key.accel_key >= GDK_KEY_Arabic_comma && 
temp_key.accel_key <= GDK_KEY_Arabic_sukun)
++                 || (temp_key.accel_key >= GDK_KEY_Serbian_dje && 
temp_key.accel_key <= GDK_KEY_Cyrillic_HARDSIGN)
++                 || (temp_key.accel_key >= GDK_KEY_Greek_ALPHAaccent && 
temp_key.accel_key <= GDK_KEY_Greek_omega)
++                 || (temp_key.accel_key >= GDK_KEY_hebrew_doublelowline && 
temp_key.accel_key <= GDK_KEY_hebrew_taf)
++                 || (temp_key.accel_key >= GDK_KEY_Thai_kokai && 
temp_key.accel_key <= GDK_KEY_Thai_lekkao)
++                 || (temp_key.accel_key >= GDK_KEY_Hangul && 
temp_key.accel_key <= GDK_KEY_Hangul_Special)
++                 || (temp_key.accel_key >= GDK_KEY_Hangul_Kiyeog && 
temp_key.accel_key <= GDK_KEY_Hangul_J_YeorinHieuh)
+                  || keyval_is_forbidden (temp_key.accel_key))
+               {
+                       temp_str = gtk_accelerator_get_label (accel_key, 
accel_mods);
+--- artha.orig/src/eggaccelerators.c
++++ artha/src/eggaccelerators.c
+@@ -103,20 +103,20 @@
+       mask = 0;
+       for (j = 0; j < n_entries; ++j)
+         {
+-          if (keyvals[j] == GDK_Num_Lock)
++          if (keyvals[j] == GDK_KEY_Num_Lock)
+             mask |= EGG_VIRTUAL_NUM_LOCK_MASK;
+-          else if (keyvals[j] == GDK_Scroll_Lock)
++          else if (keyvals[j] == GDK_KEY_Scroll_Lock)
+             mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;
+-          else if (keyvals[j] == GDK_Meta_L ||
+-                   keyvals[j] == GDK_Meta_R)
++          else if (keyvals[j] == GDK_KEY_Meta_L ||
++                   keyvals[j] == GDK_KEY_Meta_R)
+             mask |= EGG_VIRTUAL_META_MASK;
+-          else if (keyvals[j] == GDK_Hyper_L ||
+-                   keyvals[j] == GDK_Hyper_R)
++          else if (keyvals[j] == GDK_KEY_Hyper_L ||
++                   keyvals[j] == GDK_KEY_Hyper_R)
+             mask |= EGG_VIRTUAL_HYPER_MASK;
+-          else if (keyvals[j] == GDK_Super_L ||
+-                   keyvals[j] == GDK_Super_R)
++          else if (keyvals[j] == GDK_KEY_Super_L ||
++                   keyvals[j] == GDK_KEY_Super_R)
+             mask |= EGG_VIRTUAL_SUPER_MASK;
+-          else if (keyvals[j] == GDK_Mode_switch)
++          else if (keyvals[j] == GDK_KEY_Mode_switch)
+             mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;
+         }
+ 
+@@ -149,7 +149,7 @@
+   EggModmap *modmap;
+ 
+   if (keymap == NULL)
+-    keymap = gdk_keymap_get_default ();
++    keymap = gdk_keymap_get_for_display (gdk_display_get_default ());
+ 
+   /* This is all a hack, much simpler when we can just
+    * modify GDK directly.
+--- artha.orig/src/tomboyutil.c
++++ artha/src/tomboyutil.c
+@@ -66,7 +66,7 @@
+ static void
+ tomboy_window_move_to_current_workspace (GtkWindow *window)
+ {
+-      GdkWindow *gdkwin = GTK_WIDGET (window)->window;
++      GdkWindow *gdkwin = gtk_widget_get_window (GTK_WIDGET (window));
+       GdkWindow *rootwin = 
+               gdk_screen_get_root_window (gdk_window_get_screen (gdkwin));
+ 
+@@ -99,7 +99,7 @@
+       xev.xclient.serial = 0;
+       xev.xclient.send_event = True;
+       xev.xclient.display = GDK_WINDOW_XDISPLAY (gdkwin);
+-      xev.xclient.window = GDK_WINDOW_XWINDOW (gdkwin);
++      xev.xclient.window = GDK_WINDOW_XID (gdkwin);
+       xev.xclient.message_type = 
+               gdk_x11_atom_to_xatom_for_display(
+                       gdk_window_get_display (gdkwin),
+@@ -110,7 +110,7 @@
+       xev.xclient.data.l[2] = 0;
+ 
+       XSendEvent (GDK_WINDOW_XDISPLAY (rootwin),
+-                  GDK_WINDOW_XWINDOW (rootwin),
++                  GDK_WINDOW_XID (rootwin),
+                   False,
+                   SubstructureRedirectMask | SubstructureNotifyMask,
+                   &xev);
+@@ -119,6 +119,7 @@
+ static void
+ tomboy_window_override_user_time (GtkWindow *window)
+ {
++      GdkWindow *win;
+       guint32 ev_time = gtk_get_current_event_time();
+ 
+       if (ev_time == 0) {
+@@ -128,6 +129,7 @@
+                */
+               ev_time = tomboy_keybinder_get_current_event_time ();
+       }
++      win = gtk_widget_get_window (GTK_WIDGET (window));
+       if (ev_time == 0) {
+               gint ev_mask = gtk_widget_get_events (GTK_WIDGET(window));
+               if (!(ev_mask & GDK_PROPERTY_CHANGE_MASK)) {
+@@ -139,11 +141,11 @@
+                * NOTE: Last resort for D-BUS or other non-interactive
+                *       openings.  Causes roundtrip to server.  Lame. 
+                */
+-              ev_time = gdk_x11_get_server_time (GTK_WIDGET(window)->window);
++              ev_time = gdk_x11_get_server_time (win);
+       }
+ 
+       TRACE (g_print("Setting _NET_WM_USER_TIME to: %d\n", ev_time));
+-      gdk_x11_window_set_user_time (GTK_WIDGET(window)->window, ev_time);
++      gdk_x11_window_set_user_time (win, ev_time);
+ }
+ 
+ void
+--- artha.orig/src/Makefile.am
++++ artha/src/Makefile.am
+@@ -9,7 +9,7 @@
+ libwni_a_SOURCES = wni.c wni.h
+ 
+ artha_DEPENDENCIES = libwni.a
+-artha_SOURCES = dbus-gmain.c dbus-gmain.h mod_notify.c mod_notify.h \
++artha_SOURCES = dbus-gmain.c dbus-gmain.h \
+               suggestions.c suggestions.h \
+               hotkey_editor.c hotkey_editor.h \
+               gui.c gui.h addons.h
+@@ -38,7 +38,7 @@
+ 
+ if POSIX
+ AM_CFLAGS += @libdbus_CFLAGS@
+-artha_LDADD += -lX11 -ldbus-1 -lgtk-x11-2.0 -lgdk-x11-2.0 \
++artha_LDADD += -lX11 -ldbus-1 \
+                -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0
+ else
+ artha_LDADD += @GTK_LIBS@
+--- artha.orig/src/gui.h
++++ artha/src/gui.h
+@@ -42,7 +42,6 @@
+ #include "instance_handler.h"
+ #include "eggaccelerators.h"
+ #include "hotkey_editor.h"
+-#include "mod_notify.h"
+ #include "tomboyutil.h"
+ 
+ /* pluggable module headers */
+--- artha.orig/data/Makefile.am
++++ artha/data/Makefile.am
+@@ -2,10 +2,10 @@
+ dist_icon_DATA = artha.png
+ dist_man_MANS = artha.1
+ 
+-EXTRA_DIST = artha.desktop artha.ico
++EXTRA_DIST = net.sourceforge.artha.desktop artha.ico
+ 
+ if POSIX
+-desktop_DATA = artha.desktop
++desktop_DATA = net.sourceforge.artha.desktop
+ desktopdir = $(datadir)/applications
+ uidir = $(datadir)/$(PACKAGE_TARNAME)
+ icondir = $(datadir)/@ICON_SUB_PATH@
+--- artha.orig/data/artha.desktop
++++ /dev/null
+@@ -1,11 +0,0 @@
+-[Desktop Entry]
+-Version=1.0
+-Name=Artha
+-GenericName=Thesaurus
+-Comment=Handy thesaurus based on WordNet
+-Exec=artha
+-Icon=artha
+-Terminal=false
+-Type=Application
+-StartupNotify=true
+-Categories=Utility;Languages;Literature;
+--- artha.orig/data/gui.glade
++++ artha/data/gui.glade
+@@ -1,232 +1,26 @@
+ <?xml version="1.0" encoding="UTF-8"?>
++<!-- Generated with glade 3.40.0 -->
+ <interface>
+-  <requires lib="gtk+" version="2.24"/>
+-  <!-- interface-naming-policy project-wide -->
+-  <object class="GtkDialog" id="optionsDialog">
+-    <property name="can_focus">False</property>
+-    <property name="border_width">5</property>
+-    <property name="title" translatable="yes">Artha ~ Options</property>
+-    <property name="resizable">False</property>
+-    <property name="modal">True</property>
+-    <property name="window_position">center-on-parent</property>
+-    <property name="type_hint">dialog</property>
+-    <property name="transient_for">wndMain</property>
+-    <child internal-child="vbox">
+-      <object class="GtkVBox" id="dialog-vbox2">
+-        <property name="visible">True</property>
+-        <property name="can_focus">False</property>
+-        <property name="spacing">10</property>
+-        <child internal-child="action_area">
+-          <object class="GtkHButtonBox" id="dialog-action_area2">
+-            <property name="visible">True</property>
+-            <property name="can_focus">False</property>
+-            <property name="layout_style">end</property>
+-            <child>
+-              <object class="GtkButton" id="btnCancel">
+-                <property name="label">gtk-cancel</property>
+-                <property name="visible">True</property>
+-                <property name="can_focus">True</property>
+-                <property name="receives_default">True</property>
+-                <property name="use_action_appearance">False</property>
+-                <property name="use_stock">True</property>
+-              </object>
+-              <packing>
+-                <property name="expand">False</property>
+-                <property name="fill">False</property>
+-                <property name="position">0</property>
+-              </packing>
+-            </child>
+-            <child>
+-              <object class="GtkButton" id="btnApply">
+-                <property name="label">gtk-apply</property>
+-                <property name="visible">True</property>
+-                <property name="can_focus">True</property>
+-                <property name="receives_default">True</property>
+-                <property name="use_action_appearance">False</property>
+-                <property name="use_stock">True</property>
+-              </object>
+-              <packing>
+-                <property name="expand">False</property>
+-                <property name="fill">False</property>
+-                <property name="position">1</property>
+-              </packing>
+-            </child>
+-          </object>
+-          <packing>
+-            <property name="expand">False</property>
+-            <property name="fill">True</property>
+-            <property name="pack_type">end</property>
+-            <property name="position">0</property>
+-          </packing>
+-        </child>
+-        <child>
+-          <object class="GtkVBox" id="vbox4">
+-            <property name="visible">True</property>
+-            <property name="can_focus">False</property>
+-            <property name="spacing">10</property>
+-            <child>
+-              <object class="GtkCheckButton" id="chkBtnStatusIcon">
+-                <property name="label" translatable="yes">Hide _status icon 
(runs Artha invisibly)</property>
+-                <property name="visible">True</property>
+-                <property name="can_focus">True</property>
+-                <property name="receives_default">False</property>
+-                <property name="use_action_appearance">False</property>
+-                <property name="use_underline">True</property>
+-                <property name="draw_indicator">True</property>
+-              </object>
+-              <packing>
+-                <property name="expand">True</property>
+-                <property name="fill">True</property>
+-                <property name="position">0</property>
+-              </packing>
+-            </child>
+-            <child>
+-              <object class="GtkCheckButton" id="chkBtnLaunchMin">
+-                <property name="label" translatable="yes">Show Artha's 
_window on launch</property>
+-                <property name="visible">True</property>
+-                <property name="can_focus">True</property>
+-                <property name="receives_default">False</property>
+-                <property name="use_action_appearance">False</property>
+-                <property name="use_underline">True</property>
+-                <property name="draw_indicator">True</property>
+-              </object>
+-              <packing>
+-                <property name="expand">True</property>
+-                <property name="fill">True</property>
+-                <property name="position">1</property>
+-              </packing>
+-            </child>
+-            <child>
+-              <object class="GtkVBox" id="vbox6">
+-                <property name="visible">True</property>
+-                <property name="can_focus">False</property>
+-                <child>
+-                  <object class="GtkCheckButton" id="chkBtnPolysemy">
+-                    <property name="label" translatable="yes">Show 
_familiarity based on polysemy count</property>
+-                    <property name="visible">True</property>
+-                    <property name="can_focus">True</property>
+-                    <property name="receives_default">False</property>
+-                    <property name="use_action_appearance">False</property>
+-                    <property name="use_underline">True</property>
+-                    <property name="draw_indicator">True</property>
+-                  </object>
+-                  <packing>
+-                    <property name="expand">True</property>
+-                    <property name="fill">True</property>
+-                    <property name="position">0</property>
+-                  </packing>
+-                </child>
+-                <child>
+-                  <object class="GtkLabel" id="lblPolysemy">
+-                    <property name="visible">True</property>
+-                    <property name="can_focus">False</property>
+-                    <property name="label" translatable="yes">Polysemy count 
is the number of senses a term has in a given part of speech. Based on this 
count WordNet classifies a term as &lt;i&gt;Rare&lt;/i&gt;, 
&lt;i&gt;Common&lt;/i&gt;, &lt;i&gt;very familiar&lt;/i&gt;, etc.</property>
+-                    <property name="use_markup">True</property>
+-                    <property name="wrap">True</property>
+-                  </object>
+-                  <packing>
+-                    <property name="expand">True</property>
+-                    <property name="fill">True</property>
+-                    <property name="position">1</property>
+-                  </packing>
+-                </child>
+-              </object>
+-              <packing>
+-                <property name="expand">True</property>
+-                <property name="fill">True</property>
+-                <property name="position">2</property>
+-              </packing>
+-            </child>
+-          </object>
+-          <packing>
+-            <property name="expand">True</property>
+-            <property name="fill">True</property>
+-            <property name="position">1</property>
+-          </packing>
+-        </child>
+-        <child>
+-          <object class="GtkVBox" id="vbox5">
+-            <property name="visible">True</property>
+-            <property name="can_focus">False</property>
+-            <child>
+-              <object class="GtkHBox" id="hboxHotkey">
+-                <property name="visible">True</property>
+-                <property name="can_focus">False</property>
+-                <child>
+-                  <object class="GtkLabel" id="lblHotkey">
+-                    <property name="visible">True</property>
+-                    <property name="can_focus">False</property>
+-                    <property name="label" translatable="yes">Global Lookup 
_Hotkey</property>
+-                    <property name="use_markup">True</property>
+-                    <property name="use_underline">True</property>
+-                    <property name="single_line_mode">True</property>
+-                  </object>
+-                  <packing>
+-                    <property name="expand">False</property>
+-                    <property name="fill">True</property>
+-                    <property name="padding">10</property>
+-                    <property name="position">0</property>
+-                  </packing>
+-                </child>
+-                <child>
+-                  <placeholder/>
+-                </child>
+-              </object>
+-              <packing>
+-                <property name="expand">True</property>
+-                <property name="fill">True</property>
+-                <property name="position">0</property>
+-              </packing>
+-            </child>
+-            <child>
+-              <object class="GtkLabel" id="lblHotkeyDesc">
+-                <property name="visible">True</property>
+-                <property name="can_focus">False</property>
+-                <property name="label" translatable="yes">Artha can be 
summoned (from inside any window) with a key combination (global accelerator) 
to lookup the selected text in thesaurus.
+-
+-This hotkey can be set by clicking on the Hotkey above box and pressing the 
required key combination. Press backspace to disable this 
functionality.</property>
+-                <property name="use_markup">True</property>
+-                <property name="wrap">True</property>
+-              </object>
+-              <packing>
+-                <property name="expand">True</property>
+-                <property name="fill">True</property>
+-                <property name="padding">10</property>
+-                <property name="position">1</property>
+-              </packing>
+-            </child>
+-          </object>
+-          <packing>
+-            <property name="expand">True</property>
+-            <property name="fill">True</property>
+-            <property name="padding">10</property>
+-            <property name="position">2</property>
+-          </packing>
+-        </child>
+-      </object>
+-    </child>
+-    <action-widgets>
+-      <action-widget response="-6">btnCancel</action-widget>
+-      <action-widget response="-10">btnApply</action-widget>
+-    </action-widgets>
+-  </object>
+-  <object class="GtkStatusIcon" id="statusIcon"/>
++  <requires lib="gtk+" version="3.22"/>
+   <object class="GtkWindow" id="wndMain">
+-    <property name="can_focus">False</property>
++    <property name="can-focus">False</property>
+     <property name="title" translatable="yes">Artha ~ The Open 
Thesaurus</property>
+-    <property name="window_position">center</property>
+-    <property name="default_width">600</property>
+-    <property name="default_height">550</property>
+-    <property name="urgency_hint">True</property>
++    <property name="window-position">center</property>
++    <property name="default-width">600</property>
++    <property name="default-height">550</property>
++    <property name="urgency-hint">True</property>
+     <property name="gravity">center</property>
+     <child>
+-      <object class="GtkVBox" id="vbox1">
++      <object class="GtkBox" id="vbox1">
+         <property name="visible">True</property>
+-        <property name="can_focus">False</property>
++        <property name="can-focus">False</property>
++        <property name="orientation">vertical</property>
+         <child>
+           <object class="GtkToolbar" id="toolbar">
+             <property name="visible">True</property>
+-            <property name="can_focus">False</property>
++            <property name="can-focus">False</property>
++            <property name="toolbar-style">both</property>
++            <property name="show-arrow">False</property>
+           </object>
+           <packing>
+             <property name="expand">False</property>
+@@ -235,32 +29,34 @@
+           </packing>
+         </child>
+         <child>
+-          <object class="GtkVPaned" id="vpanedBody">
++          <object class="GtkPaned" id="vpanedBody">
+             <property name="visible">True</property>
+-            <property name="can_focus">True</property>
++            <property name="can-focus">True</property>
++            <property name="orientation">vertical</property>
+             <child>
+               <object class="GtkFrame" id="frameDefn">
+                 <property name="visible">True</property>
+-                <property name="can_focus">False</property>
+-                <property name="label_xalign">0</property>
+-                <property name="label_yalign">0</property>
+-                <property name="shadow_type">in</property>
++                <property name="can-focus">False</property>
++                <property name="label-xalign">0</property>
++                <property name="label-yalign">0</property>
++                <property name="shadow-type">in</property>
+                 <child>
+-                  <object class="GtkVBox" id="vbox2">
++                  <object class="GtkBox" id="vbox2">
+                     <property name="visible">True</property>
+-                    <property name="can_focus">False</property>
+-                    <property name="border_width">10</property>
++                    <property name="can-focus">False</property>
++                    <property name="border-width">10</property>
++                    <property name="orientation">vertical</property>
+                     <child>
+-                      <object class="GtkHBox" id="hboxBody">
++                      <object class="GtkBox" id="hboxBody">
+                         <property name="visible">True</property>
+-                        <property name="can_focus">False</property>
++                        <property name="can-focus">False</property>
+                         <property name="spacing">5</property>
+                         <child>
+                           <object class="GtkLabel" id="lblSearch">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">_Query</property>
+-                            <property name="use_underline">True</property>
++                            <property name="use-underline">True</property>
+                           </object>
+                           <packing>
+                             <property name="expand">False</property>
+@@ -271,8 +67,15 @@
+                         <child>
+                           <object class="GtkComboBox" id="cboQuery">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
+-                            <property name="has_entry">True</property>
++                            <property name="can-focus">False</property>
++                            <property name="has-entry">True</property>
++                            <child internal-child="entry">
++                              <object class="GtkEntry">
++                                <property name="visible">True</property>
++                                <property name="can-focus">True</property>
++                                <property 
name="activates-default">True</property>
++                              </object>
++                            </child>
+                           </object>
+                           <packing>
+                             <property name="expand">True</property>
+@@ -283,13 +86,13 @@
+                         <child>
+                           <object class="GtkButton" id="btnSearch">
+                             <property name="label" 
translatable="yes">_Search</property>
++                            <property 
name="use-action-appearance">False</property>
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property name="can_default">True</property>
+-                            <property name="has_default">True</property>
+-                            <property name="receives_default">True</property>
+-                            <property 
name="use_action_appearance">False</property>
+-                            <property name="use_underline">True</property>
++                            <property name="can-focus">True</property>
++                            <property name="can-default">True</property>
++                            <property name="has-default">True</property>
++                            <property name="receives-default">True</property>
++                            <property name="use-underline">True</property>
+                           </object>
+                           <packing>
+                             <property name="expand">False</property>
+@@ -308,21 +111,19 @@
+                     <child>
+                       <object class="GtkScrolledWindow" id="scrollWndDefns">
+                         <property name="visible">True</property>
+-                        <property name="can_focus">True</property>
+-                        <property 
name="hscrollbar_policy">automatic</property>
+-                        <property 
name="vscrollbar_policy">automatic</property>
+-                        <property name="shadow_type">etched-out</property>
++                        <property name="can-focus">True</property>
++                        <property name="shadow-type">etched-out</property>
+                         <child>
+                           <object class="GtkTextView" id="txtDefinitions">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property name="pixels_above_lines">4</property>
+-                            <property name="pixels_below_lines">4</property>
+-                            <property name="pixels_inside_wrap">2</property>
++                            <property name="can-focus">True</property>
++                            <property name="pixels-above-lines">4</property>
++                            <property name="pixels-below-lines">4</property>
++                            <property name="pixels-inside-wrap">2</property>
+                             <property name="editable">False</property>
+-                            <property name="wrap_mode">word</property>
+-                            <property name="left_margin">5</property>
+-                            <property name="right_margin">5</property>
++                            <property name="wrap-mode">word</property>
++                            <property name="left-margin">5</property>
++                            <property name="right-margin">5</property>
+                           </object>
+                         </child>
+                       </object>
+@@ -343,33 +144,36 @@
+             <child>
+               <object class="GtkFrame" id="frameRelatives">
+                 <property name="visible">True</property>
+-                <property name="can_focus">False</property>
+-                <property name="label_xalign">0</property>
+-                <property name="label_yalign">0</property>
+-                <property name="shadow_type">in</property>
++                <property name="can-focus">False</property>
++                <property name="label-xalign">0</property>
++                <property name="label-yalign">0</property>
++                <property name="shadow-type">in</property>
+                 <child>
+                   <object class="GtkExpander" id="expander">
+                     <property name="visible">True</property>
+-                    <property name="can_focus">True</property>
++                    <property name="can-focus">True</property>
+                     <property name="expanded">True</property>
+-                    <property name="use_underline">True</property>
+                     <child>
+                       <object class="GtkNotebook" id="notebook">
+                         <property name="visible">True</property>
+-                        <property name="can_focus">True</property>
+-                        <property name="border_width">10</property>
+-                        <property name="tab_pos">left</property>
++                        <property name="can-focus">True</property>
++                        <property name="vexpand">True</property>
++                        <property name="border-width">10</property>
++                        <property name="tab-pos">left</property>
+                         <property name="scrollable">True</property>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndSynonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
++                            <property 
name="propagate-natural-width">True</property>
++                            <property 
name="propagate-natural-height">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeSynonyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -377,23 +181,24 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblSynonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Synonyms</property>
+                           </object>
+                           <packing>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndAntonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeAntonyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -404,24 +209,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblAntonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Antonyms</property>
+                           </object>
+                           <packing>
+                             <property name="position">1</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndDerivatives">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" 
id="treeDerivatives">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -432,24 +238,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblDerivatives">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Derivatives</property>
+                           </object>
+                           <packing>
+                             <property name="position">2</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndPertainyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treePertainyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -460,24 +267,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblPertainyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" translatable="yes">Relates 
to</property>
+                           </object>
+                           <packing>
+                             <property name="position">3</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndAttributes">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeAttributes">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -488,24 +296,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblAttributes">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Attributes</property>
+                           </object>
+                           <packing>
+                             <property name="position">4</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndSimilar">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeSimilar">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -516,24 +325,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblSimilar">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Similar</property>
+                           </object>
+                           <packing>
+                             <property name="position">5</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndDomain">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeDomain">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -544,24 +354,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblDomain">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Domain</property>
+                           </object>
+                           <packing>
+                             <property name="position">6</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndCauses">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeCauses">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -572,24 +383,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblCauses">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Causes</property>
+                           </object>
+                           <packing>
+                             <property name="position">7</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndEntails">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeEntails">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -600,24 +412,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblEntails">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Entails</property>
+                           </object>
+                           <packing>
+                             <property name="position">8</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndHypernyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeHypernyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -628,24 +441,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblHypernyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" translatable="yes">Kind 
of</property>
+                           </object>
+                           <packing>
+                             <property name="position">9</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndHyponyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeHyponyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -656,24 +470,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblHyponyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Kinds</property>
+                           </object>
+                           <packing>
+                             <property name="position">10</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndHolonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeHolonyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -684,24 +499,25 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblHolonyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" translatable="yes">Part 
of</property>
+                           </object>
+                           <packing>
+                             <property name="position">11</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                         <child>
+                           <object class="GtkScrolledWindow" 
id="scrollWndMeronyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">True</property>
+-                            <property 
name="hscrollbar_policy">automatic</property>
+-                            <property 
name="vscrollbar_policy">automatic</property>
++                            <property name="can-focus">True</property>
+                             <child>
+                               <object class="GtkTreeView" id="treeMeronyms">
+                                 <property name="visible">True</property>
+-                                <property name="can_focus">True</property>
++                                <property name="can-focus">True</property>
++                                <child internal-child="selection">
++                                  <object class="GtkTreeSelection"/>
++                                </child>
+                               </object>
+                             </child>
+                           </object>
+@@ -712,12 +528,12 @@
+                         <child type="tab">
+                           <object class="GtkLabel" id="lblMeronyms">
+                             <property name="visible">True</property>
+-                            <property name="can_focus">False</property>
++                            <property name="can-focus">False</property>
+                             <property name="label" 
translatable="yes">Parts</property>
+                           </object>
+                           <packing>
+                             <property name="position">12</property>
+-                            <property name="tab_fill">False</property>
++                            <property name="tab-fill">False</property>
+                           </packing>
+                         </child>
+                       </object>
+@@ -725,9 +541,9 @@
+                     <child type="label">
+                       <object class="GtkLabel" id="lblRelatives">
+                         <property name="visible">True</property>
+-                        <property name="can_focus">False</property>
++                        <property name="can-focus">False</property>
+                         <property name="label" 
translatable="yes">_Relatives</property>
+-                        <property name="use_underline">True</property>
++                        <property name="use-underline">True</property>
+                       </object>
+                     </child>
+                   </object>
+@@ -751,7 +567,7 @@
+         <child>
+           <object class="GtkStatusbar" id="statusbar">
+             <property name="visible">True</property>
+-            <property name="can_focus">False</property>
++            <property name="can-focus">False</property>
+             <property name="spacing">2</property>
+           </object>
+           <packing>
+@@ -763,4 +579,204 @@
+       </object>
+     </child>
+   </object>
++  <object class="GtkDialog" id="optionsDialog">
++    <property name="can-focus">False</property>
++    <property name="border-width">5</property>
++    <property name="title" translatable="yes">Artha ~ Options</property>
++    <property name="resizable">False</property>
++    <property name="modal">True</property>
++    <property name="window-position">center-on-parent</property>
++    <property name="type-hint">dialog</property>
++    <property name="transient-for">wndMain</property>
++    <child internal-child="vbox">
++      <object class="GtkBox" id="dialog-vbox2">
++        <property name="visible">True</property>
++        <property name="can-focus">False</property>
++        <property name="spacing">10</property>
++        <child internal-child="action_area">
++          <object class="GtkButtonBox" id="dialog-action_area2">
++            <property name="visible">True</property>
++            <property name="can-focus">False</property>
++            <property name="layout-style">end</property>
++            <child>
++              <object class="GtkButton" id="btnCancel">
++                <property name="label" translatable="yes">_Cancel</property>
++                <property name="use-action-appearance">False</property>
++                <property name="visible">True</property>
++                <property name="can-focus">True</property>
++                <property name="receives-default">True</property>
++                <property name="use-underline">True</property>
++              </object>
++              <packing>
++                <property name="expand">False</property>
++                <property name="fill">False</property>
++                <property name="position">0</property>
++              </packing>
++            </child>
++            <child>
++              <object class="GtkButton" id="btnApply">
++                <property name="label" translatable="yes">_Apply</property>
++                <property name="use-action-appearance">False</property>
++                <property name="visible">True</property>
++                <property name="can-focus">True</property>
++                <property name="receives-default">True</property>
++                <property name="use-underline">True</property>
++              </object>
++              <packing>
++                <property name="expand">False</property>
++                <property name="fill">False</property>
++                <property name="position">1</property>
++              </packing>
++            </child>
++          </object>
++          <packing>
++            <property name="expand">False</property>
++            <property name="fill">True</property>
++            <property name="pack-type">end</property>
++            <property name="position">0</property>
++          </packing>
++        </child>
++        <child>
++          <object class="GtkBox" id="vbox4">
++            <property name="visible">True</property>
++            <property name="can-focus">False</property>
++            <property name="orientation">vertical</property>
++            <property name="spacing">10</property>
++            <child>
++              <placeholder/>
++            </child>
++            <child>
++              <object class="GtkCheckButton" id="chkBtnLaunchMin">
++                <property name="label" translatable="yes">Show Artha's 
_window on launch</property>
++                <property name="use-action-appearance">False</property>
++                <property name="visible">True</property>
++                <property name="can-focus">True</property>
++                <property name="receives-default">False</property>
++                <property name="use-underline">True</property>
++                <property name="draw-indicator">True</property>
++              </object>
++              <packing>
++                <property name="expand">True</property>
++                <property name="fill">True</property>
++                <property name="position">1</property>
++              </packing>
++            </child>
++            <child>
++              <object class="GtkBox" id="vbox6">
++                <property name="visible">True</property>
++                <property name="can-focus">False</property>
++                <property name="orientation">vertical</property>
++                <child>
++                  <object class="GtkCheckButton" id="chkBtnPolysemy">
++                    <property name="label" translatable="yes">Show 
_familiarity based on polysemy count</property>
++                    <property name="use-action-appearance">False</property>
++                    <property name="visible">True</property>
++                    <property name="can-focus">True</property>
++                    <property name="receives-default">False</property>
++                    <property name="use-underline">True</property>
++                    <property name="draw-indicator">True</property>
++                  </object>
++                  <packing>
++                    <property name="expand">True</property>
++                    <property name="fill">True</property>
++                    <property name="position">0</property>
++                  </packing>
++                </child>
++                <child>
++                  <object class="GtkLabel" id="lblPolysemy">
++                    <property name="visible">True</property>
++                    <property name="can-focus">False</property>
++                    <property name="label" translatable="yes">Polysemy count 
is the number of senses a term has in a given part of speech. Based on this 
count WordNet classifies a term as &lt;i&gt;Rare&lt;/i&gt;, 
&lt;i&gt;Common&lt;/i&gt;, &lt;i&gt;very familiar&lt;/i&gt;, etc.</property>
++                    <property name="use-markup">True</property>
++                    <property name="wrap">True</property>
++                    <property name="max-width-chars">50</property>
++                  </object>
++                  <packing>
++                    <property name="expand">True</property>
++                    <property name="fill">True</property>
++                    <property name="position">1</property>
++                  </packing>
++                </child>
++              </object>
++              <packing>
++                <property name="expand">True</property>
++                <property name="fill">True</property>
++                <property name="position">2</property>
++              </packing>
++            </child>
++          </object>
++          <packing>
++            <property name="expand">True</property>
++            <property name="fill">True</property>
++            <property name="position">1</property>
++          </packing>
++        </child>
++        <child>
++          <object class="GtkBox" id="vbox5">
++            <property name="visible">True</property>
++            <property name="can-focus">False</property>
++            <property name="orientation">vertical</property>
++            <child>
++              <object class="GtkBox" id="hboxHotkey">
++                <property name="visible">True</property>
++                <property name="can-focus">False</property>
++                <child>
++                  <object class="GtkLabel" id="lblHotkey">
++                    <property name="visible">True</property>
++                    <property name="can-focus">False</property>
++                    <property name="label" translatable="yes">Global Lookup 
_Hotkey</property>
++                    <property name="use-markup">True</property>
++                    <property name="use-underline">True</property>
++                    <property name="single-line-mode">True</property>
++                  </object>
++                  <packing>
++                    <property name="expand">False</property>
++                    <property name="fill">True</property>
++                    <property name="padding">10</property>
++                    <property name="position">0</property>
++                  </packing>
++                </child>
++                <child>
++                  <placeholder/>
++                </child>
++              </object>
++              <packing>
++                <property name="expand">True</property>
++                <property name="fill">True</property>
++                <property name="position">0</property>
++              </packing>
++            </child>
++            <child>
++              <object class="GtkLabel" id="lblHotkeyDesc">
++                <property name="visible">True</property>
++                <property name="can-focus">False</property>
++                <property name="label" translatable="yes">Artha can be 
summoned (from inside any window) with a key combination (global accelerator) 
to lookup the selected text in thesaurus.
++
++This hotkey can be set by clicking on the Hotkey above box and pressing the 
required key combination. Press backspace to disable this 
functionality.</property>
++                <property name="use-markup">True</property>
++                <property name="wrap">True</property>
++                <property name="max-width-chars">50</property>
++              </object>
++              <packing>
++                <property name="expand">True</property>
++                <property name="fill">True</property>
++                <property name="padding">10</property>
++                <property name="position">1</property>
++              </packing>
++            </child>
++          </object>
++          <packing>
++            <property name="expand">True</property>
++            <property name="fill">True</property>
++            <property name="padding">10</property>
++            <property name="position">2</property>
++          </packing>
++        </child>
++      </object>
++    </child>
++    <action-widgets>
++      <action-widget response="-6">btnCancel</action-widget>
++      <action-widget response="-10">btnApply</action-widget>
++    </action-widgets>
++  </object>
+ </interface>
+--- /dev/null
++++ artha/data/net.sourceforge.artha.desktop
+@@ -0,0 +1,13 @@
++[Desktop Entry]
++Version=1.0
++Name=Artha
++GenericName=Thesaurus
++Comment=Handy thesaurus based on WordNet
++Exec=artha
++Icon=artha
++Terminal=false
++Type=Application
++StartupNotify=true
++Categories=Utility;Languages;Literature;
++DBusActivatable=true
++X-GNOME-UsesNotifications=true
diff --git a/debian/patches/series b/debian/patches/series
index c81ab8d..b5bb1be 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 make_sure_we_really_use_GTK_LIBS.patch
 spelling.patch
 no-dbus-glib.patch
+gtk3.patch
-- 
2.43.0

Reply via email to