After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758026 - preview: X dependency
preview: X dependency
Product: nautilus
Classification: Core
Component: general
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Reported: 2015-11-12 19:21 UTC by Matthias Clasen
Modified: 2015-11-14 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---

preview: Don't assume X (1.33 KB, patch)
2015-11-12 19:48 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2015-11-12 19:21:57 UTC
Launching sushi does not work under Wayland because the nautilus code does unchecked gdk_x11 calls here:

nautilus_files_view_preview_files (NautilusFilesView *view,
                                   GList             *files,
                                   GArray            *locations)
        gchar *uri;
        guint xid;
        GtkWidget *toplevel;

        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));
        nautilus_previewer_call_show_file (uri, xid, TRUE);

        g_free (uri);

this needs a runtime (and compile time) check for X, and just pass 0 otherwise.
Of course, sushi needs to be able to handle 0, too.
Comment 1 Matthias Clasen 2015-11-12 19:48:38 UTC
Created attachment 315363 [details] [review]
preview: Don't assume X

We need to check at runtime if we are actually running under X,
before calling gdk_x11 API.
Comment 2 Cosimo Cecchi 2015-11-12 19:56:51 UTC
Review of attachment 315363 [details] [review]:

Thank you Matthias, looks good.
Comment 3 Cosimo Cecchi 2015-11-14 19:01:35 UTC
Pushed to master.

Attachment 315363 [details] pushed as 5305ef2 - preview: Don't assume X