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