Skip to content

Commit 985e957

Browse files
committed
fixup! Add support for security-context-v1
1 parent 098bad0 commit 985e957

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/server.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,13 @@ void output_manager_apply_notify(wl_listener* listener, void* data) {
365365

366366
bool filter_globals(const struct wl_client* client, const struct wl_global* global, void* data) {
367367
const auto& server = *static_cast<Server*>(data);
368-
const auto* wlr_xwayland = server.xwayland->wlr;
369368

370-
if (global == wlr_xwayland->shell_v1->global) {
371-
return wlr_xwayland->server != nullptr && client == wlr_xwayland->server->client;
369+
if (server.xwayland != nullptr) {
370+
const auto* wlr_xwayland = server.xwayland->wlr;
371+
372+
if (global == wlr_xwayland->shell_v1->global) {
373+
return wlr_xwayland->server != nullptr && client == wlr_xwayland->server->client;
374+
}
372375
}
373376

374377
const auto* security_context =
@@ -437,7 +440,7 @@ Server::Server() : listeners(*this) {
437440
wlr_data_device_manager_create(display);
438441

439442
security_context_manager = wlr_security_context_manager_v1_create(display);
440-
wl_display_set_global_filter(display, filter_globals, nullptr);
443+
wl_display_set_global_filter(display, filter_globals, this);
441444

442445
// https://wayfire.org/2020/08/04/Wayfire-0-5.html
443446
wlr_primary_selection_v1_device_manager_create(display);

0 commit comments

Comments
 (0)