chore: Update deps

This commit is contained in:
Victoria Brekenfeld 2023-09-29 21:33:16 +02:00
parent 4f3a682564
commit 4e12957169
39 changed files with 1146 additions and 1001 deletions

View file

@ -539,7 +539,7 @@ impl CosmicMapped {
self.element = CosmicMappedInternal::Window(window);
}
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::Data> {
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::State> {
match &self.element {
CosmicMappedInternal::Stack(stack) => stack.loop_handle(),
CosmicMappedInternal::Window(window) => window.loop_handle(),

View file

@ -22,7 +22,7 @@ pub type ResizeIndicator = IcedElement<ResizeIndicatorInternal>;
pub fn resize_indicator(
direction: ResizeDirection,
config: &Config,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) -> ResizeIndicator {
ResizeIndicator::new(
ResizeIndicatorInternal {

View file

@ -122,14 +122,14 @@ pub enum Focus {
pub enum MoveResult {
Handled,
MoveOut(CosmicSurface, LoopHandle<'static, crate::state::Data>),
MoveOut(CosmicSurface, LoopHandle<'static, crate::state::State>),
Default,
}
impl CosmicStack {
pub fn new<I: Into<CosmicSurface>>(
windows: impl Iterator<Item = I>,
handle: LoopHandle<'static, crate::state::Data>,
handle: LoopHandle<'static, crate::state::State>,
) -> CosmicStack {
let windows = windows.map(Into::into).collect::<Vec<_>>();
assert!(!windows.is_empty());
@ -498,7 +498,7 @@ impl CosmicStack {
.with_program(|p| p.group_focused.store(true, Ordering::SeqCst));
}
pub(in super::super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::Data> {
pub(in super::super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::State> {
self.0.loop_handle()
}
@ -603,7 +603,7 @@ impl Program for CosmicStackInternal {
fn update(
&mut self,
message: Self::Message,
loop_handle: &LoopHandle<'static, crate::state::Data>,
loop_handle: &LoopHandle<'static, crate::state::State>,
) -> Command<Self::Message> {
match message {
Message::DragStart => {
@ -612,8 +612,8 @@ impl Program for CosmicStackInternal {
[self.active.load(Ordering::SeqCst)]
.wl_surface()
{
loop_handle.insert_idle(move |data| {
Shell::move_request(&mut data.state, &surface, &seat, serial);
loop_handle.insert_idle(move |state| {
Shell::move_request(state, &surface, &seat, serial);
});
}
}
@ -1080,9 +1080,9 @@ impl PointerTarget<State> for CosmicStack {
}
let seat = seat.clone();
data.common.event_loop_handle.insert_idle(move |data| {
data.common.event_loop_handle.insert_idle(move |state| {
seat.get_pointer().unwrap().set_grab(
&mut data.state,
state,
grab,
event.serial,
smithay::input::pointer::Focus::Clear,

View file

@ -16,7 +16,7 @@ use smithay::utils::{Logical, Size};
pub type StackHover = IcedElement<StackHoverInternal>;
pub fn stack_hover(
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
size: Size<i32, Logical>,
) -> StackHover {
StackHover::new(StackHoverInternal, size, evlh)

View file

@ -15,7 +15,7 @@ use smithay::utils::Size;
pub type SwapIndicator = IcedElement<SwapIndicatorInternal>;
pub fn swap_indicator(evlh: LoopHandle<'static, crate::state::Data>) -> SwapIndicator {
pub fn swap_indicator(evlh: LoopHandle<'static, crate::state::State>) -> SwapIndicator {
SwapIndicator::new(SwapIndicatorInternal, Size::from((1, 1)), evlh)
}

View file

@ -113,7 +113,7 @@ impl CosmicWindowInternal {
impl CosmicWindow {
pub fn new(
window: impl Into<CosmicSurface>,
handle: LoopHandle<'static, crate::state::Data>,
handle: LoopHandle<'static, crate::state::State>,
) -> CosmicWindow {
let window = window.into();
let width = window.geometry().size.w;
@ -166,7 +166,7 @@ impl CosmicWindow {
}
}
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::Data> {
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::State> {
self.0.loop_handle()
}
@ -228,14 +228,14 @@ impl Program for CosmicWindowInternal {
fn update(
&mut self,
message: Self::Message,
loop_handle: &LoopHandle<'static, crate::state::Data>,
loop_handle: &LoopHandle<'static, crate::state::State>,
) -> Command<Self::Message> {
match message {
Message::DragStart => {
if let Some((seat, serial)) = self.last_seat.lock().unwrap().clone() {
if let Some(surface) = self.window.wl_surface() {
loop_handle.insert_idle(move |data| {
Shell::move_request(&mut data.state, &surface, &seat, serial);
loop_handle.insert_idle(move |state| {
Shell::move_request(state, &surface, &seat, serial);
});
}
}
@ -243,17 +243,11 @@ impl Program for CosmicWindowInternal {
Message::Maximize => {
if let Some((seat, _serial)) = self.last_seat.lock().unwrap().clone() {
if let Some(surface) = self.window.wl_surface() {
loop_handle.insert_idle(move |data| {
if let Some(mapped) = data
.state
.common
.shell
.element_for_wl_surface(&surface)
.cloned()
loop_handle.insert_idle(move |state| {
if let Some(mapped) =
state.common.shell.element_for_wl_surface(&surface).cloned()
{
if let Some(workspace) =
data.state.common.shell.space_for_mut(&mapped)
{
if let Some(workspace) = state.common.shell.space_for_mut(&mapped) {
let output = seat.active_output();
let (window, _) = mapped
.windows()
@ -262,7 +256,7 @@ impl Program for CosmicWindowInternal {
workspace.maximize_toggle(
&window,
&output,
data.state.common.event_loop_handle.clone(),
state.common.event_loop_handle.clone(),
)
}
}

View file

@ -21,17 +21,18 @@ mod moving;
pub use self::moving::*;
bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ResizeEdge: u32 {
const TOP = 0b0001;
const BOTTOM = 0b0010;
const LEFT = 0b0100;
const RIGHT = 0b1000;
const TOP_LEFT = Self::TOP.bits | Self::LEFT.bits;
const BOTTOM_LEFT = Self::BOTTOM.bits | Self::LEFT.bits;
const TOP_LEFT = Self::TOP.bits() | Self::LEFT.bits();
const BOTTOM_LEFT = Self::BOTTOM.bits() | Self::LEFT.bits();
const TOP_RIGHT = Self::TOP.bits | Self::RIGHT.bits;
const BOTTOM_RIGHT = Self::BOTTOM.bits | Self::RIGHT.bits;
const TOP_RIGHT = Self::TOP.bits() | Self::RIGHT.bits();
const BOTTOM_RIGHT = Self::BOTTOM.bits() | Self::RIGHT.bits();
}
}

View file

@ -366,6 +366,7 @@ impl FloatingLayout {
KeyboardFocusTarget::Popup(popup) => {
let Some(toplevel_surface) = (match popup {
PopupKind::Xdg(xdg) => get_popup_toplevel(&xdg),
PopupKind::InputMethod(_) => unreachable!(),
}) else {
return FocusResult::None
};
@ -436,6 +437,7 @@ impl FloatingLayout {
KeyboardFocusTarget::Popup(popup) => {
let Some(toplevel_surface) = (match popup {
PopupKind::Xdg(xdg) => get_popup_toplevel(&xdg),
PopupKind::InputMethod(_) => unreachable!(),
}) else {
return MoveResult::None
};

View file

@ -69,11 +69,11 @@ impl PointerTarget<State> for ResizeForkTarget {
let orientation = self.orientation;
let serial = event.serial;
let button = event.button;
data.common.event_loop_handle.insert_idle(move |data| {
data.common.event_loop_handle.insert_idle(move |state| {
let pointer = seat.get_pointer().unwrap();
let location = pointer.current_location();
pointer.set_grab(
&mut data.state,
state,
ResizeForkGrab {
start_data: PointerGrabStartData {
focus: None,

View file

@ -9,6 +9,7 @@ use smithay::{
},
utils::Serial,
};
use xkbcommon::xkb::Keysym;
use crate::{
config::{Action, KeyPattern},
@ -71,7 +72,7 @@ impl KeyboardGrab<State> for SwapWindowGrab {
time,
KeyPattern {
modifiers: modifiers.map(Into::into).unwrap_or_default(),
key: Some(keycode),
key: Some(Keysym::new(keycode)),
},
None,
);

View file

@ -2660,6 +2660,7 @@ impl TilingLayout {
if let KeyboardFocusTarget::Popup(popup) = target {
let toplevel_surface = match popup {
PopupKind::Xdg(xdg) => get_popup_toplevel(&xdg),
PopupKind::InputMethod(_) => unreachable!(),
}?;
let root_id = tree.root_node_id()?;
let node =

View file

@ -1219,7 +1219,7 @@ impl Shell {
pub fn set_overview_mode(
&mut self,
enabled: Option<Trigger>,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if let Some(trigger) = enabled {
if !matches!(self.overview_mode, OverviewMode::Started(_, _)) {
@ -1261,7 +1261,7 @@ impl Shell {
&mut self,
enabled: Option<(KeyPattern, ResizeDirection)>,
config: &Config,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if let Some((pattern, direction)) = enabled {
if let ResizeMode::Started(old_pattern, _, old_direction) = &mut self.resize_mode {

View file

@ -430,7 +430,7 @@ impl Workspace {
&mut self,
window: &CosmicSurface,
output: &Output,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if self.fullscreen.contains_key(output) {
return;
@ -459,7 +459,7 @@ impl Workspace {
&mut self,
window: &CosmicSurface,
output: &Output,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if self
.fullscreen
@ -484,7 +484,7 @@ impl Workspace {
window: &'a CosmicSurface,
output: &Output,
exclusive: bool,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if let Some(mapped) = self
.mapped()
@ -635,7 +635,7 @@ impl Workspace {
&mut self,
window: &CosmicSurface,
output: &Output,
evlh: LoopHandle<'static, crate::state::Data>,
evlh: LoopHandle<'static, crate::state::State>,
) {
if self.fullscreen.contains_key(output) {
self.unmaximize_request(window);