diff options
| author | Israel Araújo de Oliveira <[email protected]> | 2026-02-09 06:00:35 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-09 17:00:35 +0800 |
| commit | 93a11ddedf697c9b673dd59628cee3db48ac67d0 (patch) | |
| tree | eaa37846d594604d49afb0333662df453103e88f /packages/desktop/src/index.tsx | |
| parent | 94feb811ca32f4e01a1bada9cfbc022e8d5ca9e3 (diff) | |
| download | opencode-93a11ddedf697c9b673dd59628cee3db48ac67d0.tar.gz opencode-93a11ddedf697c9b673dd59628cee3db48ac67d0.zip | |
feat(desktop): add native Wayland toggle on Linux (#11971)
Co-authored-by: Brendan Allan <[email protected]>
Diffstat (limited to 'packages/desktop/src/index.tsx')
| -rw-r--r-- | packages/desktop/src/index.tsx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/desktop/src/index.tsx b/packages/desktop/src/index.tsx index cf007bdd3..25e9f825c 100644 --- a/packages/desktop/src/index.tsx +++ b/packages/desktop/src/index.tsx @@ -1,7 +1,14 @@ // @refresh reload import { webviewZoom } from "./webview-zoom" import { render } from "solid-js/web" -import { AppBaseProviders, AppInterface, PlatformProvider, Platform, useCommand } from "@opencode-ai/app" +import { + AppBaseProviders, + AppInterface, + PlatformProvider, + Platform, + DisplayBackend, + useCommand, +} from "@opencode-ai/app" import { open, save } from "@tauri-apps/plugin-dialog" import { getCurrent, onOpenUrl } from "@tauri-apps/plugin-deep-link" import { openPath as openerOpenPath } from "@tauri-apps/plugin-opener" @@ -9,6 +16,7 @@ import { open as shellOpen } from "@tauri-apps/plugin-shell" import { type as ostype } from "@tauri-apps/plugin-os" import { check, Update } from "@tauri-apps/plugin-updater" import { getCurrentWindow } from "@tauri-apps/api/window" +import { invoke } from "@tauri-apps/api/core" import { isPermissionGranted, requestPermission } from "@tauri-apps/plugin-notification" import { relaunch } from "@tauri-apps/plugin-process" import { AsyncStorage } from "@solid-primitives/storage" @@ -338,6 +346,15 @@ const createPlatform = (password: Accessor<string | null>): Platform => ({ await commands.setDefaultServerUrl(url) }, + getDisplayBackend: async () => { + const result = await invoke<DisplayBackend | null>("get_display_backend").catch(() => null) + return result + }, + + setDisplayBackend: async (backend) => { + await invoke("set_display_backend", { backend }).catch(() => undefined) + }, + parseMarkdown: (markdown: string) => commands.parseMarkdownCommand(markdown), webviewZoom, |
