diff --git a/xdg_shell.c b/xdg_shell.c index a6fefd4..6948cd4 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -225,8 +225,12 @@ handle_xdg_toplevel_map(struct wl_listener *listener, void *data) view_map(view, xdg_shell_view->xdg_toplevel->base->surface); - wlr_foreign_toplevel_handle_v1_set_title(view->foreign_toplevel_handle, xdg_shell_view->xdg_toplevel->title); - wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel_handle, xdg_shell_view->xdg_toplevel->app_id); + if (xdg_shell_view->xdg_toplevel->title) + wlr_foreign_toplevel_handle_v1_set_title(view->foreign_toplevel_handle, + xdg_shell_view->xdg_toplevel->title); + if (xdg_shell_view->xdg_toplevel->app_id) + wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel_handle, + xdg_shell_view->xdg_toplevel->app_id); /* Activation state will be set by seat_set_focus */ } diff --git a/xwayland.c b/xwayland.c index 8f1ecdd..4c3281e 100644 --- a/xwayland.c +++ b/xwayland.c @@ -142,9 +142,12 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *data) view_map(view, xwayland_view->xwayland_surface->surface); - wlr_foreign_toplevel_handle_v1_set_title(view->foreign_toplevel_handle, xwayland_view->xwayland_surface->title); - wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel_handle, - xwayland_view->xwayland_surface->class); + if (xwayland_view->xwayland_surface->title) + wlr_foreign_toplevel_handle_v1_set_title(view->foreign_toplevel_handle, + xwayland_view->xwayland_surface->title); + if (xwayland_view->xwayland_surface->class) + wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel_handle, + xwayland_view->xwayland_surface->class); } static void