From 8d8ecb30f64f644ebe37bac827b018b51add12a2 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Sat, 6 Feb 2021 16:43:07 +0100 Subject: [PATCH] Show error if unsupported display protocol is used --- src/pcmanfm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pcmanfm.c b/src/pcmanfm.c index 4ae1a02..7811f59 100644 --- a/src/pcmanfm.c +++ b/src/pcmanfm.c @@ -37,6 +37,10 @@ #include #include /* for getcwd */ +#ifdef HAVE_WAYLAND +#include +#endif + #include #include "app-config.h" #include "main-win.h" @@ -349,6 +353,19 @@ gboolean pcmanfm_run(gint screen_num) { if(!desktop_running) { + GdkDisplay *default_display = gdk_display_get_default(); +#if HAVE_WAYLAND + if(!GDK_IS_X11_DISPLAY(default_display) && !gtk_layer_is_supported()) + { + fm_show_error(NULL, NULL, _("Only X11 and Wayland (with wlr-layer-shell) are supported")); +#else + if(!GDK_IS_X11_DISPLAY(default_display)) + { + fm_show_error(NULL, NULL, _("Only X11 is supported")); +#endif + reset_options(); + return FALSE; + } fm_desktop_manager_init(one_screen ? screen_num : -1); desktop_running = TRUE; }