mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Let the clipboard crate handle the lack of clipboard support
This commit is contained in:
parent
795e7f6002
commit
ec6cc56299
5 changed files with 6 additions and 29 deletions
|
@ -136,8 +136,6 @@ pub trait WindowMethods {
|
||||||
fn create_event_loop_waker(&self) -> Box<EventLoopWaker>;
|
fn create_event_loop_waker(&self) -> Box<EventLoopWaker>;
|
||||||
/// Get the coordinates of the native window, the screen and the framebuffer.
|
/// Get the coordinates of the native window, the screen and the framebuffer.
|
||||||
fn get_coordinates(&self) -> EmbedderCoordinates;
|
fn get_coordinates(&self) -> EmbedderCoordinates;
|
||||||
/// Does this window support a clipboard
|
|
||||||
fn supports_clipboard(&self) -> bool;
|
|
||||||
/// Set whether the application is currently animating.
|
/// Set whether the application is currently animating.
|
||||||
/// Typically, when animations are active, the window
|
/// Typically, when animations are active, the window
|
||||||
/// will want to avoid blocking on UI events, and just
|
/// will want to avoid blocking on UI events, and just
|
||||||
|
|
|
@ -374,10 +374,6 @@ pub struct InitialConstellationState {
|
||||||
|
|
||||||
/// A channel to the webgl thread.
|
/// A channel to the webgl thread.
|
||||||
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
|
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
|
||||||
|
|
||||||
/// Whether the constellation supports the clipboard.
|
|
||||||
/// TODO: this field is not used, remove it?
|
|
||||||
pub supports_clipboard: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Data needed for webdriver
|
/// Data needed for webdriver
|
||||||
|
@ -621,16 +617,12 @@ where
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
clipboard_ctx: if state.supports_clipboard {
|
clipboard_ctx: match ClipboardContext::new() {
|
||||||
match ClipboardContext::new() {
|
|
||||||
Ok(c) => Some(c),
|
Ok(c) => Some(c),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Error creating clipboard context ({})", e);
|
warn!("Error creating clipboard context ({})", e);
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
}
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
},
|
},
|
||||||
webdriver: WebDriverData::new(),
|
webdriver: WebDriverData::new(),
|
||||||
scheduler_chan: TimerScheduler::start(),
|
scheduler_chan: TimerScheduler::start(),
|
||||||
|
|
|
@ -150,7 +150,6 @@ where
|
||||||
create_compositor_channel(window.create_event_loop_waker());
|
create_compositor_channel(window.create_event_loop_waker());
|
||||||
let (embedder_proxy, embedder_receiver) =
|
let (embedder_proxy, embedder_receiver) =
|
||||||
create_embedder_channel(window.create_event_loop_waker());
|
create_embedder_channel(window.create_event_loop_waker());
|
||||||
let supports_clipboard = window.supports_clipboard();
|
|
||||||
let time_profiler_chan = profile_time::Profiler::create(
|
let time_profiler_chan = profile_time::Profiler::create(
|
||||||
&opts.time_profiling,
|
&opts.time_profiling,
|
||||||
opts.time_profiler_trace_path.clone(),
|
opts.time_profiler_trace_path.clone(),
|
||||||
|
@ -220,7 +219,6 @@ where
|
||||||
mem_profiler_chan.clone(),
|
mem_profiler_chan.clone(),
|
||||||
debugger_chan,
|
debugger_chan,
|
||||||
devtools_chan,
|
devtools_chan,
|
||||||
supports_clipboard,
|
|
||||||
&mut webrender,
|
&mut webrender,
|
||||||
webrender_document,
|
webrender_document,
|
||||||
webrender_api_sender,
|
webrender_api_sender,
|
||||||
|
@ -492,7 +490,6 @@ fn create_constellation(
|
||||||
mem_profiler_chan: mem::ProfilerChan,
|
mem_profiler_chan: mem::ProfilerChan,
|
||||||
debugger_chan: Option<debugger::Sender>,
|
debugger_chan: Option<debugger::Sender>,
|
||||||
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
||||||
supports_clipboard: bool,
|
|
||||||
webrender: &mut webrender::Renderer,
|
webrender: &mut webrender::Renderer,
|
||||||
webrender_document: webrender_api::DocumentId,
|
webrender_document: webrender_api::DocumentId,
|
||||||
webrender_api_sender: webrender_api::RenderApiSender,
|
webrender_api_sender: webrender_api::RenderApiSender,
|
||||||
|
@ -568,7 +565,6 @@ fn create_constellation(
|
||||||
private_resource_threads,
|
private_resource_threads,
|
||||||
time_profiler_chan,
|
time_profiler_chan,
|
||||||
mem_profiler_chan,
|
mem_profiler_chan,
|
||||||
supports_clipboard,
|
|
||||||
webrender_document,
|
webrender_document,
|
||||||
webrender_api_sender,
|
webrender_api_sender,
|
||||||
webgl_threads,
|
webgl_threads,
|
||||||
|
|
|
@ -437,11 +437,6 @@ impl WindowMethods for ServoCallbacks {
|
||||||
self.host_callbacks.flush();
|
self.host_callbacks.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn supports_clipboard(&self) -> bool {
|
|
||||||
debug!("WindowMethods::supports_clipboard");
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_event_loop_waker(&self) -> Box<EventLoopWaker> {
|
fn create_event_loop_waker(&self) -> Box<EventLoopWaker> {
|
||||||
debug!("WindowMethods::create_event_loop_waker");
|
debug!("WindowMethods::create_event_loop_waker");
|
||||||
self.waker.clone()
|
self.waker.clone()
|
||||||
|
|
|
@ -785,10 +785,6 @@ impl WindowMethods for Window {
|
||||||
fn prepare_for_composite(&self, _width: Length<u32, DevicePixel>, _height: Length<u32, DevicePixel>) -> bool {
|
fn prepare_for_composite(&self, _width: Length<u32, DevicePixel>, _height: Length<u32, DevicePixel>) -> bool {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
fn supports_clipboard(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn winit_phase_to_touch_event_type(phase: TouchPhase) -> TouchEventType {
|
fn winit_phase_to_touch_event_type(phase: TouchPhase) -> TouchEventType {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue