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:
Mikayla Maki 2024-03-20 19:22:47 -07:00 committed by GitHub
parent 9b0949b6fb
commit 0b019282c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 108 additions and 85 deletions

View file

@ -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,