This commit is contained in:
veclavtlica
2026-10-12 21:52:52 +03:00
parent 8d2bb5575e
commit 964e623644
5 changed files with 28 additions and 16 deletions
+8 -2
View File
@@ -408,6 +408,10 @@ static bool plr_x11_establish_connection(com_std_fd xfd, int argc,
char const *const *argv) {
com_buf_make_on_stack(char, xauthbuf, 1024, 0);
/* TODO: Genralize inside std? */
#if COM_DEF_TARGET == COM_DEF_TARGET_COSMO
char const *xauthpath = getenv("XAUTHORITY");
#else
/* First we need to authenticate X11 connection, which requires some funk.
*/
/* We assume that $XAUTHORITY is set and I hope it is true. */
@@ -419,10 +423,11 @@ static bool plr_x11_establish_connection(com_std_fd xfd, int argc,
break;
}
}
#endif
/* Open it and parse. */
com_std_fd const xauthfd = com_std_open(xauthpath, COM_STD_OPEN_READ);
if (xauthfd < 0) {
if (!xauthfd) {
com_std_print('c', "Failure to initialize X11");
return false;
}
@@ -481,8 +486,9 @@ extern int plr_display_x11_main(int argc, char const *const *argv) {
// com_vec_t v0 = com_mat_vec_project(com_mat_reoder(m0), com_vec_identity());
// com_fix_print(v0.a[0]);
/* TODO: Move to separate executable maybe? */
#ifndef NDEBUG
com_test_run();
// com_test_run();
#endif
// com_fix_run_tests();