chore: format for Rust 2024

This commit is contained in:
Vukašin Vojinović 2025-10-16 18:53:57 +02:00 committed by Victoria Brekenfeld
parent 0a8da05847
commit 1f7f0c70b7
99 changed files with 414 additions and 442 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic_config::{cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry}; use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -93,7 +93,9 @@ pub fn load_outputs(path: Option<impl AsRef<Path>>) -> OutputsConfig {
.find(|(_, info)| &info.connector == conn) .find(|(_, info)| &info.connector == conn)
{ {
if config_clone[j].enabled != OutputState::Enabled { if config_clone[j].enabled != OutputState::Enabled {
warn!("Invalid Mirroring tag, overriding with `Enabled` instead"); warn!(
"Invalid Mirroring tag, overriding with `Enabled` instead"
);
conf.enabled = OutputState::Enabled; conf.enabled = OutputState::Enabled;
} }
} else { } else {

View file

@ -14,7 +14,7 @@ impl From<CompList> for cosmic_randr_shell::List {
let mut list = cosmic_randr_shell::List::default(); let mut list = cosmic_randr_shell::List::default();
for (info, output) in infos.into_iter().zip(outputs.into_iter()) { for (info, output) in infos.into_iter().zip(outputs.into_iter()) {
let current = list.modes.insert(cosmic_randr_shell::Mode { let current = list.modes.insert(cosmic_randr_shell::Mode {
size: (output.mode.0 .0 as u32, output.mode.0 .1 as u32), size: (output.mode.0.0 as u32, output.mode.0.1 as u32),
refresh_rate: output.mode.1.unwrap_or_default(), refresh_rate: output.mode.1.unwrap_or_default(),
// XXX not in config as far as i can tell // XXX not in config as far as i can tell
preferred: false, preferred: false,

View file

@ -1 +1 @@
style_edition = "2021" style_edition = "2024"

View file

@ -3,7 +3,7 @@
use crate::{ use crate::{
backend::{ backend::{
kms::render::gles::GbmGlowBackend, kms::render::gles::GbmGlowBackend,
render::{init_shaders, output_elements, CursorMode, GlMultiRenderer, CLEAR_COLOR}, render::{CLEAR_COLOR, CursorMode, GlMultiRenderer, init_shaders, output_elements},
}, },
config::{CompTransformDef, EdidProduct, ScreenFilter}, config::{CompTransformDef, EdidProduct, ScreenFilter},
shell::Shell, shell::Shell,
@ -17,17 +17,17 @@ use libc::dev_t;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{ allocator::{
Format, Fourcc,
format::FormatSet, format::FormatSet,
gbm::{GbmAllocator, GbmDevice}, gbm::{GbmAllocator, GbmDevice},
Format, Fourcc,
}, },
drm::{ drm::{
DrmDevice, DrmDeviceFd, DrmEvent, DrmNode, NodeType,
compositor::{FrameError, FrameFlags}, compositor::{FrameError, FrameFlags},
exporter::gbm::GbmFramebufferExporter, exporter::gbm::GbmFramebufferExporter,
output::{DrmOutputManager, LockedDrmOutputManager}, output::{DrmOutputManager, LockedDrmOutputManager},
DrmDevice, DrmDeviceFd, DrmEvent, DrmNode, NodeType,
}, },
egl::{context::ContextPriority, EGLContext, EGLDevice, EGLDisplay}, egl::{EGLContext, EGLDevice, EGLDisplay, context::ContextPriority},
renderer::glow::GlowRenderer, renderer::glow::GlowRenderer,
session::Session, session::Session,
}, },
@ -35,10 +35,10 @@ use smithay::{
output::{Mode as OutputMode, Output, PhysicalProperties, Scale, Subpixel}, output::{Mode as OutputMode, Output, PhysicalProperties, Scale, Subpixel},
reexports::{ reexports::{
calloop::{LoopHandle, RegistrationToken}, calloop::{LoopHandle, RegistrationToken},
drm::control::{connector, crtc, Device as ControlDevice, ModeTypeFlags}, drm::control::{Device as ControlDevice, ModeTypeFlags, connector, crtc},
gbm::BufferObjectFlags as GbmBufferFlags, gbm::BufferObjectFlags as GbmBufferFlags,
rustix::fs::OFlags, rustix::fs::OFlags,
wayland_server::{protocol::wl_buffer::WlBuffer, DisplayHandle, Weak}, wayland_server::{DisplayHandle, Weak, protocol::wl_buffer::WlBuffer},
}, },
utils::{Clock, DevPath, DeviceFd, Monotonic, Point, Transform}, utils::{Clock, DevPath, DeviceFd, Monotonic, Point, Transform},
wayland::drm_lease::{DrmLease, DrmLeaseState}, wayland::drm_lease::{DrmLease, DrmLeaseState},
@ -52,7 +52,7 @@ use std::{
fmt, fmt,
os::fd::OwnedFd, os::fd::OwnedFd,
path::Path, path::Path,
sync::{atomic::AtomicBool, mpsc::Receiver, Arc, RwLock}, sync::{Arc, RwLock, atomic::AtomicBool, mpsc::Receiver},
time::Duration, time::Duration,
}; };

View file

@ -1,15 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use libdisplay_info::{edid::DisplayDescriptorTag, info::Info}; use libdisplay_info::{edid::DisplayDescriptorTag, info::Info};
use smithay::{ use smithay::{
reexports::drm::control::{ reexports::drm::control::{
AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, PlaneType, ResourceHandle,
atomic::AtomicModeReq, atomic::AtomicModeReq,
connector::{self, State as ConnectorState}, connector::{self, State as ConnectorState},
crtc, crtc,
dumbbuffer::DumbBuffer, dumbbuffer::DumbBuffer,
property, AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, PlaneType, property,
ResourceHandle,
}, },
utils::Transform, utils::Transform,
}; };

View file

@ -14,21 +14,21 @@ use indexmap::IndexMap;
use render::gles::GbmGlowBackend; use render::gles::GbmGlowBackend;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{dmabuf::Dmabuf, format::FormatSet, Buffer}, allocator::{Buffer, dmabuf::Dmabuf, format::FormatSet},
drm::{output::DrmOutputRenderElements, DrmDeviceFd, DrmNode, NodeType, VrrSupport}, drm::{DrmDeviceFd, DrmNode, NodeType, VrrSupport, output::DrmOutputRenderElements},
egl::{EGLContext, EGLDevice, EGLDisplay}, egl::{EGLContext, EGLDevice, EGLDisplay},
input::InputEvent, input::InputEvent,
libinput::{LibinputInputBackend, LibinputSessionInterface}, libinput::{LibinputInputBackend, LibinputSessionInterface},
renderer::{glow::GlowRenderer, multigpu::GpuManager}, renderer::{glow::GlowRenderer, multigpu::GpuManager},
session::{libseat::LibSeatSession, Event as SessionEvent, Session}, session::{Event as SessionEvent, Session, libseat::LibSeatSession},
udev::{primary_gpu, UdevBackend, UdevEvent}, udev::{UdevBackend, UdevEvent, primary_gpu},
}, },
output::Output, output::Output,
reexports::{ reexports::{
calloop::{Dispatcher, EventLoop, LoopHandle}, calloop::{Dispatcher, EventLoop, LoopHandle},
drm::{ drm::{
control::{connector::Interface, crtc, Device as _},
Device as _, Device as _,
control::{Device as _, connector::Interface, crtc},
}, },
input::{self, Libinput}, input::{self, Libinput},
wayland_server::{Client, DisplayHandle}, wayland_server::{Client, DisplayHandle},
@ -36,7 +36,7 @@ use smithay::{
utils::{Clock, DevPath, Monotonic, Size}, utils::{Clock, DevPath, Monotonic, Size},
wayland::{ wayland::{
dmabuf::DmabufGlobal, dmabuf::DmabufGlobal,
drm_syncobj::{supports_syncobj_eventfd, DrmSyncobjState}, drm_syncobj::{DrmSyncobjState, supports_syncobj_eventfd},
relative_pointer::RelativePointerManagerState, relative_pointer::RelativePointerManagerState,
}, },
}; };
@ -46,7 +46,7 @@ use tracing::{debug, error, info, trace, warn};
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
path::Path, path::Path,
sync::{atomic::AtomicBool, Arc, RwLock}, sync::{Arc, RwLock, atomic::AtomicBool},
}; };
mod device; mod device;
@ -58,7 +58,7 @@ use device::*;
pub(crate) use surface::Surface; pub(crate) use surface::Surface;
pub use surface::Timings; pub use surface::Timings;
use super::render::{output_elements, CursorMode, CLEAR_COLOR}; use super::render::{CLEAR_COLOR, CursorMode, output_elements};
#[derive(Debug)] #[derive(Debug)]
pub struct KmsState { pub struct KmsState {
@ -551,8 +551,7 @@ impl KmsState {
Err(err) => { Err(err) => {
trace!( trace!(
?err, ?err,
"Failed to import dmabuf on {:?}", "Failed to import dmabuf on {:?}", device.inner.render_node
device.inner.render_node
); );
last_err = err; last_err = err;
} }

View file

@ -1,19 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::backend::{ use smithay::backend::{
SwapBuffersError,
allocator::{ allocator::{
Allocator,
dmabuf::{AnyError, Dmabuf, DmabufAllocator}, dmabuf::{AnyError, Dmabuf, DmabufAllocator},
gbm::GbmAllocator, gbm::GbmAllocator,
Allocator,
}, },
drm::{CreateDrmNodeError, DrmNode}, drm::{CreateDrmNodeError, DrmNode},
renderer::{ renderer::{
RendererSuper,
gles::{GlesError, GlesRenderer}, gles::{GlesError, GlesRenderer},
glow::GlowRenderer, glow::GlowRenderer,
multigpu::{ApiDevice, Error as MultiError, GraphicsApi}, multigpu::{ApiDevice, Error as MultiError, GraphicsApi},
RendererSuper,
}, },
SwapBuffersError,
}; };
use std::{borrow::Borrow, cell::Cell}; use std::{borrow::Borrow, cell::Cell};
use std::{ use std::{

View file

@ -7,9 +7,9 @@ use std::{
use smithay::backend::{ use smithay::backend::{
allocator::{ allocator::{
Allocator,
dmabuf::{AnyError, Dmabuf, DmabufAllocator}, dmabuf::{AnyError, Dmabuf, DmabufAllocator},
gbm::{GbmAllocator, GbmBufferFlags, GbmDevice}, gbm::{GbmAllocator, GbmBufferFlags, GbmDevice},
Allocator,
}, },
drm::DrmNode, drm::DrmNode,
renderer::{ renderer::{

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use smithay::{ use smithay::{
backend::{ backend::{
allocator::format::FormatSet, allocator::format::FormatSet,
@ -8,7 +8,7 @@ use smithay::{
}, },
reexports::{ reexports::{
calloop::RegistrationToken, calloop::RegistrationToken,
wayland_server::{backend::GlobalId, Client, DisplayHandle}, wayland_server::{Client, DisplayHandle, backend::GlobalId},
}, },
wayland::{ wayland::{
dmabuf::{DmabufFeedbackBuilder, DmabufGlobal}, dmabuf::{DmabufFeedbackBuilder, DmabufGlobal},
@ -18,7 +18,7 @@ use smithay::{
use std::sync::Arc; use std::sync::Arc;
use tracing::{info, warn}; use tracing::{info, warn};
use crate::state::{advertised_node_for_client, ClientState, State}; use crate::state::{ClientState, State, advertised_node_for_client};
#[derive(Debug)] #[derive(Debug)]
pub struct Socket { pub struct Socket {

View file

@ -2,9 +2,10 @@
use crate::{ use crate::{
backend::render::{ backend::render::{
CLEAR_COLOR, CursorMode, GlMultiError, GlMultiRenderer, PostprocessOutputConfig,
PostprocessShader, PostprocessState,
element::{CosmicElement, DamageElement}, element::{CosmicElement, DamageElement},
init_shaders, output_elements, CursorMode, GlMultiError, GlMultiRenderer, init_shaders, output_elements,
PostprocessOutputConfig, PostprocessShader, PostprocessState, CLEAR_COLOR,
}, },
config::ScreenFilter, config::ScreenFilter,
shell::Shell, shell::Shell,
@ -13,7 +14,7 @@ use crate::{
wayland::{ wayland::{
handlers::{ handlers::{
compositor::recursive_frame_time_estimation, compositor::recursive_frame_time_estimation,
screencopy::{submit_buffer, FrameHolder, PendingImageCopyData, SessionData}, screencopy::{FrameHolder, PendingImageCopyData, SessionData, submit_buffer},
}, },
protocols::screencopy::{ protocols::screencopy::{
FailureReason, Frame as ScreencopyFrame, SessionRef as ScreencopySessionRef, FailureReason, Frame as ScreencopyFrame, SessionRef as ScreencopySessionRef,
@ -27,11 +28,12 @@ use cosmic_comp_config::output::comp::AdaptiveSync;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{ allocator::{
Fourcc,
format::FormatSet, format::FormatSet,
gbm::{GbmAllocator, GbmBuffer}, gbm::{GbmAllocator, GbmBuffer},
Fourcc,
}, },
drm::{ drm::{
DrmDeviceFd, DrmEventMetadata, DrmEventTime, DrmNode, VrrSupport,
compositor::{ compositor::{
BlitFrameResultError, FrameError, FrameFlags, PrimaryPlaneElement, BlitFrameResultError, FrameError, FrameFlags, PrimaryPlaneElement,
RenderFrameResult, RenderFrameResult,
@ -39,38 +41,36 @@ use smithay::{
exporter::gbm::GbmFramebufferExporter, exporter::gbm::GbmFramebufferExporter,
gbm::GbmFramebuffer, gbm::GbmFramebuffer,
output::DrmOutput, output::DrmOutput,
DrmDeviceFd, DrmEventMetadata, DrmEventTime, DrmNode, VrrSupport,
}, },
egl::EGLContext, egl::EGLContext,
renderer::{ renderer::{
buffer_dimensions, buffer_type, Bind, Blit, BufferType, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
TextureFilter, buffer_dimensions, buffer_type,
damage::Error as RenderError, damage::Error as RenderError,
element::{ element::{
Element, Kind, RenderElementStates,
texture::TextureRenderElement, texture::TextureRenderElement,
utils::{ utils::{
constrain_render_elements, ConstrainAlign, ConstrainScaleBehavior, Relocate, ConstrainAlign, ConstrainScaleBehavior, Relocate, RelocateRenderElement,
RelocateRenderElement, constrain_render_elements,
}, },
Element, Kind, RenderElementStates,
}, },
gles::{ gles::{
element::TextureShaderElement, GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform, GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform, element::TextureShaderElement,
}, },
glow::GlowRenderer, glow::GlowRenderer,
multigpu::{ApiDevice, Error as MultiError, GpuManager}, multigpu::{ApiDevice, Error as MultiError, GpuManager},
sync::SyncPoint, sync::SyncPoint,
utils::with_renderer_surface_state, utils::with_renderer_surface_state,
Bind, Blit, BufferType, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
TextureFilter,
}, },
}, },
desktop::utils::OutputPresentationFeedback, desktop::utils::OutputPresentationFeedback,
output::{Output, OutputNoMode}, output::{Output, OutputNoMode},
reexports::{ reexports::{
calloop::{ calloop::{
channel::{channel, Event, Sender},
timer::{TimeoutAction, Timer},
EventLoop, LoopHandle, RegistrationToken, EventLoop, LoopHandle, RegistrationToken,
channel::{Event, Sender, channel},
timer::{TimeoutAction, Timer},
}, },
drm::control::{connector, crtc}, drm::control::{connector, crtc},
wayland_protocols::wp::{ wayland_protocols::wp::{
@ -81,7 +81,7 @@ use smithay::{
}, },
utils::{Clock, Monotonic, Physical, Point, Rectangle, Transform}, utils::{Clock, Monotonic, Physical, Point, Rectangle, Transform},
wayland::{ wayland::{
dmabuf::{get_dmabuf, DmabufFeedbackBuilder}, dmabuf::{DmabufFeedbackBuilder, get_dmabuf},
presentation::Refresh, presentation::Refresh,
seat::WaylandFocus, seat::WaylandFocus,
shm::{shm_format_to_fourcc, with_buffer_contents}, shm::{shm_format_to_fourcc, with_buffer_contents},
@ -91,12 +91,12 @@ use tracing::{error, info, trace, warn};
use std::{ use std::{
borrow::{Borrow, BorrowMut}, borrow::{Borrow, BorrowMut},
collections::{hash_map, HashMap, HashSet}, collections::{HashMap, HashSet, hash_map},
mem, mem,
sync::{ sync::{
Arc, RwLock,
atomic::{AtomicBool, Ordering}, atomic::{AtomicBool, Ordering},
mpsc::{Receiver, SyncSender}, mpsc::{Receiver, SyncSender},
Arc, RwLock,
}, },
thread::JoinHandle, thread::JoinHandle,
time::Duration, time::Duration,

View file

@ -2,7 +2,7 @@
use crate::state::State; use crate::state::State;
use crate::wayland::protocols::a11y::A11yHandler; use crate::wayland::protocols::a11y::A11yHandler;
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use cosmic_comp_config::NumlockState; use cosmic_comp_config::NumlockState;
use cosmic_config::CosmicConfigEntry; use cosmic_config::CosmicConfigEntry;
use cosmic_settings_daemon_config::greeter; use cosmic_settings_daemon_config::greeter;

View file

@ -5,17 +5,17 @@ use smithay::{
backend::{ backend::{
allocator::Fourcc, allocator::Fourcc,
renderer::{ renderer::{
element::{
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
surface::{render_elements_from_surface_tree, WaylandSurfaceRenderElement},
Kind,
},
ImportAll, ImportMem, Renderer, ImportAll, ImportMem, Renderer,
element::{
Kind,
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
surface::{WaylandSurfaceRenderElement, render_elements_from_surface_tree},
},
}, },
}, },
input::{ input::{
pointer::{CursorIcon, CursorImageAttributes, CursorImageStatus},
Seat, Seat,
pointer::{CursorIcon, CursorImageAttributes, CursorImageStatus},
}, },
reexports::wayland_server::protocol::wl_surface, reexports::wayland_server::protocol::wl_surface,
render_elements, render_elements,
@ -27,8 +27,8 @@ use smithay::{
use std::{collections::HashMap, io::Read, sync::Mutex}; use std::{collections::HashMap, io::Read, sync::Mutex};
use tracing::warn; use tracing::warn;
use xcursor::{ use xcursor::{
parser::{parse_xcursor, Image},
CursorTheme, CursorTheme,
parser::{Image, parse_xcursor},
}; };
static FALLBACK_CURSOR_DATA: &[u8] = include_bytes!("../../../resources/cursor.rgba"); static FALLBACK_CURSOR_DATA: &[u8] = include_bytes!("../../../resources/cursor.rgba");
@ -287,10 +287,9 @@ where
let actual_scale = (frame.size / state.size()).max(1); let actual_scale = (frame.size / state.size()).max(1);
let pointer_images = &mut state.image_cache; let pointer_images = &mut state.image_cache;
let maybe_image = let maybe_image = pointer_images
pointer_images .iter()
.iter() .find_map(|(image, texture)| if image == &frame { Some(texture) } else { None });
.find_map(|(image, texture)| if image == &frame { Some(texture) } else { None });
let pointer_image = match maybe_image { let pointer_image = match maybe_image {
Some(image) => image, Some(image) => image,
None => { None => {

View file

@ -4,21 +4,21 @@ use crate::shell::{CosmicMappedRenderElement, WorkspaceRenderElement};
use smithay::backend::renderer::{element::texture::TextureRenderElement, gles::GlesTexture}; use smithay::backend::renderer::{element::texture::TextureRenderElement, gles::GlesTexture};
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
ImportAll, ImportMem, Renderer,
element::{ element::{
Element, Id, Kind, RenderElement, UnderlyingStorage,
memory::MemoryRenderBufferRenderElement, memory::MemoryRenderBufferRenderElement,
surface::WaylandSurfaceRenderElement, surface::WaylandSurfaceRenderElement,
utils::{CropRenderElement, Relocate, RelocateRenderElement, RescaleRenderElement}, utils::{CropRenderElement, Relocate, RelocateRenderElement, RescaleRenderElement},
Element, Id, Kind, RenderElement, UnderlyingStorage,
}, },
gles::{element::TextureShaderElement, GlesError}, gles::{GlesError, element::TextureShaderElement},
glow::{GlowFrame, GlowRenderer}, glow::{GlowFrame, GlowRenderer},
utils::{CommitCounter, DamageSet, OpaqueRegions}, utils::{CommitCounter, DamageSet, OpaqueRegions},
ImportAll, ImportMem, Renderer,
}, },
utils::{Buffer as BufferCoords, Logical, Physical, Point, Rectangle, Scale}, utils::{Buffer as BufferCoords, Logical, Physical, Point, Rectangle, Scale},
}; };
use super::{cursor::CursorRenderElement, GlMultiRenderer}; use super::{GlMultiRenderer, cursor::CursorRenderElement};
pub enum CosmicElement<R> pub enum CosmicElement<R>
where where

View file

@ -15,20 +15,20 @@ use crate::{
backend::{kms::render::gles::GbmGlowBackend, render::element::DamageElement}, backend::{kms::render::gles::GbmGlowBackend, render::element::DamageElement},
config::ScreenFilter, config::ScreenFilter,
shell::{ shell::{
CosmicMappedRenderElement, OverviewMode, SeatExt, Trigger, WorkspaceDelta,
WorkspaceRenderElement,
element::CosmicMappedKey, element::CosmicMappedKey,
focus::{render_input_order, target::WindowGroup, FocusTarget, Stage}, focus::{FocusTarget, Stage, render_input_order, target::WindowGroup},
grabs::{SeatMenuGrabState, SeatMoveGrabState}, grabs::{SeatMenuGrabState, SeatMoveGrabState},
layout::tiling::ANIMATION_DURATION, layout::tiling::ANIMATION_DURATION,
zoom::ZoomState, zoom::ZoomState,
CosmicMappedRenderElement, OverviewMode, SeatExt, Trigger, WorkspaceDelta,
WorkspaceRenderElement,
}, },
utils::{prelude::*, quirks::workspace_overview_is_open}, utils::{prelude::*, quirks::workspace_overview_is_open},
wayland::{ wayland::{
handlers::{ handlers::{
compositor::FRAME_TIME_FILTER, compositor::FRAME_TIME_FILTER,
data_device::get_dnd_icon, data_device::get_dnd_icon,
screencopy::{render_session, FrameHolder, SessionData}, screencopy::{FrameHolder, SessionData, render_session},
}, },
protocols::workspace::WorkspaceHandle, protocols::workspace::WorkspaceHandle,
}, },
@ -38,29 +38,29 @@ use cosmic::Theme;
use element::FromGlesError; use element::FromGlesError;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{dmabuf::Dmabuf, Fourcc}, allocator::{Fourcc, dmabuf::Dmabuf},
drm::{DrmDeviceFd, DrmNode}, drm::{DrmDeviceFd, DrmNode},
renderer::{ renderer::{
Bind, Blit, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer, Texture,
TextureFilter,
damage::{Error as RenderError, OutputDamageTracker, RenderOutputResult}, damage::{Error as RenderError, OutputDamageTracker, RenderOutputResult},
element::{ element::{
surface::{render_elements_from_surface_tree, WaylandSurfaceRenderElement}, Element, Id, Kind, RenderElement, WeakId,
surface::{WaylandSurfaceRenderElement, render_elements_from_surface_tree},
texture::{TextureRenderBuffer, TextureRenderElement}, texture::{TextureRenderBuffer, TextureRenderElement},
utils::{ utils::{
constrain_render_elements, ConstrainAlign, ConstrainScaleBehavior, ConstrainAlign, ConstrainScaleBehavior, CropRenderElement, Relocate,
CropRenderElement, Relocate, RelocateRenderElement, RescaleRenderElement, RelocateRenderElement, RescaleRenderElement, constrain_render_elements,
}, },
Element, Id, Kind, RenderElement, WeakId,
}, },
gles::{ gles::{
element::{PixelShaderElement, TextureShaderElement},
GlesError, GlesPixelProgram, GlesRenderer, GlesTexProgram, GlesTexture, Uniform, GlesError, GlesPixelProgram, GlesRenderer, GlesTexProgram, GlesTexture, Uniform,
UniformName, UniformType, UniformName, UniformType,
element::{PixelShaderElement, TextureShaderElement},
}, },
glow::GlowRenderer, glow::GlowRenderer,
multigpu::{Error as MultiError, MultiFrame, MultiRenderer}, multigpu::{Error as MultiError, MultiFrame, MultiRenderer},
sync::SyncPoint, sync::SyncPoint,
Bind, Blit, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer, Texture,
TextureFilter,
}, },
}, },
input::Seat, input::Seat,
@ -592,21 +592,23 @@ where
let scale = output.current_scale().fractional_scale(); let scale = output.current_scale().fractional_scale();
if let Some((state, timings)) = _fps { if let Some((state, timings)) = _fps {
vec![fps_ui( vec![
_gpu, fps_ui(
debug_active, _gpu,
&seats, debug_active,
renderer.glow_renderer_mut(), &seats,
state, renderer.glow_renderer_mut(),
timings, state,
Rectangle::from_size( timings,
(output_geo.size.w.min(400), output_geo.size.h.min(800)).into(), Rectangle::from_size(
), (output_geo.size.w.min(400), output_geo.size.h.min(800)).into(),
scale, ),
) scale,
.map_err(FromGlesError::from_gles_error) )
.map_err(RenderError::Rendering)? .map_err(FromGlesError::from_gles_error)
.into()] .map_err(RenderError::Rendering)?
.into(),
]
} else { } else {
Vec::new() Vec::new()
} }

View file

@ -7,23 +7,23 @@ use crate::{
state::{BackendData, Common}, state::{BackendData, Common},
utils::prelude::*, utils::prelude::*,
}; };
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use cosmic_comp_config::output::comp::{OutputConfig, TransformDef}; use cosmic_comp_config::output::comp::{OutputConfig, TransformDef};
use smithay::{ use smithay::{
backend::{ backend::{
drm::NodeType, drm::NodeType,
egl::EGLDevice, egl::EGLDevice,
renderer::{ renderer::{
ImportDma,
damage::{OutputDamageTracker, RenderOutputResult}, damage::{OutputDamageTracker, RenderOutputResult},
glow::GlowRenderer, glow::GlowRenderer,
ImportDma,
}, },
winit::{self, WinitEvent, WinitGraphicsBackend, WinitVirtualDevice}, winit::{self, WinitEvent, WinitGraphicsBackend, WinitVirtualDevice},
}, },
desktop::layer_map_for_output, desktop::layer_map_for_output,
output::{Mode, Output, PhysicalProperties, Scale, Subpixel}, output::{Mode, Output, PhysicalProperties, Scale, Subpixel},
reexports::{ reexports::{
calloop::{ping, EventLoop}, calloop::{EventLoop, ping},
wayland_protocols::wp::presentation_time::server::wp_presentation_feedback, wayland_protocols::wp::presentation_time::server::wp_presentation_feedback,
wayland_server::DisplayHandle, wayland_server::DisplayHandle,
winit::platform::pump_events::PumpStatus, winit::platform::pump_events::PumpStatus,
@ -34,7 +34,7 @@ use smithay::{
use std::{borrow::BorrowMut, cell::RefCell, time::Duration}; use std::{borrow::BorrowMut, cell::RefCell, time::Duration};
use tracing::{error, info, warn}; use tracing::{error, info, warn};
use super::render::{init_shaders, CursorMode, ScreenFilterStorage}; use super::render::{CursorMode, ScreenFilterStorage, init_shaders};
#[derive(Debug)] #[derive(Debug)]
pub struct WinitState { pub struct WinitState {

View file

@ -7,7 +7,7 @@ use crate::{
state::{BackendData, Common}, state::{BackendData, Common},
utils::prelude::*, utils::prelude::*,
}; };
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use cosmic_comp_config::output::comp::OutputConfig; use cosmic_comp_config::output::comp::OutputConfig;
use smithay::{ use smithay::{
backend::{ backend::{
@ -20,17 +20,17 @@ use smithay::{
egl::{EGLContext, EGLDevice, EGLDisplay}, egl::{EGLContext, EGLDevice, EGLDisplay},
input::{Event, InputEvent}, input::{Event, InputEvent},
renderer::{ renderer::{
Bind, ImportDma,
damage::{OutputDamageTracker, RenderOutputResult}, damage::{OutputDamageTracker, RenderOutputResult},
glow::GlowRenderer, glow::GlowRenderer,
Bind, ImportDma,
}, },
vulkan::{version::Version, Instance, PhysicalDevice}, vulkan::{Instance, PhysicalDevice, version::Version},
x11::{Window, WindowBuilder, X11Backend, X11Event, X11Handle, X11Input, X11Surface}, x11::{Window, WindowBuilder, X11Backend, X11Event, X11Handle, X11Input, X11Surface},
}, },
desktop::layer_map_for_output, desktop::layer_map_for_output,
output::{Mode, Output, PhysicalProperties, Scale, Subpixel}, output::{Mode, Output, PhysicalProperties, Scale, Subpixel},
reexports::{ reexports::{
calloop::{ping, EventLoop, LoopHandle}, calloop::{EventLoop, LoopHandle, ping},
gbm::Device as GbmDevice, gbm::Device as GbmDevice,
wayland_protocols::wp::presentation_time::server::wp_presentation_feedback, wayland_protocols::wp::presentation_time::server::wp_presentation_feedback,
wayland_server::DisplayHandle, wayland_server::DisplayHandle,
@ -41,7 +41,7 @@ use smithay::{
use std::{borrow::BorrowMut, cell::RefCell, os::unix::io::OwnedFd, time::Duration}; use std::{borrow::BorrowMut, cell::RefCell, os::unix::io::OwnedFd, time::Duration};
use tracing::{debug, error, info, warn}; use tracing::{debug, error, info, warn};
use super::render::{init_shaders, ScreenFilterStorage}; use super::render::{ScreenFilterStorage, init_shaders};
#[derive(Debug)] #[derive(Debug)]
enum Allocator { enum Allocator {

View file

@ -11,13 +11,13 @@ use crate::{
use anyhow::Context; use anyhow::Context;
use cosmic_config::{ConfigGet, CosmicConfigEntry}; use cosmic_config::{ConfigGet, CosmicConfigEntry};
use cosmic_settings_config::window_rules::ApplicationException; use cosmic_settings_config::window_rules::ApplicationException;
use cosmic_settings_config::{shortcuts, window_rules, Shortcuts}; use cosmic_settings_config::{Shortcuts, shortcuts, window_rules};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use smithay::utils::{Clock, Monotonic}; use smithay::utils::{Clock, Monotonic};
use smithay::wayland::xdg_activation::XdgActivationState; use smithay::wayland::xdg_activation::XdgActivationState;
pub use smithay::{ pub use smithay::{
backend::input::{self as smithay_input, KeyState}, backend::input::{self as smithay_input, KeyState},
input::keyboard::{keysyms as KeySyms, Keysym, ModifiersState}, input::keyboard::{Keysym, ModifiersState, keysyms as KeySyms},
output::{Mode, Output}, output::{Mode, Output},
reexports::{ reexports::{
calloop::LoopHandle, calloop::LoopHandle,
@ -26,7 +26,7 @@ pub use smithay::{
TapButtonMap, TapButtonMap,
}, },
}, },
utils::{Logical, Physical, Point, Size, Transform, SERIAL_COUNTER}, utils::{Logical, Physical, Point, SERIAL_COUNTER, Size, Transform},
}; };
use std::{ use std::{
cell::{Ref, RefCell}, cell::{Ref, RefCell},
@ -34,7 +34,7 @@ use std::{
fs::OpenOptions, fs::OpenOptions,
io::Write, io::Write,
path::PathBuf, path::PathBuf,
sync::{atomic::AtomicBool, Arc}, sync::{Arc, atomic::AtomicBool},
}; };
use tracing::{error, warn}; use tracing::{error, warn};
@ -45,13 +45,13 @@ mod types;
use cosmic::config::CosmicTk; use cosmic::config::CosmicTk;
pub use cosmic_comp_config::EdidProduct; pub use cosmic_comp_config::EdidProduct;
use cosmic_comp_config::{ use cosmic_comp_config::{
input::{DeviceState as InputDeviceState, InputConfig, TouchpadOverride},
output::comp::{
load_outputs, OutputConfig, OutputInfo, OutputState, OutputsConfig, TransformDef,
},
workspace::WorkspaceConfig,
CosmicCompConfig, KeyboardConfig, TileBehavior, XkbConfig, XwaylandDescaling, CosmicCompConfig, KeyboardConfig, TileBehavior, XkbConfig, XwaylandDescaling,
XwaylandEavesdropping, ZoomConfig, XwaylandEavesdropping, ZoomConfig,
input::{DeviceState as InputDeviceState, InputConfig, TouchpadOverride},
output::comp::{
OutputConfig, OutputInfo, OutputState, OutputsConfig, TransformDef, load_outputs,
},
workspace::WorkspaceConfig,
}; };
pub use key_bindings::{Action, PrivateAction}; pub use key_bindings::{Action, PrivateAction};
use types::WlXkbConfig; use types::WlXkbConfig;

View file

@ -7,7 +7,7 @@ use calloop::{InsertError, LoopHandle, RegistrationToken};
use cosmic_comp_config::output::comp::OutputState; use cosmic_comp_config::output::comp::OutputState;
use std::collections::HashMap; use std::collections::HashMap;
use tracing::{error, warn}; use tracing::{error, warn};
use zbus::blocking::{fdo::DBusProxy, Connection}; use zbus::blocking::{Connection, fdo::DBusProxy};
#[cfg(feature = "systemd")] #[cfg(feature = "systemd")]
pub mod logind; pub mod logind;

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::{ use crate::{
State,
backend::kms::Timings, backend::kms::Timings,
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget, PointerFocusToplevel}, shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget, PointerFocusToplevel},
State,
}; };
use egui::Color32; use egui::Color32;
use smithay::{ use smithay::{
@ -16,7 +16,7 @@ use smithay::{
}, },
}, },
desktop::WindowSurface, desktop::WindowSurface,
input::{keyboard::xkb, Seat}, input::{Seat, keyboard::xkb},
reexports::wayland_server::Resource, reexports::wayland_server::Resource,
utils::{Logical, Rectangle, Time}, utils::{Logical, Rectangle, Time},
}; };

View file

@ -3,21 +3,21 @@
use crate::{ use crate::{
config::{Action, PrivateAction}, config::{Action, PrivateAction},
shell::{ shell::{
focus::{target::KeyboardFocusTarget, FocusTarget},
layout::tiling::SwapWindowGrab,
FocusResult, InvalidWorkspaceIndex, MoveResult, SeatExt, Trigger, WorkspaceDelta, FocusResult, InvalidWorkspaceIndex, MoveResult, SeatExt, Trigger, WorkspaceDelta,
focus::{FocusTarget, target::KeyboardFocusTarget},
layout::tiling::SwapWindowGrab,
}, },
utils::prelude::*, utils::prelude::*,
wayland::{ wayland::{
handlers::xdg_activation::ActivationContext, protocols::workspace::WorkspaceUpdateGuard, handlers::xdg_activation::ActivationContext, protocols::workspace::WorkspaceUpdateGuard,
}, },
}; };
use cosmic_comp_config::{workspace::WorkspaceLayout, TileBehavior}; use cosmic_comp_config::{TileBehavior, workspace::WorkspaceLayout};
use cosmic_config::ConfigSet; use cosmic_config::ConfigSet;
use cosmic_settings_config::shortcuts; use cosmic_settings_config::shortcuts;
use cosmic_settings_config::shortcuts::action::{Direction, FocusDirection}; use cosmic_settings_config::shortcuts::action::{Direction, FocusDirection};
use smithay::{ use smithay::{
input::{pointer::MotionEvent, Seat}, input::{Seat, pointer::MotionEvent},
utils::{Point, Serial}, utils::{Point, Serial},
}; };
#[cfg(not(feature = "debug"))] #[cfg(not(feature = "debug"))]

View file

@ -3,18 +3,18 @@
use crate::{ use crate::{
backend::render::ElementFilter, backend::render::ElementFilter,
config::{ config::{
Action, Config, PrivateAction,
key_bindings::{ key_bindings::{
cosmic_keystate_from_smithay, cosmic_modifiers_eq_smithay, cosmic_keystate_from_smithay, cosmic_modifiers_eq_smithay,
cosmic_modifiers_from_smithay, cosmic_modifiers_from_smithay,
}, },
Action, Config, PrivateAction,
}, },
input::gestures::{GestureState, SwipeAction}, input::gestures::{GestureState, SwipeAction},
shell::{ shell::{
LastModifierChange, SeatExt, Trigger,
focus::{ focus::{
render_input_order, Stage, render_input_order,
target::{KeyboardFocusTarget, PointerFocusTarget}, target::{KeyboardFocusTarget, PointerFocusTarget},
Stage,
}, },
grabs::{ReleaseMode, ResizeEdge}, grabs::{ReleaseMode, ResizeEdge},
layout::{ layout::{
@ -22,7 +22,6 @@ use crate::{
tiling::{NodeDesc, SwapWindowGrab, TilingLayout}, tiling::{NodeDesc, SwapWindowGrab, TilingLayout},
}, },
zoom::ZoomState, zoom::ZoomState,
LastModifierChange, SeatExt, Trigger,
}, },
utils::{float::NextDown, prelude::*, quirks::workspace_overview_is_open}, utils::{float::NextDown, prelude::*, quirks::workspace_overview_is_open},
wayland::{ wayland::{
@ -31,10 +30,10 @@ use crate::{
}, },
}; };
use calloop::{ use calloop::{
timer::{TimeoutAction, Timer},
RegistrationToken, RegistrationToken,
timer::{TimeoutAction, Timer},
}; };
use cosmic_comp_config::{workspace::WorkspaceLayout, NumlockState}; use cosmic_comp_config::{NumlockState, workspace::WorkspaceLayout};
use cosmic_settings_config::shortcuts; use cosmic_settings_config::shortcuts;
use cosmic_settings_config::shortcuts::action::{Direction, ResizeDirection}; use cosmic_settings_config::shortcuts::action::{Direction, ResizeDirection};
use smithay::{ use smithay::{
@ -45,8 +44,9 @@ use smithay::{
SwitchState, SwitchToggleEvent, TabletToolButtonEvent, TabletToolEvent, SwitchState, SwitchToggleEvent, TabletToolButtonEvent, TabletToolEvent,
TabletToolProximityEvent, TabletToolTipEvent, TabletToolTipState, TouchEvent, TabletToolProximityEvent, TabletToolTipEvent, TabletToolTipState, TouchEvent,
}, },
desktop::{utils::under_from_surface_tree, PopupKeyboardGrab, WindowSurfaceType}, desktop::{PopupKeyboardGrab, WindowSurfaceType, utils::under_from_surface_tree},
input::{ input::{
Seat,
keyboard::{FilterResult, KeysymHandle, ModifiersState}, keyboard::{FilterResult, KeysymHandle, ModifiersState},
pointer::{ pointer::{
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
@ -55,16 +55,15 @@ use smithay::{
PointerGrab, RelativeMotionEvent, PointerGrab, RelativeMotionEvent,
}, },
touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent}, touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent},
Seat,
}, },
output::Output, output::Output,
reexports::{ reexports::{
input::Device as InputDevice, wayland_server::protocol::wl_shm::Format as ShmFormat, input::Device as InputDevice, wayland_server::protocol::wl_shm::Format as ShmFormat,
}, },
utils::{Point, Rectangle, Serial, SERIAL_COUNTER}, utils::{Point, Rectangle, SERIAL_COUNTER, Serial},
wayland::{ wayland::{
keyboard_shortcuts_inhibit::KeyboardShortcutsInhibitorSeat, keyboard_shortcuts_inhibit::KeyboardShortcutsInhibitorSeat,
pointer_constraints::{with_pointer_constraint, PointerConstraint}, pointer_constraints::{PointerConstraint, with_pointer_constraint},
seat::WaylandFocus, seat::WaylandFocus,
tablet_manager::{TabletDescriptor, TabletSeatTrait}, tablet_manager::{TabletDescriptor, TabletSeatTrait},
}, },

View file

@ -6,7 +6,7 @@ use anyhow::Result;
use tracing::{debug, info, warn}; use tracing::{debug, info, warn};
use tracing_journald as journald; use tracing_journald as journald;
use tracing_subscriber::{filter::Directive, fmt, prelude::*, EnvFilter}; use tracing_subscriber::{EnvFilter, filter::Directive, fmt, prelude::*};
pub fn init_logger() -> Result<()> { pub fn init_logger() -> Result<()> {
let level = if cfg!(debug_assertions) { let level = if cfg!(debug_assertions) {

View file

@ -3,7 +3,7 @@
use calloop::timer::{TimeoutAction, Timer}; use calloop::timer::{TimeoutAction, Timer};
use smithay::{ use smithay::{
reexports::{ reexports::{
calloop::{generic::Generic, EventLoop, Interest, Mode, PostAction}, calloop::{EventLoop, Interest, Mode, PostAction, generic::Generic},
wayland_server::{Display, DisplayHandle}, wayland_server::{Display, DisplayHandle},
}, },
wayland::socket::ListeningSocketSource, wayland::socket::ListeningSocketSource,

View file

@ -1,11 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::reexports::{ use smithay::reexports::{
calloop::{generic::Generic, Interest, LoopHandle, Mode, PostAction}, calloop::{Interest, LoopHandle, Mode, PostAction, generic::Generic},
rustix, rustix,
}; };
use anyhow::{anyhow, Context, Result}; use anyhow::{Context, Result, anyhow};
use sendfd::RecvWithFd; use sendfd::RecvWithFd;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::{

View file

@ -9,21 +9,21 @@ use smithay::{
backend::{ backend::{
input::KeyState, input::KeyState,
renderer::{ renderer::{
ImportAll, ImportMem, Renderer,
element::{ element::{
Element, RenderElement, UnderlyingStorage,
memory::MemoryRenderBufferRenderElement, memory::MemoryRenderBufferRenderElement,
utils::{CropRenderElement, RelocateRenderElement, RescaleRenderElement}, utils::{CropRenderElement, RelocateRenderElement, RescaleRenderElement},
Element, RenderElement, UnderlyingStorage,
}, },
gles::element::PixelShaderElement, gles::element::PixelShaderElement,
glow::GlowRenderer, glow::GlowRenderer,
utils::{DamageSet, OpaqueRegions}, utils::{DamageSet, OpaqueRegions},
ImportAll, ImportMem, Renderer,
}, },
}, },
desktop::{space::SpaceElement, WindowSurfaceType}, desktop::{WindowSurfaceType, space::SpaceElement},
input::{ input::{
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
Seat, Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
}, },
output::Output, output::Output,
reexports::wayland_server::{backend::ObjectId, protocol::wl_surface::WlSurface}, reexports::wayland_server::{backend::ObjectId, protocol::wl_surface::WlSurface},
@ -32,7 +32,7 @@ use smithay::{
Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size, Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size,
}, },
wayland::seat::WaylandFocus, wayland::seat::WaylandFocus,
xwayland::{xwm::X11Relatable, X11Surface}, xwayland::{X11Surface, xwm::X11Relatable},
}; };
use stack::CosmicStackInternal; use stack::CosmicStackInternal;
use window::CosmicWindowInternal; use window::CosmicWindowInternal;
@ -41,7 +41,7 @@ use std::{
borrow::Cow, borrow::Cow,
fmt, fmt,
hash::Hash, hash::Hash,
sync::{atomic::AtomicBool, Arc, Mutex, Weak}, sync::{Arc, Mutex, Weak, atomic::AtomicBool},
}; };
pub mod surface; pub mod surface;
@ -65,12 +65,12 @@ use smithay::desktop::WindowSurface;
use tracing::debug; use tracing::debug;
use super::{ use super::{
ManagedLayer,
focus::target::PointerFocusTarget, focus::target::PointerFocusTarget,
layout::{ layout::{
floating::{ResizeState, TiledCorners}, floating::{ResizeState, TiledCorners},
tiling::NodeDesc, tiling::NodeDesc,
}, },
ManagedLayer,
}; };
use cosmic_settings_config::shortcuts::action::{Direction, FocusDirection}; use cosmic_settings_config::shortcuts::action::{Direction, FocusDirection};
@ -821,10 +821,10 @@ impl CosmicMapped {
pub fn key(&self) -> CosmicMappedKey { pub fn key(&self) -> CosmicMappedKey {
CosmicMappedKey(match &self.element { CosmicMappedKey(match &self.element {
CosmicMappedInternal::Stack(stack) => { CosmicMappedInternal::Stack(stack) => {
CosmicMappedKeyInner::Stack(Arc::downgrade(&stack.0 .0)) CosmicMappedKeyInner::Stack(Arc::downgrade(&stack.0.0))
} }
CosmicMappedInternal::Window(window) => { CosmicMappedInternal::Window(window) => {
CosmicMappedKeyInner::Window(Arc::downgrade(&window.0 .0)) CosmicMappedKeyInner::Window(Arc::downgrade(&window.0.0))
} }
_ => unreachable!(), _ => unreachable!(),
}) })

View file

@ -9,14 +9,14 @@ use crate::{
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
Apply,
iced::{ iced::{
widget::{column, container, horizontal_space, row, vertical_space},
Alignment, Alignment,
widget::{column, container, horizontal_space, row, vertical_space},
}, },
iced_core::{Background, Border, Color, Length}, iced_core::{Background, Border, Color, Length},
theme, theme,
widget::{icon::from_name, text}, widget::{icon::from_name, text},
Apply,
}; };
use cosmic_settings_config::shortcuts::action::{Action, ResizeDirection}; use cosmic_settings_config::shortcuts::action::{Action, ResizeDirection};
use smithay::utils::Size; use smithay::utils::Size;

View file

@ -1,6 +1,6 @@
use super::{ use super::{
window::{Focus, RESIZE_BORDER},
CosmicSurface, CosmicSurface,
window::{Focus, RESIZE_BORDER},
}; };
use crate::{ use crate::{
backend::render::cursor::CursorState, backend::render::cursor::CursorState,
@ -17,11 +17,12 @@ use crate::{
}; };
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
iced::{id::Id, widget as iced_widget, Alignment}, Apply, Element as CosmicElement, Theme,
iced_core::{border::Radius, Background, Border, Color, Length}, iced::{Alignment, id::Id, widget as iced_widget},
iced_core::{Background, Border, Color, Length, border::Radius},
iced_runtime::Task, iced_runtime::Task,
iced_widget::scrollable::AbsoluteOffset, iced_widget::scrollable::AbsoluteOffset,
theme, widget as cosmic_widget, Apply, Element as CosmicElement, Theme, theme, widget as cosmic_widget,
}; };
use cosmic_settings_config::shortcuts; use cosmic_settings_config::shortcuts;
use shortcuts::action::{Direction, FocusDirection}; use shortcuts::action::{Direction, FocusDirection};
@ -29,15 +30,16 @@ use smithay::{
backend::{ backend::{
input::KeyState, input::KeyState,
renderer::{ renderer::{
element::{
memory::MemoryRenderBufferRenderElement, surface::WaylandSurfaceRenderElement,
AsRenderElements,
},
ImportAll, ImportMem, Renderer, ImportAll, ImportMem, Renderer,
element::{
AsRenderElements, memory::MemoryRenderBufferRenderElement,
surface::WaylandSurfaceRenderElement,
},
}, },
}, },
desktop::{space::SpaceElement, WindowSurfaceType}, desktop::{WindowSurfaceType, space::SpaceElement},
input::{ input::{
Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState}, keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
pointer::{ pointer::{
AxisFrame, ButtonEvent, CursorImageStatus, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, CursorImageStatus, GestureHoldBeginEvent, GestureHoldEndEvent,
@ -49,7 +51,6 @@ use smithay::{
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget, DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
UpEvent, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
reexports::wayland_server::protocol::wl_surface::WlSurface, reexports::wayland_server::protocol::wl_surface::WlSurface,
@ -62,8 +63,8 @@ use std::{
fmt, fmt,
hash::Hash, hash::Hash,
sync::{ sync::{
atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering},
Arc, LazyLock, Mutex, Arc, LazyLock, Mutex,
atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering},
}, },
}; };
@ -313,11 +314,7 @@ impl CosmicStack {
if let Ok(old) = if let Ok(old) =
p.active p.active
.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |val| { .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |val| {
if val < max - 1 { if val < max - 1 { Some(val + 1) } else { None }
Some(val + 1)
} else {
None
}
}) })
{ {
p.previous_keyboard.store(old, Ordering::SeqCst); p.previous_keyboard.store(old, Ordering::SeqCst);

View file

@ -1,20 +1,19 @@
use cosmic::{ use cosmic::{
Apply,
font::Font, font::Font,
iced::{ iced::{
widget::{self, container::draw_background, rule::FillMode},
Background, Background,
widget::{self, container::draw_background, rule::FillMode},
}, },
iced_core::{ iced_core::{
alignment, event, Border, Clipboard, Color, Length, Rectangle, Shell, Size, alignment, event,
layout::{Layout, Limits, Node}, layout::{Layout, Limits, Node},
mouse, overlay, renderer, mouse, overlay, renderer,
widget::{operation::Operation, tree::Tree, Id, Widget}, widget::{Id, Widget, operation::Operation, tree::Tree},
Border, Clipboard, Color, Length, Rectangle, Shell, Size,
}, },
iced_widget::scrollable::AbsoluteOffset, iced_widget::scrollable::AbsoluteOffset,
theme, theme,
widget::{icon::from_name, Icon}, widget::{Icon, icon::from_name},
Apply,
}; };
use super::tab_text::tab_text; use super::tab_text::tab_text;

View file

@ -1,15 +1,14 @@
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use cosmic::{ use cosmic::{
iced::{alignment, Point}, iced::{Point, alignment},
iced_core::{ iced_core::{
gradient, Background, Border, Color, Degrees, Gradient, Length, Rectangle, Size, Text, gradient,
layout::{Layout, Limits, Node}, layout::{Layout, Limits, Node},
mouse::Cursor, mouse::Cursor,
renderer::{self, Renderer as IcedRenderer}, renderer::{self, Renderer as IcedRenderer},
text::{LineHeight, Paragraph, Renderer as TextRenderer, Shaping}, text::{LineHeight, Paragraph, Renderer as TextRenderer, Shaping},
widget::{tree, Tree, Widget}, widget::{Tree, Widget, tree},
Background, Border, Color, Degrees, Gradient, Length, Rectangle, Size, Text,
}, },
}; };

View file

@ -1,25 +1,24 @@
use super::tab::{Tab, TabBackgroundTheme, TabMessage, TabRuleTheme, MIN_ACTIVE_TAB_WIDTH}; use super::tab::{MIN_ACTIVE_TAB_WIDTH, Tab, TabBackgroundTheme, TabMessage, TabRuleTheme};
use cosmic::{ use cosmic::{
iced::{id::Id, widget, Element}, Apply,
iced::{Element, id::Id, widget},
iced_core::{ iced_core::{
event, Background, Border, Clipboard, Color, Length, Point, Rectangle, Renderer, Shell, Size,
Vector, event,
layout::{Layout, Limits, Node}, layout::{Layout, Limits, Node},
mouse, overlay, renderer, mouse, overlay, renderer,
widget::{ widget::{
Widget,
operation::{ operation::{
scrollable::{AbsoluteOffset, RelativeOffset},
Operation, Scrollable, Operation, Scrollable,
scrollable::{AbsoluteOffset, RelativeOffset},
}, },
tree::{self, Tree}, tree::{self, Tree},
Widget,
}, },
Background, Border, Clipboard, Color, Length, Point, Rectangle, Renderer, Shell, Size,
Vector,
}, },
iced_widget::container::draw_background, iced_widget::container::draw_background,
theme, theme,
widget::{container::Catalog, icon::from_name}, widget::{container::Catalog, icon::from_name},
Apply,
}; };
use keyframe::{ use keyframe::{
ease, ease,

View file

@ -5,14 +5,14 @@ use crate::{
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
Apply,
iced::{ iced::{
widget::{container, row},
Alignment, Alignment,
widget::{container, row},
}, },
iced_core::{Background, Border, Color, Length}, iced_core::{Background, Border, Color, Length},
theme, theme,
widget::{horizontal_space, icon::from_name, text}, widget::{horizontal_space, icon::from_name, text},
Apply,
}; };
use smithay::utils::{Logical, Size}; use smithay::utils::{Logical, Size};

View file

@ -2,28 +2,28 @@ use crate::wayland::protocols::corner_radius::CacheableCorners;
use std::{ use std::{
borrow::Cow, borrow::Cow,
sync::{ sync::{
atomic::{AtomicBool, Ordering},
Mutex, Mutex,
atomic::{AtomicBool, Ordering},
}, },
time::Duration, time::Duration,
}; };
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
element::{
surface::{render_elements_from_surface_tree, WaylandSurfaceRenderElement},
utils::select_dmabuf_feedback,
AsRenderElements, Kind, RenderElementStates,
},
ImportAll, Renderer, ImportAll, Renderer,
element::{
AsRenderElements, Kind, RenderElementStates,
surface::{WaylandSurfaceRenderElement, render_elements_from_surface_tree},
utils::select_dmabuf_feedback,
},
}, },
desktop::{ desktop::{
space::SpaceElement, utils::OutputPresentationFeedback, PopupManager, Window, PopupManager, Window, WindowSurface, WindowSurfaceType, space::SpaceElement,
WindowSurface, WindowSurfaceType, utils::OutputPresentationFeedback,
}, },
input::{ input::{
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
Seat, Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
}, },
output::Output, output::Output,
reexports::{ reexports::{
@ -38,14 +38,14 @@ use smithay::{
wayland_server::protocol::wl_surface::WlSurface, wayland_server::protocol::wl_surface::WlSurface,
}, },
utils::{ utils::{
user_data::UserDataMap, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size, user_data::UserDataMap,
}, },
wayland::{ wayland::{
compositor::{with_states, with_surface_tree_downward, SurfaceData, TraversalAction}, compositor::{SurfaceData, TraversalAction, with_states, with_surface_tree_downward},
seat::WaylandFocus, seat::WaylandFocus,
shell::xdg::{SurfaceCachedState, ToplevelSurface, XdgToplevelSurfaceData}, shell::xdg::{SurfaceCachedState, ToplevelSurface, XdgToplevelSurfaceData},
}, },
xwayland::{xwm::X11Relatable, X11Surface}, xwayland::{X11Surface, xwm::X11Relatable},
}; };
use tracing::trace; use tracing::trace;

View file

@ -5,11 +5,11 @@ use crate::{
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
Apply,
iced::widget::{container, horizontal_space, row}, iced::widget::{container, horizontal_space, row},
iced_core::{Alignment, Background, Border, Color, Length}, iced_core::{Alignment, Background, Border, Color, Length},
theme, theme,
widget::{icon::from_name, text}, widget::{icon::from_name, text},
Apply,
}; };
use smithay::utils::Size; use smithay::utils::Size;

View file

@ -16,15 +16,16 @@ use smithay::{
backend::{ backend::{
input::KeyState, input::KeyState,
renderer::{ renderer::{
element::{
memory::MemoryRenderBufferRenderElement, surface::WaylandSurfaceRenderElement,
AsRenderElements,
},
ImportAll, ImportMem, Renderer, ImportAll, ImportMem, Renderer,
element::{
AsRenderElements, memory::MemoryRenderBufferRenderElement,
surface::WaylandSurfaceRenderElement,
},
}, },
}, },
desktop::{space::SpaceElement, WindowSurfaceType}, desktop::{WindowSurfaceType, space::SpaceElement},
input::{ input::{
Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState}, keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
pointer::{ pointer::{
AxisFrame, ButtonEvent, CursorIcon, CursorImageStatus, GestureHoldBeginEvent, AxisFrame, ButtonEvent, CursorIcon, CursorImageStatus, GestureHoldBeginEvent,
@ -36,7 +37,6 @@ use smithay::{
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget, DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
UpEvent, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
reexports::wayland_server::protocol::wl_surface::WlSurface, reexports::wayland_server::protocol::wl_surface::WlSurface,
@ -49,8 +49,8 @@ use std::{
fmt, fmt,
hash::Hash, hash::Hash,
sync::{ sync::{
atomic::{AtomicBool, AtomicU8, Ordering},
Arc, Mutex, Arc, Mutex,
atomic::{AtomicBool, AtomicU8, Ordering},
}, },
}; };
use wayland_backend::server::ObjectId; use wayland_backend::server::ObjectId;

View file

@ -1,16 +1,16 @@
use crate::{ use crate::{
shell::{element::CosmicMapped, CosmicSurface, MinimizedWindow, Shell}, shell::{CosmicSurface, MinimizedWindow, Shell, element::CosmicMapped},
state::Common, state::Common,
utils::prelude::*, utils::prelude::*,
wayland::handlers::{xdg_shell::PopupGrabData, xwayland_keyboard_grab::XWaylandGrabSeatData}, wayland::handlers::{xdg_shell::PopupGrabData, xwayland_keyboard_grab::XWaylandGrabSeatData},
}; };
use indexmap::IndexSet; use indexmap::IndexSet;
use smithay::{ use smithay::{
desktop::{layer_map_for_output, PopupUngrabStrategy}, desktop::{PopupUngrabStrategy, layer_map_for_output},
input::{pointer::MotionEvent, Seat}, input::{Seat, pointer::MotionEvent},
output::Output, output::Output,
reexports::wayland_server::{protocol::wl_surface::WlSurface, Resource}, reexports::wayland_server::{Resource, protocol::wl_surface::WlSurface},
utils::{IsAlive, Point, Serial, SERIAL_COUNTER}, utils::{IsAlive, Point, SERIAL_COUNTER, Serial},
wayland::{ wayland::{
seat::WaylandFocus, seat::WaylandFocus,
selection::{data_device::set_data_device_focus, primary_selection::set_primary_focus}, selection::{data_device::set_data_device_focus, primary_selection::set_primary_focus},
@ -21,10 +21,10 @@ use std::{borrow::Cow, mem, sync::Mutex};
use tracing::{debug, trace}; use tracing::{debug, trace};
pub use self::order::{render_input_order, Stage}; pub use self::order::{Stage, render_input_order};
use self::target::{KeyboardFocusTarget, WindowGroup}; use self::target::{KeyboardFocusTarget, WindowGroup};
use super::{grabs::SeatMoveGrabState, layout::floating::FloatingLayout, SeatExt}; use super::{SeatExt, grabs::SeatMoveGrabState, layout::floating::FloatingLayout};
mod order; mod order;
pub mod target; pub mod target;

View file

@ -3,7 +3,7 @@ use std::{ops::ControlFlow, time::Instant};
use cosmic_comp_config::workspace::WorkspaceLayout; use cosmic_comp_config::workspace::WorkspaceLayout;
use keyframe::{ease, functions::EaseInOutCubic}; use keyframe::{ease, functions::EaseInOutCubic};
use smithay::{ use smithay::{
desktop::{layer_map_for_output, LayerSurface, PopupKind, PopupManager}, desktop::{LayerSurface, PopupKind, PopupManager, layer_map_for_output},
output::{Output, OutputNoMode}, output::{Output, OutputNoMode},
utils::{Logical, Point}, utils::{Logical, Point},
wayland::{session_lock::LockSurface, shell::wlr_layer::Layer}, wayland::{session_lock::LockSurface, shell::wlr_layer::Layer},
@ -13,14 +13,14 @@ use smithay::{
use crate::{ use crate::{
backend::render::ElementFilter, backend::render::ElementFilter,
shell::{ shell::{
SeatExt, Shell, Workspace, WorkspaceDelta,
focus::target::KeyboardFocusTarget, focus::target::KeyboardFocusTarget,
layout::{floating::FloatingLayout, tiling::ANIMATION_DURATION}, layout::{floating::FloatingLayout, tiling::ANIMATION_DURATION},
SeatExt, Shell, Workspace, WorkspaceDelta,
}, },
utils::{ utils::{
geometry::*, geometry::*,
prelude::OutputExt, prelude::OutputExt,
quirks::{workspace_overview_is_open, WORKSPACE_OVERVIEW_NAMESPACE}, quirks::{WORKSPACE_OVERVIEW_NAMESPACE, workspace_overview_is_open},
}, },
wayland::protocols::workspace::WorkspaceHandle, wayland::protocols::workspace::WorkspaceHandle,
}; };

View file

@ -2,10 +2,10 @@ use std::{borrow::Cow, sync::Weak, time::Duration};
use crate::{ use crate::{
shell::{ shell::{
CosmicSurface, SeatExt,
element::{CosmicMapped, CosmicStack, CosmicWindow}, element::{CosmicMapped, CosmicStack, CosmicWindow},
layout::tiling::ResizeForkTarget, layout::tiling::ResizeForkTarget,
zoom::ZoomFocusTarget, zoom::ZoomFocusTarget,
CosmicSurface, SeatExt,
}, },
utils::prelude::*, utils::prelude::*,
wayland::handlers::{screencopy::SessionHolder, xdg_shell::popup::get_popup_toplevel}, wayland::handlers::{screencopy::SessionHolder, xdg_shell::popup::get_popup_toplevel},
@ -13,8 +13,9 @@ use crate::{
use id_tree::NodeId; use id_tree::NodeId;
use smithay::{ use smithay::{
backend::input::KeyState, backend::input::KeyState,
desktop::{space::SpaceElement, LayerSurface, PopupKind, WindowSurface, WindowSurfaceType}, desktop::{LayerSurface, PopupKind, WindowSurface, WindowSurfaceType, space::SpaceElement},
input::{ input::{
Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState}, keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
pointer::{ pointer::{
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
@ -26,14 +27,13 @@ use smithay::{
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget, DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
UpEvent, UpEvent,
}, },
Seat,
}, },
reexports::wayland_server::{ reexports::wayland_server::{
backend::ObjectId, protocol::wl_surface::WlSurface, Client, Resource, Client, Resource, backend::ObjectId, protocol::wl_surface::WlSurface,
}, },
utils::{IsAlive, Logical, Point, Serial, Transform}, utils::{IsAlive, Logical, Point, Serial, Transform},
wayland::{seat::WaylandFocus, session_lock::LockSurface}, wayland::{seat::WaylandFocus, session_lock::LockSurface},
xwayland::{xwm::XwmId, X11Surface}, xwayland::{X11Surface, xwm::XwmId},
}; };
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]

View file

@ -8,9 +8,9 @@ use crate::{
config::Config, config::Config,
fl, fl,
shell::{ shell::{
CosmicSurface, PointGlobalExt, Shell,
element::{CosmicMapped, CosmicWindow}, element::{CosmicMapped, CosmicWindow},
grabs::ReleaseMode, grabs::ReleaseMode,
CosmicSurface, PointGlobalExt, Shell,
}, },
state::State, state::State,
utils::{prelude::SeatExt, screenshot::screenshot_window}, utils::{prelude::SeatExt, screenshot::screenshot_window},

View file

@ -1,11 +1,10 @@
use cosmic::{ use cosmic::{
iced::Element, iced::Element,
iced_core::{ iced_core::{
event, layout, mouse, overlay,
renderer::{Quad, Style},
widget::{tree, Id, Tree, Widget},
Background, Border, Clipboard, Color, Event, Layout, Length, Rectangle, Background, Border, Clipboard, Color, Event, Layout, Length, Rectangle,
Renderer as IcedRenderer, Shell, Size, Renderer as IcedRenderer, Shell, Size, event, layout, mouse, overlay,
renderer::{Quad, Style},
widget::{Id, Tree, Widget, tree},
}, },
widget::button::Catalog, widget::button::Catalog,
}; };

View file

@ -1,30 +1,31 @@
use std::{ use std::{
fmt, fmt,
sync::{ sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex, Arc, Mutex,
atomic::{AtomicBool, Ordering},
}, },
}; };
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
Apply as _, Task,
iced::{Alignment, Background}, iced::{Alignment, Background},
iced_core::{alignment::Horizontal, Border, Length, Rectangle as IcedRectangle}, iced_core::{Border, Length, Rectangle as IcedRectangle, alignment::Horizontal},
iced_widget::{self, text::Style as TextStyle, Column, Row}, iced_widget::{self, Column, Row, text::Style as TextStyle},
theme, theme,
widget::{button, divider, horizontal_space, icon::from_name, text}, widget::{button, divider, horizontal_space, icon::from_name, text},
Apply as _, Task,
}; };
use smithay::{ use smithay::{
backend::{ backend::{
input::{ButtonState, TouchSlot}, input::{ButtonState, TouchSlot},
renderer::{ renderer::{
element::{memory::MemoryRenderBufferRenderElement, AsRenderElements},
ImportMem, Renderer, ImportMem, Renderer,
element::{AsRenderElements, memory::MemoryRenderBufferRenderElement},
}, },
}, },
desktop::space::SpaceElement, desktop::space::SpaceElement,
input::{ input::{
Seat,
pointer::{ pointer::{
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent, GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
@ -36,14 +37,13 @@ use smithay::{
DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent, DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent,
TouchGrab, TouchInnerHandle, TouchTarget, UpEvent, TouchGrab, TouchInnerHandle, TouchTarget, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
utils::{Logical, Point, Rectangle, Serial, Size}, utils::{Logical, Point, Rectangle, Serial, Size},
}; };
use crate::{ use crate::{
shell::{focus::target::PointerFocusTarget, SeatExt}, shell::{SeatExt, focus::target::PointerFocusTarget},
state::State, state::State,
utils::{ utils::{
iced::{IcedElement, Program}, iced::{IcedElement, Program},

View file

@ -2,16 +2,16 @@
use crate::{ use crate::{
backend::render::{ backend::render::{
cursor::CursorState, element::AsGlowRenderer, BackdropShader, IndicatorShader, Key, Usage, BackdropShader, IndicatorShader, Key, Usage, cursor::CursorState, element::AsGlowRenderer,
}, },
shell::{ shell::{
CosmicMapped, CosmicSurface, Direction, ManagedLayer,
element::{ element::{
stack_hover::{stack_hover, StackHover},
CosmicMappedRenderElement, CosmicMappedRenderElement,
stack_hover::{StackHover, stack_hover},
}, },
focus::target::{KeyboardFocusTarget, PointerFocusTarget}, focus::target::{KeyboardFocusTarget, PointerFocusTarget},
layout::floating::TiledCorners, layout::floating::TiledCorners,
CosmicMapped, CosmicSurface, Direction, ManagedLayer,
}, },
utils::prelude::*, utils::prelude::*,
wayland::protocols::toplevel_info::{toplevel_enter_output, toplevel_enter_workspace}, wayland::protocols::toplevel_info::{toplevel_enter_output, toplevel_enter_workspace},
@ -23,12 +23,13 @@ use smithay::{
backend::{ backend::{
input::ButtonState, input::ButtonState,
renderer::{ renderer::{
element::{utils::RescaleRenderElement, AsRenderElements, RenderElement},
ImportAll, ImportMem, Renderer, ImportAll, ImportMem, Renderer,
element::{AsRenderElements, RenderElement, utils::RescaleRenderElement},
}, },
}, },
desktop::{layer_map_for_output, space::SpaceElement, WindowSurfaceType}, desktop::{WindowSurfaceType, layer_map_for_output, space::SpaceElement},
input::{ input::{
Seat,
pointer::{ pointer::{
AxisFrame, ButtonEvent, CursorIcon, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, CursorIcon, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent, GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
@ -37,14 +38,13 @@ use smithay::{
RelativeMotionEvent, RelativeMotionEvent,
}, },
touch::{self, GrabStartData as TouchGrabStartData, TouchGrab, TouchInnerHandle}, touch::{self, GrabStartData as TouchGrabStartData, TouchGrab, TouchInnerHandle},
Seat,
}, },
output::Output, output::Output,
utils::{IsAlive, Logical, Point, Rectangle, Scale, Serial, SERIAL_COUNTER}, utils::{IsAlive, Logical, Point, Rectangle, SERIAL_COUNTER, Scale, Serial},
}; };
use std::{ use std::{
collections::HashSet, collections::HashSet,
sync::{atomic::Ordering, Mutex}, sync::{Mutex, atomic::Ordering},
time::Instant, time::Instant,
}; };

View file

@ -13,8 +13,9 @@ use crate::{
}; };
use smithay::{ use smithay::{
backend::input::ButtonState, backend::input::ButtonState,
desktop::{space::SpaceElement, WindowSurface}, desktop::{WindowSurface, space::SpaceElement},
input::{ input::{
Seat,
pointer::{ pointer::{
AxisFrame, ButtonEvent, CursorIcon, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, CursorIcon, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent, GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
@ -26,7 +27,6 @@ use smithay::{
DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent, DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent,
OrientationEvent, ShapeEvent, TouchGrab, TouchInnerHandle, UpEvent, OrientationEvent, ShapeEvent, TouchGrab, TouchInnerHandle, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
utils::{IsAlive, Logical, Point, Rectangle, Serial, Size}, utils::{IsAlive, Logical, Point, Rectangle, Serial, Size},

View file

@ -10,13 +10,13 @@ use cosmic_settings_config::shortcuts::action::ResizeDirection;
use keyframe::{ease, functions::EaseInOutCubic}; use keyframe::{ease, functions::EaseInOutCubic};
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
element::{
utils::{Relocate, RelocateRenderElement, RescaleRenderElement},
AsRenderElements, RenderElement,
},
ImportAll, ImportMem, Renderer, ImportAll, ImportMem, Renderer,
element::{
AsRenderElements, RenderElement,
utils::{Relocate, RelocateRenderElement, RescaleRenderElement},
},
}, },
desktop::{layer_map_for_output, space::SpaceElement, PopupKind, Space, WindowSurfaceType}, desktop::{PopupKind, Space, WindowSurfaceType, layer_map_for_output, space::SpaceElement},
input::Seat, input::Seat,
output::Output, output::Output,
utils::{IsAlive, Logical, Point, Rectangle, Scale, Size}, utils::{IsAlive, Logical, Point, Rectangle, Scale, Size},
@ -24,20 +24,20 @@ use smithay::{
}; };
use crate::{ use crate::{
backend::render::{element::AsGlowRenderer, IndicatorShader, Key, Usage}, backend::render::{IndicatorShader, Key, Usage, element::AsGlowRenderer},
shell::{ shell::{
CosmicSurface, Direction, ManagedLayer, MoveResult, ResizeMode,
element::{ element::{
CosmicMapped, CosmicMappedRenderElement, CosmicWindow, MaximizedState,
resize_indicator::ResizeIndicator, resize_indicator::ResizeIndicator,
stack::{CosmicStackRenderElement, MoveResult as StackMoveResult, TAB_HEIGHT}, stack::{CosmicStackRenderElement, MoveResult as StackMoveResult, TAB_HEIGHT},
window::CosmicWindowRenderElement, window::CosmicWindowRenderElement,
CosmicMapped, CosmicMappedRenderElement, CosmicWindow, MaximizedState,
}, },
focus::{ focus::{
target::{KeyboardFocusTarget, PointerFocusTarget},
FocusStackMut, FocusStackMut,
target::{KeyboardFocusTarget, PointerFocusTarget},
}, },
grabs::{GrabStartData, ReleaseMode, ResizeEdge}, grabs::{GrabStartData, ReleaseMode, ResizeEdge},
CosmicSurface, Direction, ManagedLayer, MoveResult, ResizeMode,
}, },
state::State, state::State,
utils::{prelude::*, tween::EaseRectangle}, utils::{prelude::*, tween::EaseRectangle},

View file

@ -1,6 +1,6 @@
use crate::shell::element::CosmicSurface; use crate::shell::element::CosmicSurface;
use smithay::{ use smithay::{
reexports::wayland_server::{backend::ClientId, Client, Resource}, reexports::wayland_server::{Client, Resource, backend::ClientId},
utils::{IsAlive, Serial}, utils::{IsAlive, Serial},
wayland::{ wayland::{
compositor::{Blocker, BlockerState}, compositor::{Blocker, BlockerState},

View file

@ -13,6 +13,7 @@ use id_tree::{NodeId, Tree};
use smithay::{ use smithay::{
backend::input::ButtonState, backend::input::ButtonState,
input::{ input::{
Seat,
pointer::{ pointer::{
AxisFrame, ButtonEvent, CursorIcon, Focus, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, CursorIcon, Focus, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent, GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
@ -24,7 +25,6 @@ use smithay::{
DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent, DownEvent, GrabStartData as TouchGrabStartData, MotionEvent as TouchMotionEvent,
OrientationEvent, ShapeEvent, TouchGrab, TouchInnerHandle, TouchTarget, UpEvent, OrientationEvent, ShapeEvent, TouchGrab, TouchInnerHandle, TouchTarget, UpEvent,
}, },
Seat,
}, },
output::WeakOutput, output::WeakOutput,
utils::{IsAlive, Logical, Point, Serial}, utils::{IsAlive, Logical, Point, Serial},

View file

@ -2,18 +2,18 @@ use cosmic_settings_config::shortcuts;
use smithay::{ use smithay::{
backend::input::{KeyState, Keycode}, backend::input::{KeyState, Keycode},
input::{ input::{
Seat, SeatHandler,
keyboard::{ keyboard::{
GrabStartData as KeyboardGrabStartData, KeyboardGrab, KeyboardInnerHandle, GrabStartData as KeyboardGrabStartData, KeyboardGrab, KeyboardInnerHandle,
ModifiersState, ModifiersState,
}, },
Seat, SeatHandler,
}, },
utils::Serial, utils::Serial,
}; };
use crate::{ use crate::{
config::key_bindings::cosmic_modifiers_from_smithay, config::key_bindings::cosmic_modifiers_from_smithay,
shell::{layout::tiling::NodeDesc, Trigger}, shell::{Trigger, layout::tiling::NodeDesc},
state::State, state::State,
}; };

View file

@ -2,11 +2,14 @@
use crate::{ use crate::{
backend::render::{ backend::render::{
element::AsGlowRenderer, BackdropShader, IndicatorShader, Key, Usage, ACTIVE_GROUP_COLOR, ACTIVE_GROUP_COLOR, BackdropShader, GROUP_COLOR, IndicatorShader, Key, Usage,
GROUP_COLOR, element::AsGlowRenderer,
}, },
shell::{ shell::{
CosmicSurface, Direction, FocusResult, MoveResult, OutputNotMapped, OverviewMode,
ResizeMode, Trigger,
element::{ element::{
CosmicMapped, CosmicMappedRenderElement, CosmicStack, CosmicWindow,
resize_indicator::ResizeIndicator, resize_indicator::ResizeIndicator,
stack::{ stack::{
CosmicStackRenderElement, MoveResult as StackMoveResult, CosmicStackRenderElement, MoveResult as StackMoveResult,
@ -14,16 +17,13 @@ use crate::{
}, },
swap_indicator::SwapIndicator, swap_indicator::SwapIndicator,
window::CosmicWindowRenderElement, window::CosmicWindowRenderElement,
CosmicMapped, CosmicMappedRenderElement, CosmicStack, CosmicWindow,
}, },
focus::{ focus::{
target::{KeyboardFocusTarget, PointerFocusTarget, WindowGroup},
FocusStackMut, FocusTarget, FocusStackMut, FocusTarget,
target::{KeyboardFocusTarget, PointerFocusTarget, WindowGroup},
}, },
grabs::ResizeEdge, grabs::ResizeEdge,
layout::Orientation, layout::Orientation,
CosmicSurface, Direction, FocusResult, MoveResult, OutputNotMapped, OverviewMode,
ResizeMode, Trigger,
}, },
utils::{prelude::*, tween::EaseRectangle}, utils::{prelude::*, tween::EaseRectangle},
wayland::{ wayland::{
@ -46,17 +46,17 @@ use keyframe::{
}; };
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
ImportAll, ImportMem, Renderer,
element::{ element::{
utils::{
constrain_render_elements, ConstrainAlign, ConstrainScaleBehavior,
RescaleRenderElement,
},
AsRenderElements, Id, RenderElement, AsRenderElements, Id, RenderElement,
utils::{
ConstrainAlign, ConstrainScaleBehavior, RescaleRenderElement,
constrain_render_elements,
},
}, },
glow::GlowRenderer, glow::GlowRenderer,
ImportAll, ImportMem, Renderer,
}, },
desktop::{layer_map_for_output, space::SpaceElement, PopupKind, WindowSurfaceType}, desktop::{PopupKind, WindowSurfaceType, layer_map_for_output, space::SpaceElement},
input::Seat, input::Seat,
output::Output, output::Output,
reexports::wayland_server::Client, reexports::wayland_server::Client,
@ -2209,12 +2209,14 @@ impl TilingLayout {
Data::Group { alive, .. } => KeyboardFocusTarget::Group(WindowGroup { Data::Group { alive, .. } => KeyboardFocusTarget::Group(WindowGroup {
node: node_id.clone(), node: node_id.clone(),
alive: Arc::downgrade(alive), alive: Arc::downgrade(alive),
focus_stack: vec![new_elements[0] focus_stack: vec![
.tiling_node_id new_elements[0]
.lock() .tiling_node_id
.unwrap() .lock()
.clone() .unwrap()
.unwrap()], .clone()
.unwrap(),
],
}), }),
Data::Mapped { mapped, .. } => KeyboardFocusTarget::Element(mapped.clone()), Data::Mapped { mapped, .. } => KeyboardFocusTarget::Element(mapped.clone()),
_ => unreachable!(), _ => unreachable!(),

View file

@ -5,7 +5,7 @@ use indexmap::IndexMap;
use layout::TilingExceptions; use layout::TilingExceptions;
use std::{ use std::{
collections::HashMap, collections::HashMap,
sync::{atomic::Ordering, Mutex}, sync::{Mutex, atomic::Ordering},
thread, thread,
time::{Duration, Instant}, time::{Duration, Instant},
}; };
@ -19,8 +19,8 @@ use crate::{
}, },
}; };
use cosmic_comp_config::{ use cosmic_comp_config::{
workspace::{PinnedWorkspace, WorkspaceLayout, WorkspaceMode},
TileBehavior, ZoomConfig, ZoomMovement, TileBehavior, ZoomConfig, ZoomMovement,
workspace::{PinnedWorkspace, WorkspaceLayout, WorkspaceMode},
}; };
use cosmic_config::ConfigSet; use cosmic_config::ConfigSet;
use cosmic_protocols::workspace::v2::server::zcosmic_workspace_handle_v2::TilingState; use cosmic_protocols::workspace::v2::server::zcosmic_workspace_handle_v2::TilingState;
@ -30,28 +30,27 @@ use keyframe::{ease, functions::EaseInOutCubic};
use smithay::{ use smithay::{
backend::{input::TouchSlot, renderer::element::RenderElementStates}, backend::{input::TouchSlot, renderer::element::RenderElementStates},
desktop::{ desktop::{
layer_map_for_output, LayerSurface, PopupKind, WindowSurface, WindowSurfaceType, layer_map_for_output,
space::SpaceElement, space::SpaceElement,
utils::{ utils::{
surface_presentation_feedback_flags_from_states, surface_primary_scanout_output, OutputPresentationFeedback, surface_presentation_feedback_flags_from_states,
take_presentation_feedback_surface_tree, OutputPresentationFeedback, surface_primary_scanout_output, take_presentation_feedback_surface_tree,
}, },
LayerSurface, PopupKind, WindowSurface, WindowSurfaceType,
}, },
input::{ input::{
Seat,
pointer::{ pointer::{
CursorImageStatus, CursorImageSurfaceData, Focus, GrabStartData as PointerGrabStartData, CursorImageStatus, CursorImageSurfaceData, Focus, GrabStartData as PointerGrabStartData,
}, },
Seat,
}, },
output::{Output, WeakOutput}, output::{Output, WeakOutput},
reexports::{ reexports::{
wayland_protocols::ext::session_lock::v1::server::ext_session_lock_v1::ExtSessionLockV1, wayland_protocols::ext::session_lock::v1::server::ext_session_lock_v1::ExtSessionLockV1,
wayland_server::{protocol::wl_surface::WlSurface, Client}, wayland_server::{Client, protocol::wl_surface::WlSurface},
}, },
utils::{IsAlive, Logical, Point, Rectangle, Serial, Size}, utils::{IsAlive, Logical, Point, Rectangle, Serial, Size},
wayland::{ wayland::{
compositor::{with_states, SurfaceAttributes}, compositor::{SurfaceAttributes, with_states},
seat::WaylandFocus, seat::WaylandFocus,
session_lock::LockSurface, session_lock::LockSurface,
shell::wlr_layer::{KeyboardInteractivity, Layer, LayerSurfaceCachedState}, shell::wlr_layer::{KeyboardInteractivity, Layer, LayerSurfaceCachedState},
@ -73,8 +72,8 @@ use crate::{
}, },
protocols::{ protocols::{
toplevel_info::{ toplevel_info::{
toplevel_enter_output, toplevel_enter_workspace, toplevel_leave_output, ToplevelInfoState, toplevel_enter_output, toplevel_enter_workspace,
toplevel_leave_workspace, ToplevelInfoState, toplevel_leave_output, toplevel_leave_workspace,
}, },
workspace::{ workspace::{
WorkspaceGroupHandle, WorkspaceHandle, WorkspaceState, WorkspaceUpdateGuard, WorkspaceGroupHandle, WorkspaceHandle, WorkspaceState, WorkspaceUpdateGuard,
@ -97,14 +96,14 @@ use self::zoom::{OutputZoomState, ZoomState};
use self::{ use self::{
element::{ element::{
resize_indicator::{resize_indicator, ResizeIndicator},
swap_indicator::{swap_indicator, SwapIndicator},
CosmicWindow, MaximizedState, CosmicWindow, MaximizedState,
resize_indicator::{ResizeIndicator, resize_indicator},
swap_indicator::{SwapIndicator, swap_indicator},
}, },
focus::target::{KeyboardFocusTarget, PointerFocusTarget}, focus::target::{KeyboardFocusTarget, PointerFocusTarget},
grabs::{ grabs::{
tab_items, window_items, GrabStartData, Item, MenuGrab, MoveGrab, ReleaseMode, ResizeEdge, GrabStartData, Item, MenuGrab, MoveGrab, ReleaseMode, ResizeEdge, ResizeGrab, tab_items,
ResizeGrab, window_items,
}, },
layout::{ layout::{
floating::{FloatingLayout, ResizeState}, floating::{FloatingLayout, ResizeState},
@ -2030,11 +2029,7 @@ impl Shell {
Direction::Left => current_output_geo.loc.x - origin.x, Direction::Left => current_output_geo.loc.x - origin.x,
Direction::Right => origin.x - current_output_geo.loc.x, Direction::Right => origin.x - current_output_geo.loc.x,
}; };
if res > 0 { if res > 0 { Some((o, res)) } else { None }
Some((o, res))
} else {
None
}
}) })
.min_by_key(|(_, res)| *res) .min_by_key(|(_, res)| *res)
.map(|(o, _)| o) .map(|(o, _)| o)
@ -3766,41 +3761,25 @@ impl Shell {
.filter(|(_, other_geo)| other_geo.loc.y <= geometry.loc.y) .filter(|(_, other_geo)| other_geo.loc.y <= geometry.loc.y)
.min_by_key(|(_, other_geo)| { .min_by_key(|(_, other_geo)| {
let res = geometry.loc.y - other_geo.loc.y; let res = geometry.loc.y - other_geo.loc.y;
if res.is_positive() { if res.is_positive() { res } else { i32::MAX }
res
} else {
i32::MAX
}
}), }),
FocusDirection::Down => elements FocusDirection::Down => elements
.filter(|(_, other_geo)| other_geo.loc.y > geometry.loc.y) .filter(|(_, other_geo)| other_geo.loc.y > geometry.loc.y)
.max_by_key(|(_, other_geo)| { .max_by_key(|(_, other_geo)| {
let res = geometry.loc.y - other_geo.loc.y; let res = geometry.loc.y - other_geo.loc.y;
if res.is_negative() { if res.is_negative() { res } else { i32::MIN }
res
} else {
i32::MIN
}
}), }),
FocusDirection::Left => elements FocusDirection::Left => elements
.filter(|(_, other_geo)| other_geo.loc.x <= geometry.loc.x) .filter(|(_, other_geo)| other_geo.loc.x <= geometry.loc.x)
.min_by_key(|(_, other_geo)| { .min_by_key(|(_, other_geo)| {
let res = geometry.loc.x - other_geo.loc.x; let res = geometry.loc.x - other_geo.loc.x;
if res.is_positive() { if res.is_positive() { res } else { i32::MAX }
res
} else {
i32::MAX
}
}), }),
FocusDirection::Right => elements FocusDirection::Right => elements
.filter(|(_, other_geo)| other_geo.loc.x > geometry.loc.x) .filter(|(_, other_geo)| other_geo.loc.x > geometry.loc.x)
.max_by_key(|(_, other_geo)| { .max_by_key(|(_, other_geo)| {
let res = geometry.loc.x - other_geo.loc.x; let res = geometry.loc.x - other_geo.loc.x;
if res.is_negative() { if res.is_negative() { res } else { i32::MIN }
res
} else {
i32::MIN
}
}), }),
_ => return FocusResult::None, _ => return FocusResult::None,
} }

View file

@ -4,7 +4,7 @@ use std::{any::Any, cell::RefCell, collections::HashMap, sync::Mutex};
use crate::{ use crate::{
backend::render::cursor::CursorState, backend::render::cursor::CursorState,
config::{xkb_config_to_wl, Config}, config::{Config, xkb_config_to_wl},
input::{ModifiersShortcutQueue, SupressedButtons, SupressedKeys}, input::{ModifiersShortcutQueue, SupressedButtons, SupressedKeys},
state::State, state::State,
}; };
@ -12,9 +12,9 @@ use smithay::{
backend::input::{Device, DeviceCapability}, backend::input::{Device, DeviceCapability},
desktop::utils::bbox_from_surface_tree, desktop::utils::bbox_from_surface_tree,
input::{ input::{
Seat, SeatState,
keyboard::{LedState, XkbConfig}, keyboard::{LedState, XkbConfig},
pointer::{CursorImageAttributes, CursorImageStatus}, pointer::{CursorImageAttributes, CursorImageStatus},
Seat, SeatState,
}, },
output::Output, output::Output,
reexports::{input::Device as InputDevice, wayland_server::DisplayHandle}, reexports::{input::Device as InputDevice, wayland_server::DisplayHandle},

View file

@ -3,12 +3,12 @@ use crate::shell::layout::tiling::RestoreTilingState;
use crate::wayland::handlers::xdg_activation::ActivationContext; use crate::wayland::handlers::xdg_activation::ActivationContext;
use crate::{ use crate::{
backend::render::{ backend::render::{
element::{AsGlowRenderer, FromGlesError},
BackdropShader, BackdropShader,
element::{AsGlowRenderer, FromGlesError},
}, },
shell::{ shell::{
ANIMATION_DURATION, OverviewMode,
layout::{floating::FloatingLayout, tiling::TilingLayout}, layout::{floating::FloatingLayout, tiling::TilingLayout},
OverviewMode, ANIMATION_DURATION,
}, },
state::State, state::State,
utils::{prelude::*, tween::EaseRectangle}, utils::{prelude::*, tween::EaseRectangle},
@ -30,16 +30,16 @@ use keyframe::{ease, functions::EaseInOutCubic};
use smithay::output::WeakOutput; use smithay::output::WeakOutput;
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
ImportAll, ImportMem, Renderer,
element::{ element::{
surface::WaylandSurfaceRenderElement, texture::TextureRenderElement, Element, Id, RenderElement, surface::WaylandSurfaceRenderElement,
utils::RescaleRenderElement, Element, Id, RenderElement, texture::TextureRenderElement, utils::RescaleRenderElement,
}, },
gles::GlesTexture, gles::GlesTexture,
glow::GlowRenderer, glow::GlowRenderer,
utils::{DamageSet, OpaqueRegions}, utils::{DamageSet, OpaqueRegions},
ImportAll, ImportMem, Renderer,
}, },
desktop::{layer_map_for_output, space::SpaceElement, WindowSurfaceType}, desktop::{WindowSurfaceType, layer_map_for_output, space::SpaceElement},
input::Seat, input::Seat,
output::Output, output::Output,
reexports::wayland_server::Client, reexports::wayland_server::Client,
@ -54,18 +54,18 @@ use std::{
use wayland_backend::server::ClientId; use wayland_backend::server::ClientId;
use super::{ use super::{
CosmicMappedRenderElement, CosmicSurface, ResizeDirection, ResizeMode,
element::{ element::{
resize_indicator::ResizeIndicator, stack::CosmicStackRenderElement, CosmicMapped, MaximizedState, resize_indicator::ResizeIndicator,
swap_indicator::SwapIndicator, window::CosmicWindowRenderElement, CosmicMapped, stack::CosmicStackRenderElement, swap_indicator::SwapIndicator,
MaximizedState, window::CosmicWindowRenderElement,
}, },
focus::{ focus::{
target::{KeyboardFocusTarget, PointerFocusTarget, WindowGroup},
FocusStack, FocusStackMut, FocusStack, FocusStackMut,
target::{KeyboardFocusTarget, PointerFocusTarget, WindowGroup},
}, },
grabs::ResizeEdge, grabs::ResizeEdge,
layout::tiling::{Data, NodeDesc}, layout::tiling::{Data, NodeDesc},
CosmicMappedRenderElement, CosmicSurface, ResizeDirection, ResizeMode,
}; };
const FULLSCREEN_ANIMATION_DURATION: Duration = Duration::from_millis(200); const FULLSCREEN_ANIMATION_DURATION: Duration = Duration::from_millis(200);

View file

@ -2,18 +2,19 @@ use std::{sync::Mutex, time::Instant};
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::{ use cosmic::{
iced::{alignment::Vertical, Alignment, Background, Border, Length}, Apply,
iced::{Alignment, Background, Border, Length, alignment::Vertical},
iced_widget, theme, iced_widget, theme,
widget::{self, icon::Named}, widget::{self, icon::Named},
Apply,
}; };
use cosmic_comp_config::ZoomMovement; use cosmic_comp_config::ZoomMovement;
use cosmic_config::ConfigSet; use cosmic_config::ConfigSet;
use keyframe::{ease, functions::EaseInOutCubic}; use keyframe::{ease, functions::EaseInOutCubic};
use smithay::{ use smithay::{
backend::renderer::{element::AsRenderElements, ImportMem, Renderer}, backend::renderer::{ImportMem, Renderer, element::AsRenderElements},
desktop::space::SpaceElement, desktop::space::SpaceElement,
input::{ input::{
Seat,
pointer::{ pointer::{
AxisFrame, ButtonEvent, Focus, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, Focus, GestureHoldBeginEvent, GestureHoldEndEvent,
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent, GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
@ -24,7 +25,6 @@ use smithay::{
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget, DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
UpEvent, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
utils::{IsAlive, Point, Rectangle, Serial, Size}, utils::{IsAlive, Point, Rectangle, Serial, Size},
@ -42,10 +42,9 @@ use crate::{
}; };
use super::{ use super::{
check_grab_preconditions, ANIMATION_DURATION, check_grab_preconditions,
focus::target::PointerFocusTarget, focus::target::PointerFocusTarget,
grabs::{ContextMenu, Item, MenuAlignment, MenuGrab}, grabs::{ContextMenu, Item, MenuAlignment, MenuGrab},
ANIMATION_DURATION,
}; };
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -8,8 +8,8 @@ use crate::{
x11::X11State, x11::X11State,
}, },
config::{CompOutputConfig, Config, ScreenFilter}, config::{CompOutputConfig, Config, ScreenFilter},
input::{gestures::GestureState, PointerFocusState}, input::{PointerFocusState, gestures::GestureState},
shell::{grabs::SeatMoveGrabState, CosmicSurface, SeatExt, Shell}, shell::{CosmicSurface, SeatExt, Shell, grabs::SeatMoveGrabState},
utils::prelude::OutputExt, utils::prelude::OutputExt,
wayland::{ wayland::{
handlers::{data_device::get_dnd_icon, screencopy::SessionHolder}, handlers::{data_device::get_dnd_icon, screencopy::SessionHolder},
@ -34,41 +34,40 @@ use anyhow::Context;
use calloop::RegistrationToken; use calloop::RegistrationToken;
use cosmic_comp_config::output::comp::{OutputConfig, OutputState}; use cosmic_comp_config::output::comp::{OutputConfig, OutputState};
use i18n_embed::{ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DesktopLanguageRequester, DesktopLanguageRequester,
fluent::{FluentLanguageLoader, fluent_language_loader},
}; };
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{dmabuf::Dmabuf, Fourcc}, allocator::{Fourcc, dmabuf::Dmabuf},
drm::DrmNode, drm::DrmNode,
renderer::{ renderer::{
element::{
default_primary_scanout_output_compare, utils::select_dmabuf_feedback,
RenderElementState, RenderElementStates,
},
ImportDma, ImportDma,
element::{
RenderElementState, RenderElementStates, default_primary_scanout_output_compare,
utils::select_dmabuf_feedback,
},
}, },
}, },
desktop::{ desktop::{
layer_map_for_output, PopupManager, layer_map_for_output,
utils::{ utils::{
send_dmabuf_feedback_surface_tree, send_frames_surface_tree, send_dmabuf_feedback_surface_tree, send_frames_surface_tree,
surface_primary_scanout_output, update_surface_primary_scanout_output, surface_primary_scanout_output, update_surface_primary_scanout_output,
with_surfaces_surface_tree, with_surfaces_surface_tree,
}, },
PopupManager,
}, },
input::{pointer::CursorImageStatus, SeatState}, input::{SeatState, pointer::CursorImageStatus},
output::{Output, Scale, WeakOutput}, output::{Output, Scale, WeakOutput},
reexports::{ reexports::{
calloop::{LoopHandle, LoopSignal}, calloop::{LoopHandle, LoopSignal},
wayland_protocols::xdg::shell::server::xdg_toplevel::WmCapabilities, wayland_protocols::xdg::shell::server::xdg_toplevel::WmCapabilities,
wayland_protocols_misc::server_decoration::server::org_kde_kwin_server_decoration_manager::Mode, wayland_protocols_misc::server_decoration::server::org_kde_kwin_server_decoration_manager::Mode,
wayland_server::{ wayland_server::{
Client, DisplayHandle, Resource,
backend::{ClientData, ClientId, DisconnectReason}, backend::{ClientData, ClientId, DisconnectReason},
protocol::{wl_shm, wl_surface::WlSurface}, protocol::{wl_shm, wl_surface::WlSurface},
Client, DisplayHandle, Resource,
}, },
}, },
utils::{Clock, Monotonic, Point}, utils::{Clock, Monotonic, Point},
@ -77,7 +76,7 @@ use smithay::{
compositor::{CompositorClientState, CompositorState, SurfaceData}, compositor::{CompositorClientState, CompositorState, SurfaceData},
cursor_shape::CursorShapeManagerState, cursor_shape::CursorShapeManagerState,
dmabuf::{DmabufFeedback, DmabufGlobal, DmabufState}, dmabuf::{DmabufFeedback, DmabufGlobal, DmabufState},
fractional_scale::{with_fractional_scale, FractionalScaleManagerState}, fractional_scale::{FractionalScaleManagerState, with_fractional_scale},
idle_inhibit::IdleInhibitManagerState, idle_inhibit::IdleInhibitManagerState,
idle_notify::IdleNotifierState, idle_notify::IdleNotifierState,
input_method::InputMethodManagerState, input_method::InputMethodManagerState,
@ -96,7 +95,7 @@ use smithay::{
shell::{ shell::{
kde::decoration::KdeDecorationState, kde::decoration::KdeDecorationState,
wlr_layer::WlrLayerShellState, wlr_layer::WlrLayerShellState,
xdg::{decoration::XdgDecorationState, XdgShellState}, xdg::{XdgShellState, decoration::XdgDecorationState},
}, },
shm::ShmState, shm::ShmState,
single_pixel_buffer::SinglePixelBufferState, single_pixel_buffer::SinglePixelBufferState,
@ -122,7 +121,7 @@ use std::{
collections::HashSet, collections::HashSet,
ffi::OsString, ffi::OsString,
process::Child, process::Child,
sync::{atomic::AtomicBool, Arc, LazyLock, Once}, sync::{Arc, LazyLock, Once, atomic::AtomicBool},
time::{Duration, Instant}, time::{Duration, Instant},
}; };

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::state::Common; use crate::state::Common;
use libsystemd::daemon::{booted, notify, NotifyState}; use libsystemd::daemon::{NotifyState, booted, notify};
use std::process::Command; use std::process::Command;
use tracing::{error, warn}; use tracing::{error, warn};

View file

@ -3,7 +3,7 @@
// update a Arc<Mutex<Theme>> in the state on change of the theme and mark all interfaces for a redraw. // update a Arc<Mutex<Theme>> in the state on change of the theme and mark all interfaces for a redraw.
use calloop::LoopHandle; use calloop::LoopHandle;
use cosmic::cosmic_theme::{palette, Theme, ThemeMode}; use cosmic::cosmic_theme::{Theme, ThemeMode, palette};
use crate::state::State; use crate::state::State;

View file

@ -2,11 +2,13 @@ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
fmt, fmt,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
sync::{mpsc::Receiver, Arc, LazyLock, Mutex}, sync::{Arc, LazyLock, Mutex, mpsc::Receiver},
}; };
use cosmic::{ use cosmic::{
Theme,
iced::{ iced::{
Limits, Point as IcedPoint, Size as IcedSize, Task,
advanced::{graphics::text::font_system, widget::Tree}, advanced::{graphics::text::font_system, widget::Tree},
event::Event, event::Event,
futures::{FutureExt, StreamExt}, futures::{FutureExt, StreamExt},
@ -14,19 +16,17 @@ use cosmic::{
mouse::{Button as MouseButton, Cursor, Event as MouseEvent, ScrollDelta}, mouse::{Button as MouseButton, Cursor, Event as MouseEvent, ScrollDelta},
touch::{Event as TouchEvent, Finger}, touch::{Event as TouchEvent, Finger},
window::Event as WindowEvent, window::Event as WindowEvent,
Limits, Point as IcedPoint, Size as IcedSize, Task,
}, },
iced_core::{clipboard::Null as NullClipboard, id::Id, renderer::Style, Color, Length, Pixels}, iced_core::{Color, Length, Pixels, clipboard::Null as NullClipboard, id::Id, renderer::Style},
iced_runtime::{ iced_runtime::{
Action, Debug,
program::{Program as IcedProgram, State}, program::{Program as IcedProgram, State},
task::into_stream, task::into_stream,
Action, Debug,
}, },
Theme,
}; };
use iced_tiny_skia::{ use iced_tiny_skia::{
graphics::{damage, Viewport},
Layer, Layer,
graphics::{Viewport, damage},
}; };
use ordered_float::OrderedFloat; use ordered_float::OrderedFloat;
@ -35,15 +35,16 @@ use smithay::{
allocator::Fourcc, allocator::Fourcc,
input::{ButtonState, KeyState}, input::{ButtonState, KeyState},
renderer::{ renderer::{
element::{
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
AsRenderElements, Kind,
},
ImportMem, Renderer, ImportMem, Renderer,
element::{
AsRenderElements, Kind,
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
},
}, },
}, },
desktop::space::{RenderZindex, SpaceElement}, desktop::space::{RenderZindex, SpaceElement},
input::{ input::{
Seat,
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState}, keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
pointer::{ pointer::{
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent, AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
@ -55,11 +56,10 @@ use smithay::{
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget, DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
UpEvent, UpEvent,
}, },
Seat,
}, },
output::Output, output::Output,
reexports::calloop::RegistrationToken, reexports::calloop::RegistrationToken,
reexports::calloop::{self, futures::Scheduler, LoopHandle}, reexports::calloop::{self, LoopHandle, futures::Scheduler},
utils::{ utils::{
Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size, Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial, Size,
Transform, Transform,

View file

@ -14,8 +14,8 @@ use crate::{config::EdidProduct, shell::zoom::OutputZoomState};
use std::{ use std::{
cell::{Ref, RefCell, RefMut}, cell::{Ref, RefCell, RefMut},
sync::{ sync::{
atomic::{AtomicU8, Ordering},
Mutex, Mutex,
atomic::{AtomicU8, Ordering},
}, },
}; };

View file

@ -1,4 +1,4 @@
use rustix::process::{getrlimit, setrlimit, Resource, Rlimit}; use rustix::process::{Resource, Rlimit, getrlimit, setrlimit};
use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::atomic::{AtomicU64, Ordering};
static OLD_LIMIT: AtomicU64 = AtomicU64::new(0); static OLD_LIMIT: AtomicU64 = AtomicU64::new(0);

View file

@ -3,10 +3,10 @@ use smithay::{
backend::{ backend::{
allocator::Fourcc, allocator::Fourcc,
renderer::{ renderer::{
damage::OutputDamageTracker,
element::{surface::WaylandSurfaceRenderElement, AsRenderElements},
gles::GlesRenderbuffer,
ExportMem, ImportAll, Offscreen, Renderer, ExportMem, ImportAll, Offscreen, Renderer,
damage::OutputDamageTracker,
element::{AsRenderElements, surface::WaylandSurfaceRenderElement},
gles::GlesRenderbuffer,
}, },
}, },
desktop::utils::bbox_from_surface_tree, desktop::utils::bbox_from_surface_tree,
@ -18,7 +18,7 @@ use tracing::warn;
use crate::{ use crate::{
backend::render::RendererRef, backend::render::RendererRef,
shell::element::CosmicSurface, shell::element::CosmicSurface,
state::{advertised_node_for_surface, State}, state::{State, advertised_node_for_surface},
}; };
pub fn screenshot_window(state: &mut State, surface: &CosmicSurface) { pub fn screenshot_window(state: &mut State, surface: &CosmicSurface) {

View file

@ -1,4 +1,4 @@
use keyframe::{num_traits::Float, CanTween}; use keyframe::{CanTween, num_traits::Float};
use smithay::utils::{Coordinate, Point, Rectangle, Size}; use smithay::utils::{Coordinate, Point, Rectangle, Size};
pub struct EasePoint<N: Coordinate, Kind>(pub Point<N, Kind>); pub struct EasePoint<N: Coordinate, Kind>(pub Point<N, Kind>);

View file

@ -3,7 +3,7 @@ use tracing::warn;
use crate::{ use crate::{
config::ColorFilter, config::ColorFilter,
state::State, state::State,
wayland::protocols::a11y::{delegate_a11y, A11yHandler, A11yState}, wayland::protocols::a11y::{A11yHandler, A11yState, delegate_a11y},
}; };
impl A11yHandler for State { impl A11yHandler for State {

View file

@ -22,7 +22,7 @@ use xkbcommon::xkb;
use crate::{ use crate::{
state::State, state::State,
wayland::protocols::atspi::{delegate_atspi, AtspiHandler}, wayland::protocols::atspi::{AtspiHandler, delegate_atspi},
}; };
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug)]

View file

@ -2,7 +2,7 @@
use crate::state::{BackendData, State}; use crate::state::{BackendData, State};
use smithay::{ use smithay::{
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource}, reexports::wayland_server::{Resource, protocol::wl_buffer::WlBuffer},
wayland::buffer::BufferHandler, wayland::buffer::BufferHandler,
}; };
use tracing::warn; use tracing::warn;

View file

@ -4,18 +4,18 @@ use crate::{shell::grabs::SeatMoveGrabState, state::ClientState, utils::prelude:
use calloop::Interest; use calloop::Interest;
use smithay::{ use smithay::{
backend::renderer::{ backend::renderer::{
element::{surface::KindEvaluation, Kind}, element::{Kind, surface::KindEvaluation},
utils::{on_commit_buffer_handler, with_renderer_surface_state}, utils::{on_commit_buffer_handler, with_renderer_surface_state},
}, },
delegate_compositor, delegate_compositor,
desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurfaceType}, desktop::{LayerSurface, PopupKind, WindowSurfaceType, layer_map_for_output},
reexports::wayland_server::{protocol::wl_surface::WlSurface, Client, Resource}, reexports::wayland_server::{Client, Resource, protocol::wl_surface::WlSurface},
utils::{Clock, Logical, Monotonic, Size, Time, SERIAL_COUNTER}, utils::{Clock, Logical, Monotonic, SERIAL_COUNTER, Size, Time},
wayland::{ wayland::{
compositor::{ compositor::{
add_blocker, add_post_commit_hook, add_pre_commit_hook, with_states, BufferAssignment, CompositorClientState, CompositorHandler, CompositorState,
with_surface_tree_downward, BufferAssignment, CompositorClientState, CompositorHandler, SurfaceAttributes, SurfaceData, TraversalAction, add_blocker, add_post_commit_hook,
CompositorState, SurfaceAttributes, SurfaceData, TraversalAction, add_pre_commit_hook, with_states, with_surface_tree_downward,
}, },
dmabuf::get_dmabuf, dmabuf::get_dmabuf,
drm_syncobj::DrmSyncobjCachedState, drm_syncobj::DrmSyncobjCachedState,

View file

@ -1,7 +1,7 @@
use cosmic_protocols::corner_radius::v1::server::cosmic_corner_radius_toplevel_v1; use cosmic_protocols::corner_radius::v1::server::cosmic_corner_radius_toplevel_v1;
use crate::wayland::protocols::corner_radius::{ use crate::wayland::protocols::corner_radius::{
delegate_corner_radius, CornerRadiusData, CornerRadiusHandler, CornerRadiusState, CornerRadiusData, CornerRadiusHandler, CornerRadiusState, delegate_corner_radius,
}; };
use crate::state::State; use crate::state::State;

View file

@ -4,8 +4,8 @@ use crate::{state::State, utils::prelude::SeatExt};
use smithay::{ use smithay::{
delegate_data_device, delegate_data_device,
input::{ input::{
pointer::{CursorImageStatus, CursorImageSurfaceData},
Seat, Seat,
pointer::{CursorImageStatus, CursorImageSurfaceData},
}, },
reexports::wayland_server::protocol::{wl_data_source::WlDataSource, wl_surface::WlSurface}, reexports::wayland_server::protocol::{wl_data_source::WlDataSource, wl_surface::WlSurface},
utils::{IsAlive, Logical, Point}, utils::{IsAlive, Logical, Point},

View file

@ -15,7 +15,7 @@ use smithay::{
seat::WaylandFocus, seat::WaylandFocus,
shell::{ shell::{
kde::decoration::{KdeDecorationHandler, KdeDecorationState}, kde::decoration::{KdeDecorationHandler, KdeDecorationState},
xdg::{decoration::XdgDecorationHandler, ToplevelSurface}, xdg::{ToplevelSurface, decoration::XdgDecorationHandler},
}, },
}, },
}; };

View file

@ -2,11 +2,11 @@
use crate::{ use crate::{
state::{BackendData, State}, state::{BackendData, State},
wayland::protocols::drm::{delegate_wl_drm, DrmHandler, ImportError}, wayland::protocols::drm::{DrmHandler, ImportError, delegate_wl_drm},
}; };
use smithay::{ use smithay::{
backend::{allocator::dmabuf::Dmabuf, drm::DrmNode}, backend::{allocator::dmabuf::Dmabuf, drm::DrmNode},
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource}, reexports::wayland_server::{Resource, protocol::wl_buffer::WlBuffer},
wayland::dmabuf::DmabufGlobal, wayland::dmabuf::DmabufGlobal,
}; };
use tracing::warn; use tracing::warn;

View file

@ -5,7 +5,7 @@ use smithay::{
reexports::wayland_server::protocol::wl_surface::WlSurface, reexports::wayland_server::protocol::wl_surface::WlSurface,
wayland::{ wayland::{
compositor::{get_parent, with_states}, compositor::{get_parent, with_states},
fractional_scale::{with_fractional_scale, FractionalScaleHandler}, fractional_scale::{FractionalScaleHandler, with_fractional_scale},
}, },
}; };

View file

@ -3,7 +3,7 @@
use crate::state::State; use crate::state::State;
use smithay::{ use smithay::{
delegate_input_method_manager, delegate_input_method_manager,
desktop::{space::SpaceElement, PopupKind, PopupManager}, desktop::{PopupKind, PopupManager, space::SpaceElement},
reexports::wayland_server::protocol::wl_surface::WlSurface, reexports::wayland_server::protocol::wl_surface::WlSurface,
utils::Rectangle, utils::Rectangle,
wayland::input_method::{InputMethodHandler, PopupSurface}, wayland::input_method::{InputMethodHandler, PopupSurface},

View file

@ -3,7 +3,7 @@
use crate::{shell::PendingLayer, utils::prelude::*}; use crate::{shell::PendingLayer, utils::prelude::*};
use smithay::{ use smithay::{
delegate_layer_shell, delegate_layer_shell,
desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurfaceType}, desktop::{LayerSurface, PopupKind, WindowSurfaceType, layer_map_for_output},
output::Output, output::Output,
reexports::wayland_server::protocol::wl_output::WlOutput, reexports::wayland_server::protocol::wl_output::WlOutput,
wayland::shell::{ wayland::shell::{

View file

@ -8,8 +8,8 @@ use crate::{
state::State, state::State,
utils::prelude::OutputExt, utils::prelude::OutputExt,
wayland::protocols::output_configuration::{ wayland::protocols::output_configuration::{
delegate_output_configuration, ModeConfiguration, OutputConfiguration, ModeConfiguration, OutputConfiguration, OutputConfigurationHandler,
OutputConfigurationHandler, OutputConfigurationState, OutputConfigurationState, delegate_output_configuration,
}, },
}; };

View file

@ -7,7 +7,7 @@ use crate::{
state::{BackendData, State}, state::{BackendData, State},
utils::prelude::OutputExt, utils::prelude::OutputExt,
wayland::protocols::output_power::{ wayland::protocols::output_power::{
delegate_output_power, OutputPowerHandler, OutputPowerState, OutputPowerHandler, OutputPowerState, delegate_output_power,
}, },
}; };

View file

@ -1,5 +1,5 @@
use smithay::{ use smithay::{
desktop::{layer_map_for_output, LayerSurface, WindowSurfaceType}, desktop::{LayerSurface, WindowSurfaceType, layer_map_for_output},
output::Output, output::Output,
reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_surface_v1::ZwlrLayerSurfaceV1, reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_surface_v1::ZwlrLayerSurfaceV1,
}; };
@ -7,7 +7,7 @@ use smithay::{
use crate::{ use crate::{
state::State, state::State,
wayland::protocols::overlap_notify::{ wayland::protocols::overlap_notify::{
delegate_overlap_notify, OverlapNotifyHandler, OverlapNotifyState, OverlapNotifyHandler, OverlapNotifyState, delegate_overlap_notify,
}, },
}; };

View file

@ -7,7 +7,7 @@ use smithay::{
reexports::wayland_server::protocol::wl_surface::WlSurface, reexports::wayland_server::protocol::wl_surface::WlSurface,
utils::{Logical, Point}, utils::{Logical, Point},
wayland::{ wayland::{
pointer_constraints::{with_pointer_constraint, PointerConstraintsHandler}, pointer_constraints::{PointerConstraintsHandler, with_pointer_constraint},
seat::WaylandFocus, seat::WaylandFocus,
}, },
}; };

View file

@ -27,9 +27,8 @@ use crate::{
wayland::protocols::{ wayland::protocols::{
image_capture_source::ImageCaptureSourceData, image_capture_source::ImageCaptureSourceData,
screencopy::{ screencopy::{
delegate_screencopy, BufferConstraints, CursorSession, CursorSessionRef, BufferConstraints, CursorSession, CursorSessionRef, DmabufConstraints, Frame, FrameRef,
DmabufConstraints, Frame, FrameRef, ScreencopyHandler, ScreencopyState, Session, ScreencopyHandler, ScreencopyState, Session, SessionRef, delegate_screencopy,
SessionRef,
}, },
}, },
}; };

View file

@ -1,19 +1,19 @@
use calloop::LoopHandle; use calloop::LoopHandle;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::{dmabuf::Dmabuf, format::get_transparent, Buffer, Fourcc}, allocator::{Buffer, Fourcc, dmabuf::Dmabuf, format::get_transparent},
renderer::{ renderer::{
Bind, Blit, BufferType, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
buffer_dimensions, buffer_type, buffer_dimensions, buffer_type,
damage::{Error as DTError, OutputDamageTracker, RenderOutputResult}, damage::{Error as DTError, OutputDamageTracker, RenderOutputResult},
element::{ element::{
AsRenderElements, RenderElement,
surface::WaylandSurfaceRenderElement, surface::WaylandSurfaceRenderElement,
utils::{Relocate, RelocateRenderElement}, utils::{Relocate, RelocateRenderElement},
AsRenderElements, RenderElement,
}, },
gles::{GlesError, GlesRenderbuffer}, gles::{GlesError, GlesRenderbuffer},
sync::SyncPoint, sync::SyncPoint,
utils::with_renderer_surface_state, utils::with_renderer_surface_state,
Bind, Blit, BufferType, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
}, },
}, },
desktop::space::SpaceElement, desktop::space::SpaceElement,
@ -35,16 +35,16 @@ use tracing::warn;
use crate::{ use crate::{
backend::render::{ backend::render::{
cursor, CursorMode, ElementFilter, RendererRef, cursor,
element::{AsGlowRenderer, CosmicElement, DamageElement, FromGlesError}, element::{AsGlowRenderer, CosmicElement, DamageElement, FromGlesError},
render_workspace, CursorMode, ElementFilter, RendererRef, render_workspace,
}, },
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement}, shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
state::{Common, KmsNodes, State}, state::{Common, KmsNodes, State},
utils::prelude::{PointExt, PointGlobalExt, RectExt, RectLocalExt, SeatExt}, utils::prelude::{PointExt, PointGlobalExt, RectExt, RectLocalExt, SeatExt},
wayland::{ wayland::{
handlers::screencopy::{ handlers::screencopy::{
constraints_for_output, constraints_for_toplevel, SessionData, SessionUserData, SessionData, SessionUserData, constraints_for_output, constraints_for_toplevel,
}, },
protocols::{ protocols::{
screencopy::{BufferConstraints, CursorSessionRef, FailureReason, Frame, SessionRef}, screencopy::{BufferConstraints, CursorSessionRef, FailureReason, Frame, SessionRef},

View file

@ -3,7 +3,7 @@ use std::{cell::RefCell, collections::HashMap, sync::Mutex};
use smithay::{ use smithay::{
backend::renderer::{damage::OutputDamageTracker, utils::CommitCounter}, backend::renderer::{damage::OutputDamageTracker, utils::CommitCounter},
output::Output, output::Output,
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource, Weak}, reexports::wayland_server::{Resource, Weak, protocol::wl_buffer::WlBuffer},
}; };
use crate::{ use crate::{

View file

@ -1,14 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::{ use crate::{
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget},
shell::Devices, shell::Devices,
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget},
state::State, state::State,
utils::prelude::SeatExt, utils::prelude::SeatExt,
}; };
use smithay::{ use smithay::{
delegate_cursor_shape, delegate_seat, delegate_cursor_shape, delegate_seat,
input::{keyboard::LedState, pointer::CursorImageStatus, SeatHandler, SeatState}, input::{SeatHandler, SeatState, keyboard::LedState, pointer::CursorImageStatus},
}; };
impl SeatHandler for State { impl SeatHandler for State {

View file

@ -4,7 +4,7 @@ use crate::{shell::SessionLock, state::State, utils::prelude::*};
use smithay::{ use smithay::{
delegate_session_lock, delegate_session_lock,
output::Output, output::Output,
reexports::wayland_server::{protocol::wl_output::WlOutput, Resource}, reexports::wayland_server::{Resource, protocol::wl_output::WlOutput},
utils::Size, utils::Size,
wayland::session_lock::{ wayland::session_lock::{
LockSurface, SessionLockHandler, SessionLockManagerState, SessionLocker, LockSurface, SessionLockHandler, SessionLockManagerState, SessionLocker,

View file

@ -1,13 +1,13 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::utils::{user_data::UserDataMap, Rectangle}; use smithay::utils::{Rectangle, user_data::UserDataMap};
use crate::{ use crate::{
shell::CosmicSurface, shell::CosmicSurface,
state::State, state::State,
utils::prelude::Global, utils::prelude::Global,
wayland::protocols::toplevel_info::{ wayland::protocols::toplevel_info::{
delegate_toplevel_info, ToplevelInfoHandler, ToplevelInfoState, Window, ToplevelInfoHandler, ToplevelInfoState, Window, delegate_toplevel_info,
}, },
}; };

View file

@ -1,22 +1,22 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::{ use smithay::{
desktop::{layer_map_for_output, WindowSurfaceType}, desktop::{WindowSurfaceType, layer_map_for_output},
input::{pointer::MotionEvent, Seat}, input::{Seat, pointer::MotionEvent},
output::Output, output::Output,
reexports::wayland_server::DisplayHandle, reexports::wayland_server::DisplayHandle,
utils::{Point, Rectangle, Size, SERIAL_COUNTER}, utils::{Point, Rectangle, SERIAL_COUNTER, Size},
wayland::seat::WaylandFocus, wayland::seat::WaylandFocus,
}; };
use crate::{ use crate::{
shell::{focus::target::KeyboardFocusTarget, CosmicSurface, Shell, WorkspaceDelta}, shell::{CosmicSurface, Shell, WorkspaceDelta, focus::target::KeyboardFocusTarget},
utils::prelude::*, utils::prelude::*,
wayland::protocols::{ wayland::protocols::{
toplevel_info::ToplevelInfoHandler, toplevel_info::ToplevelInfoHandler,
toplevel_management::{ toplevel_management::{
delegate_toplevel_management, toplevel_rectangle_for, ManagementWindow, ManagementWindow, ToplevelManagementHandler, ToplevelManagementState,
ToplevelManagementHandler, ToplevelManagementState, delegate_toplevel_management, toplevel_rectangle_for,
}, },
workspace::WorkspaceHandle, workspace::WorkspaceHandle,
}, },

View file

@ -4,7 +4,7 @@ use crate::{
shell::WorkspaceDelta, shell::WorkspaceDelta,
utils::prelude::*, utils::prelude::*,
wayland::protocols::workspace::{ wayland::protocols::workspace::{
delegate_workspace, Request, State as WState, WorkspaceHandler, WorkspaceState, Request, State as WState, WorkspaceHandler, WorkspaceState, delegate_workspace,
}, },
}; };
use cosmic_protocols::workspace::v2::server::zcosmic_workspace_handle_v2::TilingState; use cosmic_protocols::workspace::v2::server::zcosmic_workspace_handle_v2::TilingState;

View file

@ -1,5 +1,5 @@
use crate::shell::focus::target::KeyboardFocusTarget;
use crate::shell::WorkspaceDelta; use crate::shell::WorkspaceDelta;
use crate::shell::focus::target::KeyboardFocusTarget;
use crate::{shell::ActivationKey, state::ClientState, utils::prelude::*}; use crate::{shell::ActivationKey, state::ClientState, utils::prelude::*};
use crate::{ use crate::{
state::State, state::State,

View file

@ -1,17 +1,17 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use crate::{ use crate::{
shell::{focus::target::KeyboardFocusTarget, grabs::ReleaseMode, CosmicSurface, PendingWindow}, shell::{CosmicSurface, PendingWindow, focus::target::KeyboardFocusTarget, grabs::ReleaseMode},
utils::prelude::*, utils::prelude::*,
}; };
use smithay::desktop::layer_map_for_output; use smithay::desktop::layer_map_for_output;
use smithay::{ use smithay::{
delegate_xdg_shell, delegate_xdg_shell,
desktop::{ desktop::{
find_popup_root_surface, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupUngrabStrategy,
PopupUngrabStrategy, WindowSurfaceType, WindowSurfaceType, find_popup_root_surface,
}, },
input::{pointer::Focus, Seat}, input::{Seat, pointer::Focus},
output::Output, output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel, wayland_protocols::xdg::shell::server::xdg_toplevel,

View file

@ -3,8 +3,8 @@
use crate::{shell::Shell, utils::prelude::*}; use crate::{shell::Shell, utils::prelude::*};
use smithay::{ use smithay::{
desktop::{ desktop::{
get_popup_toplevel_coords, layer_map_for_output, space::SpaceElement, LayerSurface, LayerSurface, PopupKind, PopupManager, WindowSurfaceType, get_popup_toplevel_coords,
PopupKind, PopupManager, WindowSurfaceType, layer_map_for_output, space::SpaceElement,
}, },
output::Output, output::Output,
reexports::{ reexports::{
@ -15,7 +15,7 @@ use smithay::{
wayland::{ wayland::{
compositor::{get_role, with_states}, compositor::{get_role, with_states},
seat::WaylandFocus, seat::WaylandFocus,
shell::xdg::{PopupSurface, ToplevelSurface, XdgPopupSurfaceData, XDG_POPUP_ROLE}, shell::xdg::{PopupSurface, ToplevelSurface, XDG_POPUP_ROLE, XdgPopupSurfaceData},
}, },
}; };
use tracing::warn; use tracing::warn;

View file

@ -4,7 +4,7 @@ use crate::{shell::focus::target::KeyboardFocusTarget, state::State};
use smithay::{ use smithay::{
delegate_xwayland_keyboard_grab, delegate_xwayland_keyboard_grab,
input::Seat, input::Seat,
reexports::wayland_server::{protocol::wl_surface::WlSurface, Resource}, reexports::wayland_server::{Resource, protocol::wl_surface::WlSurface},
wayland::xwayland_keyboard_grab::{XWaylandKeyboardGrab, XWaylandKeyboardGrabHandler}, wayland::xwayland_keyboard_grab::{XWaylandKeyboardGrab, XWaylandKeyboardGrabHandler},
}; };
use std::sync::Mutex; use std::sync::Mutex;

View file

@ -5,7 +5,7 @@ use cosmic_protocols::atspi::v1::server::cosmic_atspi_manager_v1;
use smithay::{ use smithay::{
backend::input::Keycode, backend::input::Keycode,
reexports::wayland_server::{ reexports::wayland_server::{
backend::GlobalId, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, backend::GlobalId,
}, },
}; };
use std::os::unix::{io::AsFd, net::UnixStream}; use std::os::unix::{io::AsFd, net::UnixStream};

View file

@ -3,9 +3,9 @@ use cosmic_protocols::corner_radius::v1::server::{
cosmic_corner_radius_manager_v1, cosmic_corner_radius_toplevel_v1, cosmic_corner_radius_manager_v1, cosmic_corner_radius_toplevel_v1,
}; };
use smithay::utils::HookId; use smithay::utils::HookId;
use smithay::wayland::compositor::Cacheable;
use smithay::wayland::compositor::add_pre_commit_hook; use smithay::wayland::compositor::add_pre_commit_hook;
use smithay::wayland::compositor::with_states; use smithay::wayland::compositor::with_states;
use smithay::wayland::compositor::Cacheable;
use smithay::wayland::shell::xdg::SurfaceCachedState; use smithay::wayland::shell::xdg::SurfaceCachedState;
use smithay::{ use smithay::{
reexports::{ reexports::{

View file

@ -23,13 +23,13 @@ mod generated {
use smithay::{ use smithay::{
backend::allocator::{ backend::allocator::{
Fourcc, Modifier,
dmabuf::{Dmabuf, DmabufFlags}, dmabuf::{Dmabuf, DmabufFlags},
format::FormatSet, format::FormatSet,
Fourcc, Modifier,
}, },
reexports::wayland_server::{ reexports::wayland_server::{
backend::GlobalId, protocol::wl_buffer::WlBuffer, Client, DataInit, Dispatch, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
DisplayHandle, GlobalDispatch, New, Resource, backend::GlobalId, protocol::wl_buffer::WlBuffer,
}, },
wayland::{ wayland::{
buffer::BufferHandler, buffer::BufferHandler,

View file

@ -12,8 +12,8 @@ use smithay::{
zwlr_output_mode_v1::{self, ZwlrOutputModeV1}, zwlr_output_mode_v1::{self, ZwlrOutputModeV1},
}, },
wayland_server::{ wayland_server::{
backend::ClientId, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
Resource, backend::ClientId,
}, },
}, },
utils::{Point, Size}, utils::{Point, Size},

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use calloop::{ use calloop::{
timer::{TimeoutAction, Timer},
LoopHandle, LoopHandle,
timer::{TimeoutAction, Timer},
}; };
use cosmic_comp_config::output::comp::AdaptiveSync; use cosmic_comp_config::output::comp::AdaptiveSync;
use cosmic_protocols::output_management::v1::server::{ use cosmic_protocols::output_management::v1::server::{
@ -23,8 +23,8 @@ use smithay::{
zwlr_output_mode_v1::ZwlrOutputModeV1, zwlr_output_mode_v1::ZwlrOutputModeV1,
}, },
wayland_server::{ wayland_server::{
backend::GlobalId, protocol::wl_output::WlOutput, Client, Dispatch, DisplayHandle, Client, Dispatch, DisplayHandle, GlobalDispatch, Resource, Weak, backend::GlobalId,
GlobalDispatch, Resource, Weak, protocol::wl_output::WlOutput,
}, },
}, },
utils::{Logical, Physical, Point, Size, Transform}, utils::{Logical, Physical, Point, Size, Transform},

View file

@ -8,8 +8,8 @@ use smithay::{
zwlr_output_power_v1::{self, ZwlrOutputPowerV1}, zwlr_output_power_v1::{self, ZwlrOutputPowerV1},
}, },
wayland_server::{ wayland_server::{
backend::GlobalId, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
Resource, backend::GlobalId,
}, },
}, },
}; };

View file

@ -13,7 +13,7 @@ use cosmic_protocols::{
}, },
}; };
use smithay::{ use smithay::{
desktop::{layer_map_for_output, LayerSurface}, desktop::{LayerSurface, layer_map_for_output},
output::Output, output::Output,
reexports::{ reexports::{
wayland_protocols::ext::foreign_toplevel_list::v1::server::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1, wayland_protocols::ext::foreign_toplevel_list::v1::server::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,

View file

@ -7,12 +7,12 @@ use smithay::{
reexports::{ reexports::{
wayland_protocols::ext::foreign_toplevel_list::v1::server::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1, wayland_protocols::ext::foreign_toplevel_list::v1::server::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1,
wayland_server::{ wayland_server::{
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, Weak,
backend::{ClientId, GlobalId}, backend::{ClientId, GlobalId},
protocol::{wl_output::WlOutput, wl_surface::WlSurface}, protocol::{wl_output::WlOutput, wl_surface::WlSurface},
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, Weak,
}, },
}, },
utils::{user_data::UserDataMap, IsAlive, Logical, Rectangle}, utils::{IsAlive, Logical, Rectangle, user_data::UserDataMap},
wayland::foreign_toplevel_list::{ wayland::foreign_toplevel_list::{
ForeignToplevelHandle, ForeignToplevelListHandler, ForeignToplevelListState, ForeignToplevelHandle, ForeignToplevelListHandler, ForeignToplevelListState,
}, },

View file

@ -4,9 +4,9 @@ use smithay::{
input::{Seat, SeatHandler}, input::{Seat, SeatHandler},
output::Output, output::Output,
reexports::wayland_server::{ reexports::wayland_server::{
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
backend::{ClientId, GlobalId}, backend::{ClientId, GlobalId},
protocol::wl_surface::WlSurface, protocol::wl_surface::WlSurface,
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
}, },
utils::{Logical, Rectangle}, utils::{Logical, Rectangle},
}; };
@ -17,7 +17,7 @@ use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_
}; };
use super::{ use super::{
toplevel_info::{window_from_handle, ToplevelInfoHandler, ToplevelState, Window}, toplevel_info::{ToplevelInfoHandler, ToplevelState, Window, window_from_handle},
workspace::WorkspaceHandle, workspace::WorkspaceHandle,
}; };

View file

@ -11,8 +11,8 @@ use smithay::{
ext_workspace_manager_v1::{self, ExtWorkspaceManagerV1}, ext_workspace_manager_v1::{self, ExtWorkspaceManagerV1},
}, },
wayland_server::{ wayland_server::{
backend::ClientId, protocol::wl_output::WlOutput, Client, DataInit, Dispatch, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, Weak,
DisplayHandle, GlobalDispatch, New, Resource, Weak, backend::ClientId, protocol::wl_output::WlOutput,
}, },
}, },
}; };

View file

@ -9,8 +9,8 @@ use smithay::{
ext_workspace_manager_v1::ExtWorkspaceManagerV1, ext_workspace_manager_v1::ExtWorkspaceManagerV1,
}, },
wayland_server::{ wayland_server::{
backend::{GlobalId, ObjectId},
Client, Dispatch, DisplayHandle, GlobalDispatch, Resource, Client, Dispatch, DisplayHandle, GlobalDispatch, Resource,
backend::{GlobalId, ObjectId},
}, },
}, },
}; };

View file

@ -1,9 +1,9 @@
use std::{ffi::OsString, os::unix::io::OwnedFd, process::Stdio}; use std::{ffi::OsString, os::unix::io::OwnedFd, process::Stdio};
use crate::{ use crate::{
backend::render::cursor::{load_cursor_env, load_cursor_theme, Cursor}, backend::render::cursor::{Cursor, load_cursor_env, load_cursor_theme},
shell::{ shell::{
focus::target::KeyboardFocusTarget, grabs::ReleaseMode, CosmicSurface, PendingWindow, Shell, CosmicSurface, PendingWindow, Shell, focus::target::KeyboardFocusTarget, grabs::ReleaseMode,
}, },
state::State, state::State,
utils::prelude::*, utils::prelude::*,
@ -16,23 +16,24 @@ use smithay::{
drm::DrmNode, drm::DrmNode,
input::{ButtonState, KeyState, Keycode}, input::{ButtonState, KeyState, Keycode},
renderer::{ renderer::{
Bind, Frame, Offscreen, Renderer,
element::{ element::{
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
Kind, Kind,
memory::{MemoryRenderBuffer, MemoryRenderBufferRenderElement},
}, },
pixman::{PixmanError, PixmanRenderer}, pixman::{PixmanError, PixmanRenderer},
utils::draw_render_elements, utils::draw_render_elements,
Bind, Frame, Offscreen, Renderer,
}, },
}, },
desktop::space::SpaceElement, desktop::space::SpaceElement,
input::{keyboard::ModifiersState, pointer::CursorIcon}, input::{keyboard::ModifiersState, pointer::CursorIcon},
reexports::{wayland_server::Client, x11rb::protocol::xproto::Window as X11Window}, reexports::{wayland_server::Client, x11rb::protocol::xproto::Window as X11Window},
utils::{ utils::{
Buffer as BufferCoords, Logical, Point, Rectangle, Serial, Size, Transform, SERIAL_COUNTER, Buffer as BufferCoords, Logical, Point, Rectangle, SERIAL_COUNTER, Serial, Size, Transform,
}, },
wayland::{ wayland::{
selection::{ selection::{
SelectionTarget,
data_device::{ data_device::{
clear_data_device_selection, current_data_device_selection_userdata, clear_data_device_selection, current_data_device_selection_userdata,
request_data_device_client_selection, set_data_device_selection, request_data_device_client_selection, set_data_device_selection,
@ -41,13 +42,12 @@ use smithay::{
clear_primary_selection, current_primary_selection_userdata, clear_primary_selection, current_primary_selection_userdata,
request_primary_client_selection, set_primary_selection, request_primary_client_selection, set_primary_selection,
}, },
SelectionTarget,
}, },
xdg_activation::XdgActivationToken, xdg_activation::XdgActivationToken,
}, },
xwayland::{ xwayland::{
xwm::{Reorder, XwmId},
X11Surface, X11Wm, XWayland, XWaylandClientData, XWaylandEvent, XwmHandler, X11Surface, X11Wm, XWayland, XWaylandClientData, XWaylandEvent, XwmHandler,
xwm::{Reorder, XwmId},
}, },
}; };
use tracing::{error, trace, warn}; use tracing::{error, trace, warn};