From 1ed9649891755e25f58dd3e3880e8f5e3a5f1325 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 28 May 2024 14:57:53 -0700 Subject: [PATCH] Account for `SSD_HEIGHT` in `XwaylandHandler::configure_request` `CosmicWindow::set_geometry` is going to subtract the `SSD_HEIGHT` before setting the size for the X11 window, so we need to include it here. --- src/xwayland.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xwayland.rs b/src/xwayland.rs index 3c5f32ea..8c19b5fc 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -2,7 +2,10 @@ use std::{ffi::OsString, os::unix::io::OwnedFd, process::Stdio}; use crate::{ backend::render::cursor::{load_cursor_theme, Cursor, CursorShape}, - shell::{focus::target::KeyboardFocusTarget, grabs::ReleaseMode, CosmicSurface, Shell}, + shell::{ + element::surface::SSD_HEIGHT, focus::target::KeyboardFocusTarget, grabs::ReleaseMode, + CosmicSurface, Shell, + }, state::State, utils::prelude::*, wayland::handlers::{ @@ -379,12 +382,13 @@ impl XwmHandler for State { .is_some(); if is_floating { + let ssd_height = if window.is_decorated() { 0 } else { SSD_HEIGHT }; mapped.set_geometry( Rectangle::from_loc_and_size( current_geo.loc, ( w.map(|w| w as i32).unwrap_or(current_geo.size.w), - h.map(|h| h as i32).unwrap_or(current_geo.size.h), + h.map(|h| h as i32).unwrap_or(current_geo.size.h) + ssd_height, ), ) .as_global(),