mirror of
https://github.com/servo/servo.git
synced 2025-07-06 06:53:38 +01:00
Auto merge of #21688 - paulrouget:rm-clipboard, r=jdm
Let the clipboard crate handle the lack of clipboard support --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21688) <!-- Reviewable:end -->
This commit is contained in:
commit
ed86bc7ec6
5 changed files with 6 additions and 29 deletions
|
@ -136,8 +136,6 @@ pub trait WindowMethods {
|
|||
fn create_event_loop_waker(&self) -> Box<EventLoopWaker>;
|
||||
/// Get the coordinates of the native window, the screen and the framebuffer.
|
||||
fn get_coordinates(&self) -> EmbedderCoordinates;
|
||||
/// Does this window support a clipboard
|
||||
fn supports_clipboard(&self) -> bool;
|
||||
/// Set whether the application is currently animating.
|
||||
/// Typically, when animations are active, the window
|
||||
/// will want to avoid blocking on UI events, and just
|
||||
|
|
|
@ -374,10 +374,6 @@ pub struct InitialConstellationState {
|
|||
|
||||
/// A channel to the webgl thread.
|
||||
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
|
||||
|
@ -621,16 +617,12 @@ where
|
|||
),
|
||||
},
|
||||
phantom: PhantomData,
|
||||
clipboard_ctx: if state.supports_clipboard {
|
||||
match ClipboardContext::new() {
|
||||
Ok(c) => Some(c),
|
||||
Err(e) => {
|
||||
warn!("Error creating clipboard context ({})", e);
|
||||
None
|
||||
},
|
||||
}
|
||||
} else {
|
||||
None
|
||||
clipboard_ctx: match ClipboardContext::new() {
|
||||
Ok(c) => Some(c),
|
||||
Err(e) => {
|
||||
warn!("Error creating clipboard context ({})", e);
|
||||
None
|
||||
},
|
||||
},
|
||||
webdriver: WebDriverData::new(),
|
||||
scheduler_chan: TimerScheduler::start(),
|
||||
|
|
|
@ -151,7 +151,6 @@ where
|
|||
create_compositor_channel(window.create_event_loop_waker());
|
||||
let (embedder_proxy, embedder_receiver) =
|
||||
create_embedder_channel(window.create_event_loop_waker());
|
||||
let supports_clipboard = window.supports_clipboard();
|
||||
let time_profiler_chan = profile_time::Profiler::create(
|
||||
&opts.time_profiling,
|
||||
opts.time_profiler_trace_path.clone(),
|
||||
|
@ -221,7 +220,6 @@ where
|
|||
mem_profiler_chan.clone(),
|
||||
debugger_chan,
|
||||
devtools_chan,
|
||||
supports_clipboard,
|
||||
&mut webrender,
|
||||
webrender_document,
|
||||
webrender_api_sender,
|
||||
|
@ -493,7 +491,6 @@ fn create_constellation(
|
|||
mem_profiler_chan: mem::ProfilerChan,
|
||||
debugger_chan: Option<debugger::Sender>,
|
||||
devtools_chan: Option<Sender<devtools_traits::DevtoolsControlMsg>>,
|
||||
supports_clipboard: bool,
|
||||
webrender: &mut webrender::Renderer,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
|
@ -569,7 +566,6 @@ fn create_constellation(
|
|||
private_resource_threads,
|
||||
time_profiler_chan,
|
||||
mem_profiler_chan,
|
||||
supports_clipboard,
|
||||
webrender_document,
|
||||
webrender_api_sender,
|
||||
webgl_threads,
|
||||
|
|
|
@ -437,11 +437,6 @@ impl WindowMethods for ServoCallbacks {
|
|||
self.host_callbacks.flush();
|
||||
}
|
||||
|
||||
fn supports_clipboard(&self) -> bool {
|
||||
debug!("WindowMethods::supports_clipboard");
|
||||
false
|
||||
}
|
||||
|
||||
fn create_event_loop_waker(&self) -> Box<EventLoopWaker> {
|
||||
debug!("WindowMethods::create_event_loop_waker");
|
||||
self.waker.clone()
|
||||
|
|
|
@ -813,10 +813,6 @@ impl WindowMethods for Window {
|
|||
) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn supports_clipboard(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
fn winit_phase_to_touch_event_type(phase: TouchPhase) -> TouchEventType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue