From 1b0df02d6fcac357d753d4f0a0c541139c72eb64 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Sat, 4 Jul 2026 11:06:59 +0200 Subject: [PATCH] exclude WAYLAND_DISPLAY from env when starting mpv --- application/player.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/application/player.c b/application/player.c index 5c4bcf2..73b9e7c 100644 --- a/application/player.c +++ b/application/player.c @@ -169,13 +169,26 @@ static int start_player_process(Player *player, MainWindow *win) { //posix_spawn_file_actions_adddup2(&actions, pin[0], STDIN_FILENO); //posix_spawn_file_actions_adddup2(&actions, pout[1], STDOUT_FILENO); + CX_ARRAY(char*, env); + cx_array_init(env, 96); + for(int i=0;environ[i] != NULL;i++) { + cxstring env_str = cx_str(environ[i]); + if(!cx_strprefix(env_str, "WAYLAND_DISPLAY")) { + //printf("ENV: %s\n", env_str.ptr); + cx_array_add(env, env_str.ptr); + } + } + char *n = NULL; + cx_array_add(env, n); + // start player pid_t player_pid; - if(posix_spawn(&player_pid, player_bin, &actions, NULL, args, environ)) { + if(posix_spawn(&player_pid, player_bin, &actions, NULL, args, env.data)) { perror("posix_spawn"); return 1; } posix_spawn_file_actions_destroy(&actions); + free(env.data); player->process = player_pid; player->isactive = TRUE; -- 2.52.0