mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 15:44:20 +03:00
linux: only tick the main thread tasks and one at a time in the event loop
This commit is contained in:
parent
f92be4b817
commit
1c410c1b99
BIN
crates/gpui/screenshot.png
Normal file
BIN
crates/gpui/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
@ -46,6 +46,13 @@ impl LinuxDispatcher {
|
||||
main_thread_id: thread::current().id(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tick_main(&self) {
|
||||
assert!(self.is_main_thread());
|
||||
if let Ok(runnable) = self.main_receiver.try_recv() {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PlatformDispatcher for LinuxDispatcher {
|
||||
|
@ -3,9 +3,8 @@
|
||||
use crate::{
|
||||
Action, AnyWindowHandle, BackgroundExecutor, Bounds, ClipboardItem, CursorStyle, DisplayId,
|
||||
ForegroundExecutor, Keymap, LinuxDispatcher, LinuxDisplay, LinuxTextSystem, LinuxWindow,
|
||||
LinuxWindowState, Menu, PathPromptOptions, Platform, PlatformDispatcher as _, PlatformDisplay,
|
||||
PlatformInput, PlatformTextSystem, PlatformWindow, Point, Result, SemanticVersion, Size, Task,
|
||||
WindowOptions,
|
||||
LinuxWindowState, Menu, PathPromptOptions, Platform, PlatformDisplay, PlatformInput,
|
||||
PlatformTextSystem, PlatformWindow, Point, Result, SemanticVersion, Size, Task, WindowOptions,
|
||||
};
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
@ -121,7 +120,7 @@ impl Platform for LinuxPlatform {
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
self.0.lock().dispatcher.tick(false);
|
||||
self.0.lock().dispatcher.tick_main();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user