add function

relogin required if current is wayland
This commit is contained in:
desertstsung
2021-09-09 15:07:09 +08:00
parent d369955790
commit 1009eabdfe
3 changed files with 104 additions and 2 deletions

View File

@@ -360,7 +360,8 @@ class App: Reactor.Component
{is_can_screen_recording ? "": <CanScreenRecording />}
{is_can_screen_recording && !handler.is_process_trusted(false) ? <TrustMe /> : ""}
{system_error ? <SystemError /> : ""}
{!system_error && handler.is_login_wayland() ? <FixWayland /> : ""}
{!system_error && handler.is_login_wayland() && !handler.current_is_wayland() ? <FixWayland /> : ""}
{!system_error && handler.current_is_wayland() ? <ModifyDefaultLogin /> : ""}
</div>
<div .right-pane>
<div .right-content>
@@ -544,7 +545,7 @@ class FixWayland: Reactor.Component {
return <div .trust-me>
<div>Warning</div>
<div>Login screen using Wayland is not supported</div>
<div #fix-wayland .link>Disable it</div>
<div #fix-wayland .link>Fix it</div>
</div>;
}
@@ -554,6 +555,23 @@ class FixWayland: Reactor.Component {
}
}
class ModifyDefaultLogin: Reactor.Component {
function render() {
return <div .trust-me>
<div>Warning</div>
<div>Current Wayland display server is not supported</div>
<div #modify-default-login .link>Fix it(re-login required)</div>
</div>;
}
event click $(#modify-default-login) {
if (var r = handler.modify_default_login()) {
handler.msgbox("custom-error", "Error", r);
}
app.update();
}
}
function watch_trust() {
// not use TrustMe::update, because it is buggy
var trusted = handler.is_process_trusted(false);