- Lock the session from the power button or `chandra-ctl lock` - Unlock with a face or the password; the password always works - Add compositor lock module with tests, and a polkit unlock policy (org.chandra.unlock) - Document the lock flow in docs/lock.md and link it from the README - Add generated interface bindings for the compositor and widget components
This commit is contained in:
1 parent
7501fc3ad9
commit
c790f96e58
131 files changed
+4693
-274
No files matched your search
@@ -68,7 +68,8 @@ enum {
|
||||
K_DA_CATS, K_DA_APPS, K_DA_SET, K_DA_REFRESH,
|
||||
K_DESKTOPS, K_DESKTOP_CUR, K_SET_DESKTOP,
|
||||
K_FU_STATUS, K_FU_FACES, K_FU_ENROLL, K_FU_REMOVE, K_FU_SET_IN_USE, K_FU_REFRESH,
|
||||
K_GL_STATUS, K_GL_GAMES, K_GL_MODES, K_GL_LAUNCH, K_GL_STOP, K_GL_FOCUS, K_GL_REFRESH
|
||||
K_GL_STATUS, K_GL_GAMES, K_GL_MODES, K_GL_LAUNCH, K_GL_STOP, K_GL_FOCUS, K_GL_REFRESH,
|
||||
K_OSK_IS_VISIBLE, K_OSK_SET_VISIBLE, K_ROT_CURRENT, K_ROT_SET
|
||||
};
|
||||
typedef struct Env { Inst *inst; int kind; } Env;
|
||||
|
||||
@@ -85,7 +86,8 @@ static int32_t host_ints[24] = {[7] = -1, [10] = -1}; /* 0 layout mode, 1 inspec
|
||||
4 screenshot state (bit 0 recording, bit 1 pointer in recordings),
|
||||
5 screen-off minutes, 6 suspend minutes (0: never),
|
||||
7 battery percent (-1: none), 8 battery charge-state, 9 battery seconds left,
|
||||
10 backlight brightness percent (-1: none) */
|
||||
10 backlight brightness percent (-1: none), 11 osk visible (0/1),
|
||||
12 display rotation (0..3) */
|
||||
|
||||
/* ---- requests a guest made of the host (launch, focus, ...) ; drained by the shell after each call ---- */
|
||||
typedef struct { int kind; int32_t n; char *s; } Req;
|
||||
@@ -493,6 +495,14 @@ static wasm_trap_t *host_import(void *env, const wasm_val_vec_t *args, wasm_val_
|
||||
if (results->size >= 1) results->data[0] = (wasm_val_t)WASM_I32_VAL((host_ints[4] >> 1) & 1);
|
||||
break;
|
||||
case K_INSPECT_SET: push_req(4, a0, NULL); break;
|
||||
case K_OSK_IS_VISIBLE:
|
||||
if (results->size >= 1) results->data[0] = (wasm_val_t)WASM_I32_VAL(host_ints[11] != 0);
|
||||
break;
|
||||
case K_OSK_SET_VISIBLE: push_req(21, a0 != 0, NULL); break;
|
||||
case K_ROT_CURRENT:
|
||||
if (results->size >= 1) results->data[0] = (wasm_val_t)WASM_I32_VAL(host_ints[12]);
|
||||
break;
|
||||
case K_ROT_SET: push_req(22, a0, NULL); break;
|
||||
case K_MOD_BROWSE: push_req(7, 0, NULL); break;
|
||||
case K_MOD_LOAD: { char *s = guest_str(in, a0, a1); push_req(5, 0, s); free(s); break; }
|
||||
case K_MOD_UNLOAD: { char *s = guest_str(in, a0, a1); push_req(6, 0, s); free(s); break; }
|
||||
@@ -702,6 +712,10 @@ static int classify_import(const wasm_name_t *m, const wasm_name_t *f) {
|
||||
if (!strcmp(iface, "layout-control") && !strcmp(fn, "set-layout")) return K_SET_LAYOUT;
|
||||
if (!strcmp(iface, "inspector") && !strcmp(fn, "is-on")) return K_INSPECT_IS_ON;
|
||||
if (!strcmp(iface, "inspector") && !strcmp(fn, "set-on")) return K_INSPECT_SET;
|
||||
if (!strcmp(iface, "osk") && !strcmp(fn, "is-visible")) return K_OSK_IS_VISIBLE;
|
||||
if (!strcmp(iface, "osk") && !strcmp(fn, "set-visible")) return K_OSK_SET_VISIBLE;
|
||||
if (!strcmp(iface, "rotation") && !strcmp(fn, "current")) return K_ROT_CURRENT;
|
||||
if (!strcmp(iface, "rotation") && !strcmp(fn, "set-rotation")) return K_ROT_SET;
|
||||
if (!strcmp(iface, "modules") && !strcmp(fn, "available")) return K_MOD_AVAILABLE;
|
||||
if (!strcmp(iface, "modules") && !strcmp(fn, "loaded")) return K_MOD_LOADED;
|
||||
if (!strcmp(iface, "modules") && !strcmp(fn, "load-module")) return K_MOD_LOAD;
|
||||
|
||||
Reference in new issue
Block a user