diff --git a/src/screencast/screencast.c b/src/screencast/screencast.c index 62f41ff..188e235 100644 --- a/src/screencast/screencast.c +++ b/src/screencast/screencast.c @@ -526,6 +526,7 @@ int xdpw_screencast_init(struct xdpw_state *state) { state->screencast = (struct xdpw_screencast_context) { 0 }; state->screencast.state = state; + state->screencast.hyprland_toplevel_manager = NULL; int err; err = xdpw_pwr_context_create(state); diff --git a/src/screencast/wlr_screencast.c b/src/screencast/wlr_screencast.c index 9e8858b..d807739 100644 --- a/src/screencast/wlr_screencast.c +++ b/src/screencast/wlr_screencast.c @@ -601,6 +601,10 @@ struct xdpw_share xdpw_wlr_chooser(struct xdpw_screencast_context *ctx) { struct xdpw_share res2 = {out, coords[0], coords[1], coords[2], coords[3]}; return res2; } else if (strncmp(result, "window:", 7) == 0) { + if (ctx->hyprland_toplevel_manager == NULL) { + return res; + } + char *display_name = malloc(strlen(result) - 7); strncpy(display_name, result + 7, strlen(result) - 8); display_name[strlen(result) - 8] = 0;