Wayland: double click (#9608)
This PR builds off of an earlier version of https://github.com/zed-industries/zed/pull/9595, rearranges some of the logic, and removes an unused platform API. Release Notes: - N/A --------- Co-authored-by: apricotbucket28 <agustin.nicolas.marcos@outlook.com>
This commit is contained in:
parent
9b0949b6fb
commit
0b019282c3
9 changed files with 108 additions and 85 deletions
|
@ -22,8 +22,8 @@ use wayland_client::Connection;
|
|||
use crate::platform::linux::client::Client;
|
||||
use crate::platform::linux::wayland::WaylandClient;
|
||||
use crate::{
|
||||
Action, AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DisplayId,
|
||||
ForegroundExecutor, Keymap, LinuxDispatcher, LinuxTextSystem, Menu, PathPromptOptions,
|
||||
px, Action, AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DisplayId,
|
||||
ForegroundExecutor, Keymap, LinuxDispatcher, LinuxTextSystem, Menu, PathPromptOptions, Pixels,
|
||||
Platform, PlatformDisplay, PlatformInput, PlatformTextSystem, PlatformWindow, Result,
|
||||
SemanticVersion, Task, WindowOptions, WindowParams,
|
||||
};
|
||||
|
@ -32,6 +32,11 @@ use super::x11::X11Client;
|
|||
|
||||
pub(super) const SCROLL_LINES: f64 = 3.0;
|
||||
|
||||
// Values match the defaults on GTK.
|
||||
// Taken from https://github.com/GNOME/gtk/blob/main/gtk/gtksettings.c#L320
|
||||
pub(super) const DOUBLE_CLICK_INTERVAL: Duration = Duration::from_millis(400);
|
||||
pub(super) const DOUBLE_CLICK_DISTANCE: Pixels = px(5.0);
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct Callbacks {
|
||||
open_urls: Option<Box<dyn FnMut(Vec<String>)>>,
|
||||
|
@ -310,10 +315,6 @@ impl Platform for LinuxPlatform {
|
|||
"Linux"
|
||||
}
|
||||
|
||||
fn double_click_interval(&self) -> Duration {
|
||||
Duration::default()
|
||||
}
|
||||
|
||||
fn os_version(&self) -> Result<SemanticVersion> {
|
||||
Ok(SemanticVersion {
|
||||
major: 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue