[evince] shell: Fix the display comparison by name



commit 7dd69b5ffed358aa0777ac237bf2527ecc5d5c3c
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Fri Aug 15 17:42:13 2014 +0200

    shell: Fix the display comparison by name
    
    GdkAppLaunchContext uses gdk_screen_make_display_name() when it has a
    name to ruturn the display name, which appens the screen number. Use
    g_str_has_prefix() instead of comparing the whole string.

 shell/ev-application.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 6816c33..95d4103 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -129,7 +129,10 @@ ev_display_open_if_needed (const gchar *name)
        for (l = displays; l != NULL; l = l->next) {
                const gchar *display_name = gdk_display_get_name ((GdkDisplay *) l->data);
 
-               if (g_ascii_strcasecmp (display_name, name) == 0) {
+                /* The given name might come with the screen number, because GdkAppLaunchContext
+                 * uses gdk_screen_make_display_name().
+                 */
+                if (g_str_has_prefix (name, display_name)) {
                        display = l->data;
                        break;
                }


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