Remove ExtraData type from XConnection trait

This was being used to pass the X11 atoms all over the place, but I
realize this is no longer necessary - we can just pass them directly to
our RealConnection when creating it.
This commit is contained in:
Shawn Wallace 2025-03-12 00:55:39 -04:00
parent 54a7ad9e13
commit 7df3daba70
5 changed files with 60 additions and 91 deletions

View file

@ -16,27 +16,17 @@ use wayland_server::{Display, ListeningSocket};
use xcb::x;
pub trait XConnection: Sized + 'static {
type ExtraData: FromServerState<Self>;
type X11Selection: X11Selection;
fn root_window(&self) -> x::Window;
fn set_window_dims(&mut self, window: x::Window, dims: PendingSurfaceState);
fn set_fullscreen(&mut self, window: x::Window, fullscreen: bool, data: Self::ExtraData);
fn focus_window(
&mut self,
window: x::Window,
output_name: Option<String>,
data: Self::ExtraData,
);
fn close_window(&mut self, window: x::Window, data: Self::ExtraData);
fn set_fullscreen(&mut self, window: x::Window, fullscreen: bool);
fn focus_window(&mut self, window: x::Window, output_name: Option<String>);
fn close_window(&mut self, window: x::Window);
fn unmap_window(&mut self, window: x::Window);
fn raise_to_top(&mut self, window: x::Window);
}
pub trait FromServerState<C: XConnection> {
fn create(state: &ServerState<C>) -> Self;
}
pub trait X11Selection {
fn mime_types(&self) -> Vec<&str>;
fn write_to(&self, mime: &str, pipe: WritePipe);