[goffice] GUI: Fix minor multihead issue with help buttons.



commit 33788bd39f2c556c587a1cb1eae8e4fd3a579233
Author: Morten Welinder <terra gnome org>
Date:   Fri Mar 16 11:04:54 2012 -0400

    GUI: Fix minor multihead issue with help buttons.
    
    We need to supply a screen hint so help will show up on the right screen,
    not the default one.

 ChangeLog                 |    6 ++++++
 NEWS                      |    1 +
 goffice/gtk/goffice-gtk.c |   17 +++++++++--------
 3 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1f20b60..855d7a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-03-16  Morten Welinder  <terra gnome org>
 
+	* goffice/gtk/goffice-gtk.c (go_gtk_help_button_init): Hook up
+	cb_help normally, ie., not swapped.
+	(go_help_display): Add argument screen so we can show help on the
+	right screen.  Use go_gtk_url_show, not go_url_show, for the same
+	reason.
+
 	* goffice/utils/go-file.c (go_url_decode): Remove.  Glib's
 	g_uri_unescape_string does the same thing.
 
diff --git a/NEWS b/NEWS
index 1dff9a4..aef58eb 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Jean:
 Morten:
 	* Fix GOImage fallback for non-GUI case.
 	* Tweak bold attribute for rich text.
+	* Fix minor multihead issue with help buttons in dialogs.
 
 --------------------------------------------------------------------------
 goffice 0.9.2:
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 34481e7..62d743d 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -1035,10 +1035,10 @@ html_help (void)
 
 	return result;
 }
-
 #endif
+
 static void
-go_help_display (CBHelpPaths const *paths)
+go_help_display (CBHelpPaths const *paths, GdkScreen *screen)
 {
 #if defined(G_OS_WIN32)
 	static GHashTable* context_help_map = NULL;
@@ -1096,16 +1096,16 @@ go_help_display (CBHelpPaths const *paths)
 	}
 #else
 	char *uri = g_strconcat ("ghelp:", paths->app, "#", paths->link, NULL);
-	go_url_show (uri);
+	go_gtk_url_show (uri, screen);
 	g_free (uri);
 	return;
 #endif
 }
 
 static void
-cb_help (CBHelpPaths const *paths)
+cb_help (GtkWidget *w, CBHelpPaths const *paths)
 {
-	go_help_display (paths);
+	go_help_display (paths, gtk_widget_get_screen (w));
 }
 
 void
@@ -1121,9 +1121,10 @@ go_gtk_help_button_init (GtkWidget *w, char const *data_dir, char const *app, ch
 	paths->data_dir = data_dir;
 	paths->app	= app;
 	paths->link	= link;
-	g_signal_connect_data (G_OBJECT (w), "clicked",
-		G_CALLBACK (cb_help), (gpointer) paths,
-		(GClosureNotify)g_free, G_CONNECT_SWAPPED);
+	g_signal_connect_data (G_OBJECT (w),
+			       "clicked", G_CALLBACK (cb_help),
+			       (gpointer)paths, (GClosureNotify)g_free,
+			       0);
 }
 
 /**



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