feat(wayland+xwayland): initial window setup

This commit is contained in:
Nova
2023-08-24 04:49:03 -04:00
parent 237b084a65
commit 53b035ef92
2 changed files with 4 additions and 16 deletions

View File

@@ -346,13 +346,13 @@ impl Dispatch<XdgSurface, Mutex<XdgSurfaceData>, WaylandState> for WaylandState
debug!(?toplevel, ?xdg_surface, "Create XDG toplevel");
if toplevel.version() >= EVT_WM_CAPABILITIES_SINCE {
toplevel.wm_capabilities(vec![2, 3, 4]);
toplevel.wm_capabilities(vec![3]);
}
toplevel.configure(
0,
0,
if toplevel.version() >= 2 {
vec![5, 6, 7, 8]
vec![1, 5, 6, 7, 8]
.into_iter()
.flat_map(u32::to_ne_bytes)
.collect()
@@ -971,18 +971,6 @@ impl Backend for XDGBackend {
core_surface.apply_material(model_part);
}
// fn set_toplevel_capabilities(&self, capabilities: Vec<u8>) {
// let Ok(xdg_toplevel) = self.toplevel.upgrade() else {return};
// let Some(xdg_surface) = self.toplevel_xdg_surface() else {return};
// if xdg_toplevel.version() < EVT_WM_CAPABILITIES_SINCE {
// return;
// }
// xdg_toplevel.wm_capabilities(capabilities);
// xdg_surface.configure(SERIAL_COUNTER.inc());
// self.flush_client();
// }
fn close_toplevel(&self) {
let Ok(xdg_toplevel) = self.toplevel.upgrade() else {return};
xdg_toplevel.close();

View File

@@ -131,6 +131,8 @@ impl XwmHandler for XWaylandHandler {
fn map_window_notify(&mut self, _xwm: XwmId, window: X11Surface) {
debug!(?window, "X map window notify");
let _ = window.set_maximized(true);
let dh = self.wayland_display_handle.clone();
let seat = self.seat.clone().unwrap();
CoreSurface::add_to(
@@ -171,7 +173,6 @@ impl XwmHandler for XWaylandHandler {
},
);
}
fn mapped_override_redirect_window(&mut self, _xwm: XwmId, window: X11Surface) {
debug!(?window, "X map override redirect window");
}
@@ -179,7 +180,6 @@ impl XwmHandler for XWaylandHandler {
fn unmapped_window(&mut self, _xwm: XwmId, window: X11Surface) {
debug!(?window, "Unmap X window");
}
fn destroyed_window(&mut self, _xwm: XwmId, window: X11Surface) {
debug!(?window, "Destroy X window");
}