mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Don't drop wayland clipboard
This commit is contained in:
parent
bce6e1c6e9
commit
d7f506cf71
@ -8,6 +8,7 @@
|
|||||||
changes:
|
changes:
|
||||||
- "**/*.{glsl,rs,ron,toml,vox,png}"
|
- "**/*.{glsl,rs,ron,toml,vox,png}"
|
||||||
- "rust-toolchain"
|
- "rust-toolchain"
|
||||||
|
- "Cargo.lock"
|
||||||
- ".gitlab-ci.yml"
|
- ".gitlab-ci.yml"
|
||||||
- "**/*.yml"
|
- "**/*.yml"
|
||||||
|
|
||||||
@ -19,5 +20,6 @@
|
|||||||
- changes:
|
- changes:
|
||||||
- "**/*.{glsl,rs,ron,toml,vox,png,wav}"
|
- "**/*.{glsl,rs,ron,toml,vox,png,wav}"
|
||||||
- "rust-toolchain"
|
- "rust-toolchain"
|
||||||
|
- "Cargo.lock"
|
||||||
- ".gitlab-ci.yml"
|
- ".gitlab-ci.yml"
|
||||||
- "**/*.yml"
|
- "**/*.yml"
|
||||||
|
@ -78,6 +78,6 @@ inherits = 'release'
|
|||||||
debug = 1
|
debug = 1
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# cpal conflict fix isn't released yet
|
# macos CI fix isn't merged yet
|
||||||
winit = { git = "https://gitlab.com/veloren/winit.git", branch = "macos-test-spiffed" }
|
winit = { git = "https://gitlab.com/veloren/winit.git", branch = "macos-test-spiffed" }
|
||||||
vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics" }
|
vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics" }
|
||||||
|
@ -53,6 +53,7 @@ pub struct GlobalState {
|
|||||||
pub singleplayer: Option<Singleplayer>,
|
pub singleplayer: Option<Singleplayer>,
|
||||||
// TODO: redo this so that the watcher doesn't have to exist for reloading to occur
|
// TODO: redo this so that the watcher doesn't have to exist for reloading to occur
|
||||||
pub localization_watcher: watch::ReloadIndicator,
|
pub localization_watcher: watch::ReloadIndicator,
|
||||||
|
pub clipboard: Option<iced_winit::Clipboard>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GlobalState {
|
impl GlobalState {
|
||||||
|
@ -178,6 +178,8 @@ fn main() {
|
|||||||
// Create window
|
// Create window
|
||||||
let (window, event_loop) = Window::new(&settings).expect("Failed to create window!");
|
let (window, event_loop) = Window::new(&settings).expect("Failed to create window!");
|
||||||
|
|
||||||
|
let clipboard = iced_winit::Clipboard::new(window.window());
|
||||||
|
|
||||||
let global_state = GlobalState {
|
let global_state = GlobalState {
|
||||||
audio,
|
audio,
|
||||||
profile,
|
profile,
|
||||||
@ -190,6 +192,7 @@ fn main() {
|
|||||||
#[cfg(feature = "singleplayer")]
|
#[cfg(feature = "singleplayer")]
|
||||||
singleplayer: None,
|
singleplayer: None,
|
||||||
localization_watcher,
|
localization_watcher,
|
||||||
|
clipboard,
|
||||||
};
|
};
|
||||||
|
|
||||||
run::run(global_state, event_loop);
|
run::run(global_state, event_loop);
|
||||||
|
@ -1498,6 +1498,7 @@ impl CharSelectionUi {
|
|||||||
let (mut messages, _) = self.ui.maintain(
|
let (mut messages, _) = self.ui.maintain(
|
||||||
self.controls.view(&global_state.settings, &client),
|
self.controls.view(&global_state.settings, &client),
|
||||||
global_state.window.renderer_mut(),
|
global_state.window.renderer_mut(),
|
||||||
|
global_state.clipboard.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if self.enter_pressed {
|
if self.enter_pressed {
|
||||||
|
@ -590,6 +590,7 @@ impl<'a> MainMenuUi {
|
|||||||
let (messages, _) = self.ui.maintain(
|
let (messages, _) = self.ui.maintain(
|
||||||
self.controls.view(&global_state.settings, dt.as_secs_f32()),
|
self.controls.view(&global_state.settings, dt.as_secs_f32()),
|
||||||
global_state.window.renderer_mut(),
|
global_state.window.renderer_mut(),
|
||||||
|
global_state.clipboard.as_ref(),
|
||||||
);
|
);
|
||||||
|
|
||||||
messages.into_iter().for_each(|message| {
|
messages.into_iter().for_each(|message| {
|
||||||
|
@ -26,7 +26,6 @@ pub struct IcedUi {
|
|||||||
renderer: IcedRenderer,
|
renderer: IcedRenderer,
|
||||||
cache: Option<Cache>,
|
cache: Option<Cache>,
|
||||||
events: Vec<Event>,
|
events: Vec<Event>,
|
||||||
clipboard: Clipboard,
|
|
||||||
cursor_position: Vec2<f32>,
|
cursor_position: Vec2<f32>,
|
||||||
// Scaling of the ui
|
// Scaling of the ui
|
||||||
scale: Scale,
|
scale: Scale,
|
||||||
@ -55,7 +54,6 @@ impl IcedUi {
|
|||||||
cache: Some(Cache::new()),
|
cache: Some(Cache::new()),
|
||||||
events: Vec::new(),
|
events: Vec::new(),
|
||||||
// TODO: handle None
|
// TODO: handle None
|
||||||
clipboard: Clipboard::new(window.window()).unwrap(),
|
|
||||||
cursor_position: Vec2::zero(),
|
cursor_position: Vec2::zero(),
|
||||||
scale,
|
scale,
|
||||||
scale_changed: false,
|
scale_changed: false,
|
||||||
@ -146,6 +144,7 @@ impl IcedUi {
|
|||||||
&mut self,
|
&mut self,
|
||||||
root: E,
|
root: E,
|
||||||
renderer: &mut Renderer,
|
renderer: &mut Renderer,
|
||||||
|
clipboard: Option<&Clipboard>,
|
||||||
) -> (Vec<M>, mouse::Interaction) {
|
) -> (Vec<M>, mouse::Interaction) {
|
||||||
span!(_guard, "maintain", "IcedUi::maintain");
|
span!(_guard, "maintain", "IcedUi::maintain");
|
||||||
// Handle window resizing, dpi factor change, and scale mode changing
|
// Handle window resizing, dpi factor change, and scale mode changing
|
||||||
@ -188,7 +187,10 @@ impl IcedUi {
|
|||||||
let messages = user_interface.update(
|
let messages = user_interface.update(
|
||||||
&self.events,
|
&self.events,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
Some(&self.clipboard),
|
match clipboard {
|
||||||
|
Some(c) => Some(c),
|
||||||
|
None => None,
|
||||||
|
},
|
||||||
&self.renderer,
|
&self.renderer,
|
||||||
);
|
);
|
||||||
drop(guard);
|
drop(guard);
|
||||||
|
Loading…
Reference in New Issue
Block a user