Commit 5305ef25 authored by Matthias Clasen's avatar Matthias Clasen Committed by Cosimo Cecchi
Browse files

preview: Don't assume X

We need to check at runtime if we are actually running under X,
before calling gdk_x11 API.
parent d4a8061c
......@@ -1141,13 +1141,19 @@ nautilus_files_view_preview_files (NautilusFilesView *view,
GArray *locations)
gchar *uri;
guint xid;
guint xid = 0;
GtkWidget *toplevel;
GdkWindow *window;
uri = nautilus_file_get_uri (files->data);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
xid = gdk_x11_window_get_xid (gtk_widget_get_window (toplevel));
window = gtk_widget_get_window (toplevel);
if (GDK_IS_X11_WINDOW (window))
xid = gdk_x11_window_get_xid (gtk_widget_get_window (toplevel));
nautilus_previewer_call_show_file (uri, xid, TRUE);
g_free (uri);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment