[balsa/gtk3] Pass default screen, not NULL, to gtk_show_uri



commit 1be78b9f2c275fc2fb67b37e3a238755f0f09b1b
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jan 19 21:29:22 2011 -0500

    Pass default screen, not NULL, to gtk_show_uri
    
    2011-01-19  Peter Bloomfield
    
    	* libbalsa/identity.c (help_ident_cb):
    	* libbalsa/smtp-server.c (smtp_server_response):
    	* src/address-book-config.c (help_button_cb):
    	* src/balsa-mime-widget-message.c (extbody_call_url):
    	* src/balsa-mime-widget-text.c (store_button_coords),
    	(check_over_url), (handle_url):
    	* src/filter-edit-callbacks.c (condition_dialog_response),
    	(fe_dialog_response):
    	* src/filter-run-callbacks.c (fr_dialog_response):
    	* src/folder-conf.c (folder_conf_response):
    	* src/main-window.c:
    	* src/pref-manager.c (balsa_help_pbox_display):
    	* src/sendmsg-window.c (on_open_url_cb):
    	* src/toolbar-prefs.c (tp_dialog_response_cb):

 ChangeLog                       |   19 +++++++++++++++++++
 libbalsa/identity.c             |    2 +-
 libbalsa/smtp-server.c          |    3 ++-
 src/address-book-config.c       |    3 ++-
 src/balsa-mime-widget-message.c |    3 ++-
 src/balsa-mime-widget-text.c    |   21 ++++++---------------
 src/filter-edit-callbacks.c     |    6 ++++--
 src/filter-run-callbacks.c      |    3 ++-
 src/folder-conf.c               |    3 ++-
 src/main-window.c               |    6 ++++--
 src/pref-manager.c              |    3 ++-
 src/sendmsg-window.c            |    3 ++-
 src/toolbar-prefs.c             |    3 ++-
 13 files changed, 50 insertions(+), 28 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7688e9c..be1769e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-19  Peter Bloomfield
