wayland: Window controls and drag (#11525)
Based on https://github.com/zed-industries/zed/pull/11046 - Partially fixes #10346 - Fixes https://github.com/zed-industries/zed/issues/9964 ## Features Window buttons  Window drag  Native window context menu  ### Limitations - No resizing - Wayland only (though X11 always has window decorations) ### Technical This PR adds three APIs to gpui. 1. `show_window_menu`: Triggers the native title bar context menu. 2. `start_system_move`: Tells the compositor to start dragging the window. 3. `should_render_window_controls`: Whether the compositor doesn't support server side decorations. These APIs have only been implemented for Wayland, but they should be portable to other platforms. Release Notes: - N/A --------- Co-authored-by: Akilan Elango <akilan1997@gmail.com>
This commit is contained in:
parent
db89353193
commit
d1ee2d0749
13 changed files with 277 additions and 11 deletions
|
@ -8,6 +8,7 @@ use crate::{
|
|||
Scene, Size, WindowAppearance, WindowBackgroundAppearance, WindowBounds, WindowOptions,
|
||||
WindowParams, X11Client, X11ClientState, X11ClientStatePtr,
|
||||
};
|
||||
|
||||
use blade_graphics as gpu;
|
||||
use parking_lot::Mutex;
|
||||
use raw_window_handle as rwh;
|
||||
|
@ -719,4 +720,14 @@ impl PlatformWindow for X11Window {
|
|||
let inner = self.0.state.borrow();
|
||||
inner.renderer.sprite_atlas().clone()
|
||||
}
|
||||
|
||||
// todo(linux)
|
||||
fn show_window_menu(&self, _position: Point<Pixels>) {}
|
||||
|
||||
// todo(linux)
|
||||
fn start_system_move(&self) {}
|
||||
|
||||
fn should_render_window_controls(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue