Added Markdown preview
This commit is contained in:
@@ -1,23 +1,13 @@
|
||||
mod pty;
|
||||
mod x11mod;
|
||||
|
||||
use pty::{pty_kill, pty_resize, pty_spawn, pty_write, PtyState};
|
||||
use x11mod::{
|
||||
app_close, app_launch, app_set_all_visible, app_set_geometry, app_set_visible, X11State,
|
||||
};
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
// X11 reparenting requires our own window to be an X11 window. On Wayland
|
||||
// sessions, GTK defaults to the Wayland backend and embedding is impossible.
|
||||
// Force the X11 backend (via XWayland on Wayland sessions) so we always get
|
||||
// an X11 toplevel we can reparent into.
|
||||
// webkit2gtk's hardware compositor fails in VMs / on systems without a
|
||||
// real GPU and the window goes grey. Fall back to software rendering.
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
std::env::set_var("GDK_BACKEND", "x11");
|
||||
// webkit2gtk's hardware compositor fails in VMs / on systems without a
|
||||
// real GPU and the window goes grey. Falling back to software rendering
|
||||
// here keeps the app usable everywhere.
|
||||
if std::env::var_os("WEBKIT_DISABLE_COMPOSITING_MODE").is_none() {
|
||||
std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
|
||||
}
|
||||
@@ -28,7 +18,6 @@ pub fn run() {
|
||||
|
||||
tauri::Builder::default()
|
||||
.manage(PtyState::default())
|
||||
.manage(X11State::new())
|
||||
.setup(|app| {
|
||||
if cfg!(debug_assertions) {
|
||||
app.handle().plugin(
|
||||
@@ -44,11 +33,6 @@ pub fn run() {
|
||||
pty_write,
|
||||
pty_resize,
|
||||
pty_kill,
|
||||
app_launch,
|
||||
app_set_geometry,
|
||||
app_set_visible,
|
||||
app_set_all_visible,
|
||||
app_close,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
Reference in New Issue
Block a user