Skip to content

Commit

Permalink
Show error if unsupported display protocol is used
Browse files Browse the repository at this point in the history
  • Loading branch information
wb9688 committed Feb 7, 2021
1 parent 786eab1 commit 8d8ecb3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/pcmanfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#include <signal.h>
#include <unistd.h> /* for getcwd */

#ifdef HAVE_WAYLAND
#include <gtk-layer-shell/gtk-layer-shell.h>
#endif

#include <libfm/fm-gtk.h>
#include "app-config.h"
#include "main-win.h"
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8d8ecb3

Please sign in to comment.