Skip to content

Commit

Permalink
Check if X11 before requesting X11 WM name
Browse files Browse the repository at this point in the history
  • Loading branch information
wb9688 authored and ib committed Sep 17, 2023
1 parent 6d4ed86 commit c5ace45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ extern gboolean plugin_load(LXAppearance* app, GtkBuilder* lxappearance_builder)
if(app->abi_version > LXAPPEARANCE_ABI_VERSION)
return FALSE;

GdkScreen *screen = gtk_widget_get_screen(app->dlg);
if(!GDK_IS_X11_SCREEN(screen))
return FALSE;

/* detect openbox */
const char* wm_name = gdk_x11_screen_get_window_manager_name(gtk_widget_get_screen(app->dlg));
const char* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if(g_strcmp0(wm_name, "Openbox"))
return FALSE; /* don't load the plugin if openbox is not in use. */

Expand Down

0 comments on commit c5ace45

Please sign in to comment.