Skip to content

Commit ca72d87

Browse files
committed
More Linux + example fixes
1 parent 3f4d106 commit ca72d87

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

crates/gpui/src/gpui.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#![allow(unused_mut)] // False positives in platform specific code
44
#![warn(clippy::wildcard_imports)]
55

6+
use std::{any::Any, future::Future};
7+
68
extern crate self as gpui;
79

810
#[macro_use]
@@ -65,7 +67,6 @@ mod seal {
6567

6668
pub extern crate lucie_common as common;
6769
pub extern crate lucie_macros as macros;
68-
use std::{any::Any, future::Future};
6970

7071
pub use action::*;
7172
pub use anyhow::Result;
@@ -84,7 +85,10 @@ pub use input::*;
8485
pub use interactive::*;
8586
use key_dispatch::{DispatchActionListener, DispatchNodeId, DispatchTree, Replay};
8687
pub use keymap::*;
87-
pub use lucie_common::refineable;
88+
pub use lucie_common::{
89+
SharedString,
90+
refineable::{self, Refineable}
91+
};
8892
pub use lucie_macros::{AppContext, IntoElement, Render, VisualContext, register_action, test};
8993
pub use path_builder::*;
9094
pub use platform::*;

crates/gpui/src/platform/linux/x11/clipboard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ fn serve_requests(context: Arc<Inner>) -> Result<(), Box<dyn std::error::Error>>
721721

722722
log::trace!("Started serve requests thread.");
723723

724-
let _guard = crate::util::defer(|| {
724+
let _guard = lucie_common::defer(|| {
725725
context.serve_stopped.store(true, Ordering::Relaxed);
726726
});
727727

crates/gpui/src/platform/linux/x11/window.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{cell::RefCell, ffi::c_void, fmt::Display, num::NonZeroU32, ops::Div, p
22

33
use anyhow::{Context as _, anyhow};
44
use blade_graphics as gpu;
5-
use lucie_common::ResultExt as _;
5+
use lucie_common::{ResultExt as _, trys};
66
use raw_window_handle as rwh;
77
use x11rb::{
88
connection::{Connection, RequestConnection},
@@ -22,7 +22,7 @@ use super::{X11Display, XINPUT_ALL_DEVICE_GROUPS, XINPUT_ALL_DEVICES};
2222
use crate::{
2323
AnyWindowHandle, Bounds, Decorations, DevicePixels, ForegroundExecutor, GpuSpecs, Modifiers, Pixels, PlatformAtlas, PlatformDisplay, PlatformInput,
2424
PlatformInputHandler, PlatformWindow, Point, PromptButton, PromptLevel, RequestFrameOptions, ResizeEdge, ScaledPixels, Scene, Size, Tiling,
25-
WindowAppearance, WindowBackgroundAppearance, WindowBounds, WindowControlArea, WindowDecorations, WindowKind, WindowParams, X11ClientStatePtr, maybe,
25+
WindowAppearance, WindowBackgroundAppearance, WindowBounds, WindowControlArea, WindowDecorations, WindowKind, WindowParams, X11ClientStatePtr,
2626
platform::blade::{BladeContext, BladeRenderer, BladeSurfaceConfig},
2727
px, size
2828
};
@@ -442,7 +442,7 @@ impl X11WindowState {
442442
)?;
443443

444444
// Collect errors during setup, so that window can be destroyed on failure.
445-
let setup_result = maybe!({
445+
let setup_result = trys!({
446446
let pid = std::process::id();
447447
check_reply(
448448
|| "X11 ChangeProperty for _NET_WM_PID failed.",
@@ -648,7 +648,7 @@ impl Drop for X11Window {
648648
let mut state = self.0.state.borrow_mut();
649649
state.renderer.destroy();
650650

651-
let destroy_x_window = maybe!({
651+
let destroy_x_window = trys!({
652652
check_reply(|| "X11 DestroyWindow failure.", self.0.xcb.destroy_window(self.0.x_window))?;
653653
xcb_flush(&self.0.xcb);
654654

0 commit comments

Comments
 (0)