+
+	Pass default screen instead of NULL to gtk_show_uri
+
+	* libbalsa/identity.c (help_ident_cb):
+	* libbalsa/smtp-server.c (smtp_server_response):
+	* src/address-book-config.c (help_button_cb):
+	* src/balsa-mime-widget-message.c (extbody_call_url):
+	* src/balsa-mime-widget-text.c (store_button_coords),
+	(check_over_url), (handle_url):
+	* src/filter-edit-callbacks.c (condition_dialog_response),
+	(fe_dialog_response):
+	* src/filter-run-callbacks.c (fr_dialog_response):
+	* src/folder-conf.c (folder_conf_response):
+	* src/main-window.c:
+	* src/pref-manager.c (balsa_help_pbox_display):
+	* src/sendmsg-window.c (on_open_url_cb):
+	* src/toolbar-prefs.c (tp_dialog_response_cb):
+
 2011-01-17  Peter Bloomfield
 
 	* src/sendmsg-window.c (create_email_or_string_entry): new
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 11af7df..7b83cde 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -1662,7 +1662,7 @@ help_ident_cb(void)
 {
     GError *err = NULL;
 
-    gtk_show_uri(NULL, "ghelp:balsa?identities",
+    gtk_show_uri(gdk_screen_get_default(), "ghelp:balsa?identities",
                  gtk_get_current_event_time(), &err);
 
     if (err) {
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index 64b2053..06740f5 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -419,7 +419,8 @@ smtp_server_response(GtkDialog * dialog, gint response,
 
     switch (response) {
     case GTK_RESPONSE_HELP:
-        gtk_show_uri(NULL, "ghelp:balsa?smtp-server-config",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?smtp-server-config",
                      gtk_get_current_event_time(), &error);
         if (error) {
             libbalsa_information(LIBBALSA_INFORMATION_WARNING,
diff --git a/src/address-book-config.c b/src/address-book-config.c
index 0c28822..29166c3 100644
--- a/src/address-book-config.c
+++ b/src/address-book-config.c
@@ -532,7 +532,8 @@ help_button_cb(AddressBookConfig * abc)
 {
     GError *err = NULL;
 
-    gtk_show_uri(NULL, "ghelp:balsa?preferences-address-books",
+    gtk_show_uri(gdk_screen_get_default(),
+                 "ghelp:balsa?preferences-address-books",
                  gtk_get_current_event_time(), &err);
 
     if (err) {
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index f050457..8086515 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -290,7 +290,8 @@ extbody_call_url(GtkWidget * button, gpointer data)
     GError *err = NULL;
 
     g_return_if_fail(url);
-    gtk_show_uri(NULL, url, gtk_get_current_event_time(), &err);
+    gtk_show_uri(gdk_screen_get_default(), url,
+                 gtk_get_current_event_time(), &err);
     if (err) {
 	balsa_information(LIBBALSA_INFORMATION_WARNING,
 			  _("Error showing %s: %s\n"), url, err->message);
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index d457db9..6e869ad 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -584,11 +584,9 @@ store_button_coords(GtkWidget * widget, GdkEventButton * event,
                     gpointer data)
 {
     if (event->type == GDK_BUTTON_PRESS && event->button == 1) {
-        GdkWindow *window =
-            gtk_text_view_get_window(GTK_TEXT_VIEW(widget),
-                                     GTK_TEXT_WINDOW_TEXT);
-
-        gdk_window_get_pointer(window, &stored_x, &stored_y, &stored_mask);
+        stored_x = event->x;
+        stored_y = event->y;
+        stored_mask = event->state;
 
         /* compare only shift, ctrl, and mod1-mod5 */
         stored_mask &= STORED_MASK_BITS;
@@ -611,15 +609,7 @@ check_over_url(GtkWidget * widget, GdkEventMotion * event,
     if (event->type == GDK_LEAVE_NOTIFY)
         url = NULL;
     else {
-	gint x, y;
-	GdkModifierType mask;
-
-        /* FIXME: why can't we just use
-         * x = event->x;
-         * y = event->y;
-         * ??? */
-        gdk_window_get_pointer(window, &x, &y, &mask);
-        url = find_url(widget, x, y, url_list);
+        url = find_url(widget, (gint) event->x, (gint) event->y, url_list);
     }
 
     if (url) {
@@ -801,7 +791,8 @@ handle_url(const gchar * url)
         gtk_statusbar_push(statusbar, context_id, notice);
         SCHEDULE_BAR_REFRESH();
         g_free(notice);
-        gtk_show_uri(NULL, url, gtk_get_current_event_time(), &err);
+        gtk_show_uri(gdk_screen_get_default(), url,
+                     gtk_get_current_event_time(), &err);
         if (err) {
             balsa_information(LIBBALSA_INFORMATION_WARNING,
                               _("Error showing %s: %s\n"),
diff --git a/src/filter-edit-callbacks.c b/src/filter-edit-callbacks.c
index 983740b..f2f86a3 100644
--- a/src/filter-edit-callbacks.c
+++ b/src/filter-edit-callbacks.c
@@ -889,7 +889,8 @@ condition_dialog_response(GtkWidget * dialog, gint response,
         gtk_widget_hide(dialog);
         break;
     case GTK_RESPONSE_HELP:     /* Help button */
-        gtk_show_uri(NULL, "ghelp:balsa?win-condition",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?win-condition",
                      gtk_get_current_event_time(), &err);
 	if (err) {
 	    balsa_information_parented(GTK_WINDOW(dialog),
@@ -1496,7 +1497,8 @@ fe_dialog_response(GtkWidget * dialog, gint response, gpointer data)
         break;
 
     case GTK_RESPONSE_HELP:     /* Help button */
-        gtk_show_uri(NULL, "ghelp:balsa?win-filters",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?win-filters",
                      gtk_get_current_event_time(), &err);
 	if (err) {
 	    balsa_information_parented(GTK_WINDOW(dialog),
diff --git a/src/filter-run-callbacks.c b/src/filter-run-callbacks.c
index ded857a..78b8f49 100644
--- a/src/filter-run-callbacks.c
+++ b/src/filter-run-callbacks.c
@@ -176,7 +176,8 @@ void fr_dialog_response(GtkWidget * widget, gint response,
 	
 	break;
     case GTK_RESPONSE_HELP:     /* Help button */
-        gtk_show_uri(NULL, "ghelp:balsa?win-run-filters",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?win-run-filters",
                      gtk_get_current_event_time(), &err);
 	if (err) {
 	    balsa_information_parented(GTK_WINDOW(widget),
diff --git a/src/folder-conf.c b/src/folder-conf.c
index 93046d8..e372bd2 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -103,7 +103,8 @@ folder_conf_response(GtkDialog * dialog, int response,
 	g_object_ref(cdd->mbnode);
     switch (response) {
     case GTK_RESPONSE_HELP:
-        gtk_show_uri(NULL, "ghelp:balsa?folder-config",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?folder-config",
                      gtk_get_current_event_time(), &err);
         if (err) {
             balsa_information(LIBBALSA_INFORMATION_WARNING,
diff --git a/src/main-window.c b/src/main-window.c
index abad69c..ca0cc79 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2673,7 +2673,8 @@ bw_contents_cb(void)
 {
     GError *err = NULL;
 
-    gtk_show_uri(NULL, "ghelp:balsa", gtk_get_current_event_time(), &err);
+    gtk_show_uri(gdk_screen_get_default(), "ghelp:balsa",
+                 gtk_get_current_event_time(), &err);
     if (err) {
         balsa_information(LIBBALSA_INFORMATION_WARNING,
                           _("Error displaying help: %s\n"), err->message);
@@ -4412,7 +4413,8 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
                     ok = GTK_RESPONSE_CANCEL;
                 break;
 	    case GTK_RESPONSE_HELP:
-                gtk_show_uri(NULL, "ghelp:balsa?win-search",
+                gtk_show_uri(gdk_screen_get_default(),
+                             "ghelp:balsa?win-search",
                              gtk_get_current_event_time(), &err);
 		if (err) {
 		    balsa_information(LIBBALSA_INFORMATION_WARNING,
diff --git a/src/pref-manager.c b/src/pref-manager.c
index e79800d..837832c 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -3571,7 +3571,8 @@ balsa_help_pbox_display(void)
     g_free(text);
 
     uri = g_strconcat("ghelp:balsa?", link_id, NULL);
-    gtk_show_uri(NULL, uri, gtk_get_current_event_time(), &err);
+    gtk_show_uri(gdk_screen_get_default(), uri,
+                 gtk_get_current_event_time(), &err);
     g_free(uri);
     if (err) {
         balsa_information(LIBBALSA_INFORMATION_WARNING,
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 97b54e8..ec89333 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -1814,7 +1814,8 @@ on_open_url_cb(GtkWidget * menu_item, BalsaAttachInfo * info)
     g_return_if_fail(uri != NULL);
 
     g_message("open URL %s", uri);
-    gtk_show_uri(NULL, uri, gtk_get_current_event_time(), &err);
+    gtk_show_uri(gdk_screen_get_default(), uri,
+                 gtk_get_current_event_time(), &err);
     if (err) {
         balsa_information(LIBBALSA_INFORMATION_WARNING,
 			  _("Error showing %s: %s\n"),
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index fb3ca1c..1a43850 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -348,7 +348,8 @@ tp_dialog_response_cb(GtkDialog * dialog, gint response, gpointer data)
         gtk_widget_destroy(GTK_WIDGET(dialog));
         break;
     case GTK_RESPONSE_HELP:
-        gtk_show_uri(NULL, "ghelp:balsa?toolbar-prefs",
+        gtk_show_uri(gdk_screen_get_default(),
+                     "ghelp:balsa?toolbar-prefs",
                      gtk_get_current_event_time(), &err);
         if (err) {
             balsa_information(LIBBALSA_INFORMATION_WARNING,



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