Skip to content

Commit eddb9eb

Browse files
committed
desktop: work around egui_winit::clipboard bug causing segfaults on Wayland
1 parent 4706a78 commit eddb9eb

File tree

1 file changed

+7
-1
lines changed
  • desktop/src/backends

1 file changed

+7
-1
lines changed

desktop/src/backends/ui.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,16 @@ impl FileDialogResult for DesktopFileDialogResult {
145145
}
146146

147147
pub struct DesktopUiBackend {
148+
// It's important that `clipboard`` gets dropped before `window`, dropping
149+
// them the other way around causes a segfault inside `smithay_clipboard`.
150+
// See:
151+
// - https://github.com/emilk/egui/issues/7660
152+
// - https://github.com/emilk/egui/issues/7743
153+
clipboard: Clipboard,
148154
window: Arc<Window>,
155+
149156
event_loop: EventLoopProxy<RuffleEvent>,
150157
cursor_visible: bool,
151-
clipboard: Clipboard,
152158
preferences: GlobalPreferences,
153159
preferred_cursor: MouseCursor,
154160
font_database: Rc<fontdb::Database>,

0 commit comments

Comments
 (0)