Ticket #52281: patch_ui_frob-system-prompt.c.diff

File patch_ui_frob-system-prompt.c.diff, 1.0 KB (added by gwhitney, 8 years ago)

patchfile for gcr

  • ui/frob-system-prompt.c

    old new  
    2626#include "egg/egg-testing.h"
    2727
    2828#include <gtk/gtk.h>
     29#ifdef GDK_WINDOWING_X11
    2930#include <gdk/gdkx.h>
     31#endif
    3032
    3133#include <unistd.h>
    3234#include <string.h>
     
    5456        gcr_prompt_set_message (GCR_PROMPT (prompt), "This is the message");
    5557        gcr_prompt_set_description (GCR_PROMPT (prompt), "This is the description");
    5658
    57         caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent)));
     59        caller_id = NULL;
     60#ifdef GDK_WINDOWING_X11
     61        if (GDK_IS_X11_DISPLAY (gdk_window_get_display (gtk_widget_get_window (parent)))) {
     62                caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent)));
     63        }
     64#endif
     65        if (caller_id == NULL) {
     66                caller_id = g_strdup (gcr_prompt_util_mock_id_of_window (gtk_widget_get_window (parent)));
     67        }
    5868        gcr_prompt_set_caller_window (GCR_PROMPT (prompt), caller_id);
    5969        g_free (caller_id);
    6070