chore: update subsurface settings

This commit is contained in:
Ashley Wulber 2025-02-24 23:13:01 -05:00
parent 17ad618fae
commit 41bd495a56
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -1,4 +1,5 @@
use cosmic::app::Core; use cosmic::app::Core;
use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity;
use cosmic::iced::event::listen_with; use cosmic::iced::event::listen_with;
use cosmic::iced::window::Id; use cosmic::iced::window::Id;
use cosmic::iced::{self, Length, Limits, Task}; use cosmic::iced::{self, Length, Limits, Task};
@ -209,15 +210,24 @@ impl cosmic::Application for Window {
) )
}, },
), ),
|_| { |layout| {
let bounds = layout.bounds();
let pos = bounds.position();
let size = bounds.size();
cosmic::app::message::subsurface( cosmic::app::message::subsurface(
|app: &mut Window| subsurface::SctkSubsurfaceSettings { move |app: &mut Window| subsurface::SctkSubsurfaceSettings {
parent: window::Id::RESERVED, parent: window::Id::RESERVED,
id: app.subsurface_id, id: app.subsurface_id,
loc: iced_core::Point { x: -100., y: 0. }, loc: iced::Point {
size: Some((10., 10.).into()), x: bounds.width / 2.,
y: bounds.height,
},
size: None,
z: 1, z: 1,
steal_keyboard_focus: true, steal_keyboard_focus: false,
offset: (0, 0),
gravity: Gravity::Bottom,
}, },
Some(Box::new(|_: &'_ Window| { Some(Box::new(|_: &'_ Window| {
Element::from(autosize::autosize( Element::from(autosize::autosize(