Update smithay and wayland-rs

Includes updates for split between `smithay::wayland::output` and
`smithay::output`.
This commit is contained in:
Ian Douglas Scott 2022-09-09 20:00:00 -07:00
parent e1894ef425
commit 7b670afc36
25 changed files with 139 additions and 141 deletions

87
Cargo.lock generated
View file

@ -322,10 +322,10 @@ dependencies = [
"smithay-egui", "smithay-egui",
"thiserror", "thiserror",
"wayland-backend", "wayland-backend",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
"xcursor", "xcursor",
"xdg", "xdg",
"xkbcommon", "xkbcommon 0.4.1",
] ]
[[package]] [[package]]
@ -335,8 +335,8 @@ source = "git+https://github.com/pop-os/cosmic-protocols?branch=main#3ff11df30ef
dependencies = [ dependencies = [
"bitflags", "bitflags",
"wayland-backend", "wayland-backend",
"wayland-protocols 0.30.0-beta.8", "wayland-protocols 0.30.0-beta.9",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
"wayland-server", "wayland-server",
] ]
@ -1220,6 +1220,15 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "quick-xml"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9279fbdacaad3baf559d8cabe0acc3d06e30ea14931af31af79578ac0946decc"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.21"
@ -1492,7 +1501,7 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]] [[package]]
name = "smithay" name = "smithay"
version = "0.3.0" version = "0.3.0"
source = "git+https://github.com/Smithay//smithay?rev=6e6f1f4d#6e6f1f4d2969d10d1dc6f922f28bdd6977b3ac32" source = "git+https://github.com/Smithay//smithay?rev=355513d3#355513d3f675dbf5c61196cd98f5134bba53582c"
dependencies = [ dependencies = [
"appendlist", "appendlist",
"bitflags", "bitflags",
@ -1521,14 +1530,14 @@ dependencies = [
"udev", "udev",
"wayland-backend", "wayland-backend",
"wayland-egl", "wayland-egl",
"wayland-protocols 0.30.0-beta.8", "wayland-protocols 0.30.0-beta.9",
"wayland-protocols-misc", "wayland-protocols-misc",
"wayland-protocols-wlr", "wayland-protocols-wlr",
"wayland-server", "wayland-server",
"wayland-sys 0.30.0-beta.8", "wayland-sys 0.30.0-beta.9",
"winit", "winit",
"x11rb", "x11rb",
"xkbcommon", "xkbcommon 0.5.0",
] ]
[[package]] [[package]]
@ -1561,7 +1570,7 @@ dependencies = [
"memoffset", "memoffset",
"slog", "slog",
"smithay", "smithay",
"xkbcommon", "xkbcommon 0.4.1",
] ]
[[package]] [[package]]
@ -1792,16 +1801,16 @@ checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
[[package]] [[package]]
name = "wayland-backend" name = "wayland-backend"
version = "0.1.0-beta.8" version = "0.1.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee8e77c63b0cdc68bfc7b407b862b0fe2718949ce060b32d4f94ef1ea9607a4" checksum = "7d83397002f3bec4c8d8f0c4dd1cc4ce564e7aaf00615b6473185318011a827a"
dependencies = [ dependencies = [
"cc", "cc",
"downcast-rs", "downcast-rs",
"nix 0.24.2", "nix 0.24.2",
"scoped-tls", "scoped-tls",
"smallvec", "smallvec",
"wayland-sys 0.30.0-beta.8", "wayland-sys 0.30.0-beta.9",
] ]
[[package]] [[package]]
@ -1845,13 +1854,13 @@ dependencies = [
[[package]] [[package]]
name = "wayland-egl" name = "wayland-egl"
version = "0.30.0-beta.8" version = "0.30.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0c476ffaaea6f046c976d2ffd48c0bda72fba50a701d82f28651be9fab8e99a" checksum = "393d480911d3021abf6828dc09926c975a417133874dcbdbf7a6e3b4c047b4a4"
dependencies = [ dependencies = [
"thiserror", "thiserror",
"wayland-backend", "wayland-backend",
"wayland-sys 0.30.0-beta.8", "wayland-sys 0.30.0-beta.9",
] ]
[[package]] [[package]]
@ -1868,39 +1877,39 @@ dependencies = [
[[package]] [[package]]
name = "wayland-protocols" name = "wayland-protocols"
version = "0.30.0-beta.8" version = "0.30.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e47c45a60d531d5a513601f47f51a4743901836778ddae208ae9124606be1719" checksum = "13c411b907898bbb0b589b4d9768cba34f899ca9003dd008497933b0e71b272c"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"wayland-backend", "wayland-backend",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
"wayland-server", "wayland-server",
] ]
[[package]] [[package]]
name = "wayland-protocols-misc" name = "wayland-protocols-misc"
version = "0.1.0-beta.8" version = "0.1.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b660ecc6e9709a438d9e227eedbea31d6c551672ff75eec90eeef0447c8ecc7c" checksum = "555dfad2cecb2ef227a25ba96f64f044e5161d127faf1d95515ca96d60cacfc9"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"wayland-backend", "wayland-backend",
"wayland-protocols 0.30.0-beta.8", "wayland-protocols 0.30.0-beta.9",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
"wayland-server", "wayland-server",
] ]
[[package]] [[package]]
name = "wayland-protocols-wlr" name = "wayland-protocols-wlr"
version = "0.1.0-beta.8" version = "0.1.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b477d16e0c1d7512f11799403c8dbb1964e756667208569ec0ea2bd1abbccb" checksum = "256b26eecbd27bd190bbed648034d7244f89e4186d9d2b436fb03b678ac29996"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"wayland-backend", "wayland-backend",
"wayland-protocols 0.30.0-beta.8", "wayland-protocols 0.30.0-beta.9",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
"wayland-server", "wayland-server",
] ]
@ -1917,28 +1926,28 @@ dependencies = [
[[package]] [[package]]
name = "wayland-scanner" name = "wayland-scanner"
version = "0.30.0-beta.8" version = "0.30.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87933ccc3df4f6335cf240aca0647aa34319fdd693dda503f645ca4df4e10386" checksum = "4f5f5b0892a8a2dcd51d65ec843cd9350d407eae476ebbf10ff35650f510f761"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quick-xml",
"quote", "quote",
"syn", "syn",
"xml-rs",
] ]
[[package]] [[package]]
name = "wayland-server" name = "wayland-server"
version = "0.30.0-beta.8" version = "0.30.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b41683fd43b57d7ab2a2d5cc60acecea2cd8feca8514857088fba1721a568819" checksum = "09f4aebf7374a9bcadb01631dc5f80e8b0b6c4d6adfe60227b54905d7adfaa01"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"downcast-rs", "downcast-rs",
"nix 0.24.2", "nix 0.24.2",
"thiserror", "thiserror",
"wayland-backend", "wayland-backend",
"wayland-scanner 0.30.0-beta.8", "wayland-scanner 0.30.0-beta.9",
] ]
[[package]] [[package]]
@ -1954,9 +1963,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-sys" name = "wayland-sys"
version = "0.30.0-beta.8" version = "0.30.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "beca223ed017df1b356ff181d4d6e7f2b135418c4888df5bb02df7a563f02ab0" checksum = "efcfeb926ec16a184f83b98c3f9d9d76699035ebb229740377724e10993926ef"
dependencies = [ dependencies = [
"dlib", "dlib",
"libc", "libc",
@ -2141,6 +2150,16 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "xkbcommon"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbee136714379ab22da0280207fdb7f47e0bb940adea97731b65598b8c7a92e"
dependencies = [
"libc",
"memmap2",
]
[[package]] [[package]]
name = "xml-rs" name = "xml-rs"
version = "0.8.4" version = "0.8.4"

View file

@ -30,8 +30,8 @@ xdg = "^2.1"
ron = "0.7" ron = "0.7"
atomic_float = "0.1" atomic_float = "0.1"
libsystemd = "0.5" libsystemd = "0.5"
wayland-backend = "=0.1.0-beta.8" wayland-backend = "=0.1.0-beta.9"
wayland-scanner = "=0.30.0-beta.8" wayland-scanner = "=0.30.0-beta.9"
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", branch = "main", default-features = false, features = ["server"] } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", branch = "main", default-features = false, features = ["server"] }
[dependencies.smithay] [dependencies.smithay]
@ -62,4 +62,4 @@ debug = true
lto = "fat" lto = "fat"
[patch."https://github.com/Smithay/smithay.git"] [patch."https://github.com/Smithay/smithay.git"]
smithay = { git = "https://github.com/Smithay//smithay", rev = "6e6f1f4d" } smithay = { git = "https://github.com/Smithay//smithay", rev = "355513d3" }

View file

@ -27,6 +27,7 @@ use smithay::{
session::{auto::AutoSession, Session, Signal}, session::{auto::AutoSession, Session, Signal},
udev::{all_gpus, primary_gpu, UdevBackend, UdevEvent}, udev::{all_gpus, primary_gpu, UdevBackend, UdevEvent},
}, },
output::{Mode as OutputMode, Output, PhysicalProperties, Subpixel},
reexports::{ reexports::{
calloop::{ calloop::{
timer::{TimeoutAction, Timer}, timer::{TimeoutAction, Timer},
@ -35,19 +36,13 @@ use smithay::{
drm::control::{connector, crtc, Device as ControlDevice, ModeTypeFlags}, drm::control::{connector, crtc, Device as ControlDevice, ModeTypeFlags},
input::Libinput, input::Libinput,
nix::{fcntl::OFlag, sys::stat::dev_t}, nix::{fcntl::OFlag, sys::stat::dev_t},
wayland_server::{ wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle, Resource},
protocol::{wl_output, wl_surface::WlSurface},
DisplayHandle, Resource,
},
}, },
utils::{ utils::{
signaling::{Linkable, SignalToken, Signaler}, signaling::{Linkable, SignalToken, Signaler},
Size, Size, Transform,
},
wayland::{
dmabuf::DmabufGlobal,
output::{Mode as OutputMode, Output, PhysicalProperties},
}, },
wayland::dmabuf::DmabufGlobal,
}; };
use std::{ use std::{
@ -650,7 +645,7 @@ impl Device {
PhysicalProperties { PhysicalProperties {
size: (phys_w as i32, phys_h as i32).into(), size: (phys_w as i32, phys_h as i32).into(),
// TODO: We need to read that from the connector properties // TODO: We need to read that from the connector properties
subpixel: wl_output::Subpixel::Unknown, subpixel: Subpixel::Unknown,
make: edid_info.manufacturer, make: edid_info.manufacturer,
model: edid_info.model, model: edid_info.model,
}, },
@ -668,7 +663,7 @@ impl Device {
output.change_current_state( output.change_current_state(
Some(output_mode), Some(output_mode),
// TODO: Readout property for monitor rotation // TODO: Readout property for monitor rotation
Some(wl_output::Transform::Normal), Some(Transform::Normal),
None, None,
Some(position.into()), Some(position.into()),
); );

View file

@ -29,8 +29,9 @@ use smithay::{
utils::damage_from_surface_tree, utils::damage_from_surface_tree,
Window, Window,
}, },
output::Output,
utils::{Physical, Point, Rectangle, Scale, Transform}, utils::{Physical, Point, Rectangle, Scale, Transform},
wayland::{output::Output, shell::wlr_layer::Layer as WlrLayer}, wayland::shell::wlr_layer::Layer as WlrLayer,
}; };
pub mod cursor; pub mod cursor;

View file

@ -14,14 +14,12 @@ use smithay::{
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},
reexports::{ reexports::{
calloop::{ping, EventLoop}, calloop::{ping, EventLoop},
wayland_server::{ wayland_server::DisplayHandle,
protocol::wl_output::{Subpixel, Transform},
DisplayHandle,
},
}, },
wayland::output::{Mode, Output, PhysicalProperties, Scale}, utils::Transform,
}; };
use std::cell::RefCell; use std::cell::RefCell;

View file

@ -17,15 +17,13 @@ use smithay::{
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},
reexports::{ reexports::{
calloop::{ping, EventLoop, LoopHandle}, calloop::{ping, EventLoop, LoopHandle},
gbm::{Device as GbmDevice, FdWrapper}, gbm::{Device as GbmDevice, FdWrapper},
wayland_server::{ wayland_server::DisplayHandle,
protocol::wl_output::{Subpixel, Transform},
DisplayHandle,
},
}, },
wayland::output::{Mode, Output, PhysicalProperties, Scale}, utils::Transform,
}; };
use std::{ use std::{
cell::RefCell, cell::RefCell,

View file

@ -8,6 +8,7 @@ use serde::{Deserialize, Serialize};
pub use smithay::{ pub use smithay::{
backend::input::KeyState, backend::input::KeyState,
input::keyboard::{keysyms as KeySyms, Keysym, ModifiersState}, input::keyboard::{keysyms as KeySyms, Keysym, ModifiersState},
output::{Mode, Output},
reexports::{ reexports::{
calloop::LoopHandle, calloop::LoopHandle,
input::{ input::{
@ -16,7 +17,6 @@ pub use smithay::{
}, },
}, },
utils::{Logical, Physical, Point, Size, Transform}, utils::{Logical, Physical, Point, Size, Transform},
wayland::output::{Mode, Output},
}; };
use std::{cell::RefCell, collections::HashMap, fs::OpenOptions, path::PathBuf}; use std::{cell::RefCell, collections::HashMap, fs::OpenOptions, path::PathBuf};

View file

@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize};
pub use smithay::{ pub use smithay::{
backend::input::KeyState, backend::input::KeyState,
input::keyboard::{keysyms as KeySyms, Keysym, XkbConfig as WlXkbConfig}, input::keyboard::{keysyms as KeySyms, Keysym, XkbConfig as WlXkbConfig},
output::{Mode, Output},
reexports::input::{AccelProfile, ClickMethod, ScrollMethod, TapButtonMap}, reexports::input::{AccelProfile, ClickMethod, ScrollMethod, TapButtonMap},
utils::{Logical, Physical, Point, Size, Transform}, utils::{Logical, Physical, Point, Size, Transform},
wayland::output::{Mode, Output},
}; };
use xkbcommon::xkb; use xkbcommon::xkb;

View file

@ -17,9 +17,10 @@ use smithay::{
pointer::{AxisFrame, ButtonEvent, CursorImageStatus, MotionEvent}, pointer::{AxisFrame, ButtonEvent, CursorImageStatus, MotionEvent},
Seat, SeatState, Seat, SeatState,
}, },
output::Output,
reexports::wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle}, reexports::wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle},
utils::{Buffer, Logical, Point, Rectangle, Size, SERIAL_COUNTER}, utils::{Buffer, Logical, Point, Rectangle, Size, SERIAL_COUNTER},
wayland::{output::Output, shell::wlr_layer::Layer as WlrLayer}, wayland::shell::wlr_layer::Layer as WlrLayer,
}; };
use std::{cell::RefCell, collections::HashMap}; use std::{cell::RefCell, collections::HashMap};

View file

@ -18,12 +18,12 @@ use smithay::{
}, },
Seat, Seat,
}, },
output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel::State as XdgState, wayland_protocols::xdg::shell::server::xdg_toplevel::State as XdgState,
wayland_server::protocol::wl_surface::WlSurface, wayland_server::protocol::wl_surface::WlSurface,
}, },
utils::{IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial}, utils::{IsAlive, Logical, Physical, Point, Rectangle, Scale, Serial},
wayland::output::Output,
}; };
use std::cell::RefCell; use std::cell::RefCell;

View file

@ -6,13 +6,12 @@ use smithay::{
pointer::{Focus, GrabStartData as PointerGrabStartData}, pointer::{Focus, GrabStartData as PointerGrabStartData},
Seat, Seat,
}, },
output::Output,
reexports::wayland_protocols::xdg::shell::server::xdg_toplevel::{ reexports::wayland_protocols::xdg::shell::server::xdg_toplevel::{
ResizeEdge, State as XdgState, ResizeEdge, State as XdgState,
}, },
utils::{IsAlive, Logical, Point, Rectangle, Serial}, utils::{IsAlive, Logical, Point, Rectangle, Serial},
wayland::{ wayland::{compositor::with_states, shell::xdg::XdgToplevelSurfaceRoleAttributes},
compositor::with_states, output::Output, shell::xdg::XdgToplevelSurfaceRoleAttributes,
},
}; };
use std::{collections::HashSet, sync::Mutex}; use std::{collections::HashSet, sync::Mutex};

View file

@ -5,9 +5,8 @@ use regex::RegexSet;
use smithay::{ use smithay::{
desktop::{Space, Window}, desktop::{Space, Window},
input::Seat, input::Seat,
wayland::{ output::Output,
compositor::with_states, output::Output, shell::xdg::XdgToplevelSurfaceRoleAttributes, wayland::{compositor::with_states, shell::xdg::XdgToplevelSurfaceRoleAttributes},
},
}; };
use std::sync::Mutex; use std::sync::Mutex;

View file

@ -3,11 +3,11 @@ use std::{cell::Cell, mem::MaybeUninit};
use smithay::{ use smithay::{
desktop::{layer_map_for_output, LayerSurface, PopupManager, Window, WindowSurfaceType}, desktop::{layer_map_for_output, LayerSurface, PopupManager, Window, WindowSurfaceType},
input::{pointer::MotionEvent, Seat}, input::{pointer::MotionEvent, Seat},
output::Output,
reexports::wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle}, reexports::wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle},
utils::{Logical, Point, Rectangle, SERIAL_COUNTER}, utils::{Logical, Point, Rectangle, SERIAL_COUNTER},
wayland::{ wayland::{
compositor::with_states, compositor::with_states,
output::Output,
shell::{ shell::{
wlr_layer::{ wlr_layer::{
KeyboardInteractivity, Layer, LayerSurfaceCachedState, WlrLayerShellState, KeyboardInteractivity, Layer, LayerSurfaceCachedState, WlrLayerShellState,

View file

@ -7,12 +7,12 @@ use crate::{
use smithay::{ use smithay::{
desktop::{Kind, Space, Window, WindowSurfaceType}, desktop::{Kind, Space, Window, WindowSurfaceType},
input::{pointer::GrabStartData as PointerGrabStartData, Seat}, input::{pointer::GrabStartData as PointerGrabStartData, Seat},
output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel::{self, ResizeEdge}, wayland_protocols::xdg::shell::server::xdg_toplevel::{self, ResizeEdge},
wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle}, wayland_server::{protocol::wl_surface::WlSurface, DisplayHandle},
}, },
utils::{IsAlive, Serial}, utils::{IsAlive, Serial},
wayland::output::Output,
}; };
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -14,6 +14,7 @@ use crate::{
use smithay::{ use smithay::{
backend::drm::DrmNode, backend::drm::DrmNode,
input::{Seat, SeatState}, input::{Seat, SeatState},
output::{Mode as OutputMode, Output, Scale},
reexports::{ reexports::{
calloop::{LoopHandle, LoopSignal}, calloop::{LoopHandle, LoopSignal},
wayland_server::{ wayland_server::{
@ -23,12 +24,8 @@ use smithay::{
}, },
utils::{Buffer, Size}, utils::{Buffer, Size},
wayland::{ wayland::{
compositor::CompositorState, compositor::CompositorState, data_device::DataDeviceState, dmabuf::DmabufState,
data_device::DataDeviceState, output::OutputManagerState, primary_selection::PrimarySelectionState, shm::ShmState,
dmabuf::DmabufState,
output::{Mode as OutputMode, Output, OutputManagerState, Scale},
primary_selection::PrimarySelectionState,
shm::ShmState,
viewporter::ViewporterState, viewporter::ViewporterState,
}, },
}; };

View file

@ -1,8 +1,8 @@
use crate::input::{ActiveOutput, SeatId}; use crate::input::{ActiveOutput, SeatId};
use smithay::{ use smithay::{
input::Seat, input::Seat,
output::Output,
utils::{Logical, Rectangle, Transform}, utils::{Logical, Rectangle, Transform},
wayland::output::Output,
}; };
use std::cell::RefCell; use std::cell::RefCell;

View file

@ -16,12 +16,12 @@ use smithay::{
}, },
desktop::{draw_window, draw_window_popups, space::RenderElement, Kind, Window}, desktop::{draw_window, draw_window_popups, space::RenderElement, Kind, Window},
input::pointer::CursorImageStatus, input::pointer::CursorImageStatus,
output::Output,
reexports::wayland_server::{protocol::wl_output::WlOutput, DisplayHandle, Resource}, reexports::wayland_server::{protocol::wl_output::WlOutput, DisplayHandle, Resource},
utils::{IsAlive, Size, Transform}, utils::{IsAlive, Size, Transform},
wayland::{ wayland::{
compositor::{get_children, with_states, SurfaceAttributes}, compositor::{get_children, with_states, SurfaceAttributes},
dmabuf::get_dmabuf, dmabuf::get_dmabuf,
output::Output,
}, },
}; };

View file

@ -4,15 +4,13 @@ use crate::utils::prelude::*;
use smithay::{ use smithay::{
delegate_layer_shell, delegate_layer_shell,
desktop::{LayerSurface, PopupKind}, desktop::{LayerSurface, PopupKind},
output::Output,
reexports::wayland_server::protocol::wl_output::WlOutput, reexports::wayland_server::protocol::wl_output::WlOutput,
wayland::{ wayland::shell::{
output::Output, wlr_layer::{
shell::{ Layer, LayerSurface as WlrLayerSurface, WlrLayerShellHandler, WlrLayerShellState,
wlr_layer::{
Layer, LayerSurface as WlrLayerSurface, WlrLayerShellHandler, WlrLayerShellState,
},
xdg::PopupSurface,
}, },
xdg::PopupSurface,
}, },
}; };

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::wayland::output::Output; use smithay::output::Output;
use crate::{ use crate::{
config::OutputConfig, config::OutputConfig,

View file

@ -4,24 +4,21 @@ use crate::utils::prelude::*;
use smithay::{ use smithay::{
delegate_xdg_shell, delegate_xdg_shell,
desktop::{ desktop::{
Kind, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupUngrabStrategy, find_popup_root_surface, Kind, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
Window, WindowSurfaceType, PopupUngrabStrategy, Window, WindowSurfaceType,
}, },
input::{ input::{
pointer::{Focus, GrabStartData as PointerGrabStartData}, pointer::{Focus, GrabStartData as PointerGrabStartData},
Seat, Seat,
}, },
output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel, wayland_protocols::xdg::shell::server::xdg_toplevel,
wayland_server::protocol::{wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface}, wayland_server::protocol::{wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface},
}, },
utils::Serial, utils::Serial,
wayland::{ wayland::shell::xdg::{
output::Output, Configure, PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler, XdgShellState,
shell::xdg::{
Configure, PopupSurface, PositionerState, ToplevelSurface, XdgShellHandler,
XdgShellState,
},
}, },
}; };
use std::cell::Cell; use std::cell::Cell;
@ -92,49 +89,46 @@ impl XdgShellHandler for State {
fn grab(&mut self, surface: PopupSurface, seat: WlSeat, serial: Serial) { fn grab(&mut self, surface: PopupSurface, seat: WlSeat, serial: Serial) {
let seat = Seat::from_resource(&seat).unwrap(); let seat = Seat::from_resource(&seat).unwrap();
let dh = &self.common.display_handle; let kind = PopupKind::Xdg(surface);
let ret = if let Ok(root) = find_popup_root_surface(&kind) {
self.common let ret = self
.common
.shell .shell
.popups .popups
.grab_popup(dh, surface.wl_surface().clone(), &seat, serial); .grab_popup(root, kind, &seat, serial);
if let Ok(mut grab) = ret { if let Ok(mut grab) = ret {
if let Some(keyboard) = seat.get_keyboard() { if let Some(keyboard) = seat.get_keyboard() {
if keyboard.is_grabbed() if keyboard.is_grabbed()
&& !(keyboard.has_grab(serial) && !(keyboard.has_grab(serial)
|| keyboard.has_grab(grab.previous_serial().unwrap_or(serial))) || keyboard.has_grab(grab.previous_serial().unwrap_or(serial)))
{ {
grab.ungrab(PopupUngrabStrategy::All); grab.ungrab(PopupUngrabStrategy::All);
return; return;
}
Common::set_focus(self, grab.current_grab().as_ref(), &seat, Some(serial));
keyboard.set_grab(PopupKeyboardGrab::new(&grab), serial);
} }
Common::set_focus(
self,
grab.current_grab().as_ref().map(|x| &x.0),
&seat,
Some(serial),
);
keyboard.set_grab(PopupKeyboardGrab::new(&grab), serial);
}
if let Some(pointer) = seat.get_pointer() { if let Some(pointer) = seat.get_pointer() {
if pointer.is_grabbed() if pointer.is_grabbed()
&& !(pointer.has_grab(serial) && !(pointer.has_grab(serial)
|| pointer || pointer
.has_grab(grab.previous_serial().unwrap_or_else(|| grab.serial()))) .has_grab(grab.previous_serial().unwrap_or_else(|| grab.serial())))
{ {
grab.ungrab(PopupUngrabStrategy::All); grab.ungrab(PopupUngrabStrategy::All);
return; return;
}
pointer.set_grab(self, PopupPointerGrab::new(&grab), serial, Focus::Keep);
} }
pointer.set_grab(self, PopupPointerGrab::new(&grab), serial, Focus::Keep);
}
seat.user_data() seat.user_data()
.insert_if_missing(|| PopupGrabData::new(None)); .insert_if_missing(|| PopupGrabData::new(None));
seat.user_data() seat.user_data()
.get::<PopupGrabData>() .get::<PopupGrabData>()
.unwrap() .unwrap()
.set(Some(grab)); .set(Some(grab));
}
} }
} }

View file

@ -6,6 +6,7 @@ use smithay::{
layer_map_for_output, LayerSurface, PopupKind, PopupManager, Space, Window, layer_map_for_output, LayerSurface, PopupKind, PopupManager, Space, Window,
WindowSurfaceType, WindowSurfaceType,
}, },
output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_positioner::{ wayland_protocols::xdg::shell::server::xdg_positioner::{
Anchor, ConstraintAdjustment, Gravity, Anchor, ConstraintAdjustment, Gravity,
@ -15,7 +16,6 @@ use smithay::{
utils::{Logical, Point, Rectangle}, utils::{Logical, Point, Rectangle},
wayland::{ wayland::{
compositor::{get_role, with_states}, compositor::{get_role, with_states},
output::Output,
shell::xdg::{ shell::xdg::{
PopupSurface, PositionerState, SurfaceCachedState, XdgPopupSurfaceRoleAttributes, PopupSurface, PositionerState, SurfaceCachedState, XdgPopupSurfaceRoleAttributes,
XDG_POPUP_ROLE, XDG_POPUP_ROLE,

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use smithay::{ use smithay::{
output::{Mode, Output, OutputData},
reexports::{ reexports::{
wayland_protocols_wlr::output_management::v1::server::{ wayland_protocols_wlr::output_management::v1::server::{
zwlr_output_configuration_head_v1::{self, ZwlrOutputConfigurationHeadV1}, zwlr_output_configuration_head_v1::{self, ZwlrOutputConfigurationHeadV1},
@ -16,7 +17,6 @@ use smithay::{
}, },
}, },
utils::{Logical, Physical, Point, Size, Transform}, utils::{Logical, Physical, Point, Size, Transform},
wayland::output::{Mode, Output, OutputData},
}; };
use std::{ use std::{
convert::{TryFrom, TryInto}, convert::{TryFrom, TryInto},
@ -734,7 +734,7 @@ where
if inner.enabled { if inner.enabled {
let point = output.current_location(); let point = output.current_location();
instance.head.position(point.x, point.y); instance.head.position(point.x, point.y);
instance.head.transform(output.current_transform()); instance.head.transform(output.current_transform().into());
instance instance
.head .head
.scale(output.current_scale().fractional_scale()); .scale(output.current_scale().fractional_scale());
@ -759,10 +759,10 @@ macro_rules! delegate_output_configuration {
smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_manager_v1::ZwlrOutputManagerV1: $crate::wayland::protocols::output_configuration::OutputMngrInstanceData smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_manager_v1::ZwlrOutputManagerV1: $crate::wayland::protocols::output_configuration::OutputMngrInstanceData
] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>); ] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>);
smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [
smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_head_v1::ZwlrOutputHeadV1: smithay::wayland::output::Output smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_head_v1::ZwlrOutputHeadV1: smithay::output::Output
] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>); ] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>);
smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [
smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_mode_v1::ZwlrOutputModeV1: smithay::wayland::output::Mode smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_mode_v1::ZwlrOutputModeV1: smithay::output::Mode
] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>); ] => $crate::wayland::protocols::output_configuration::OutputConfigurationState<Self>);
smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [
smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_configuration_v1::ZwlrOutputConfigurationV1: $crate::wayland::protocols::output_configuration::PendingConfiguration smithay::reexports::wayland_protocols_wlr::output_management::v1::server::zwlr_output_configuration_v1::ZwlrOutputConfigurationV1: $crate::wayland::protocols::output_configuration::PendingConfiguration

View file

@ -4,6 +4,7 @@ use std::{collections::HashMap, sync::Mutex};
use smithay::{ use smithay::{
desktop::Window, desktop::Window,
output::Output,
reexports::{ reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel, wayland_protocols::xdg::shell::server::xdg_toplevel,
wayland_server::{ wayland_server::{
@ -13,9 +14,7 @@ use smithay::{
}, },
}, },
utils::{IsAlive, Logical, Rectangle}, utils::{IsAlive, Logical, Rectangle},
wayland::{ wayland::{compositor::with_states, shell::xdg::XdgToplevelSurfaceRoleAttributes},
compositor::with_states, output::Output, shell::xdg::XdgToplevelSurfaceRoleAttributes,
},
}; };
use super::workspace::{WorkspaceHandle, WorkspaceHandler, WorkspaceState}; use super::workspace::{WorkspaceHandle, WorkspaceHandler, WorkspaceState};

View file

@ -3,13 +3,13 @@
use smithay::{ use smithay::{
desktop::Window, desktop::Window,
input::{Seat, SeatHandler}, input::{Seat, SeatHandler},
output::Output,
reexports::wayland_server::{ reexports::wayland_server::{
backend::{ClientId, GlobalId, ObjectId}, backend::{ClientId, GlobalId, ObjectId},
protocol::wl_surface::WlSurface, protocol::wl_surface::WlSurface,
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
}, },
utils::{Logical, Rectangle}, utils::{Logical, Rectangle},
wayland::output::Output,
}; };
pub use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::ZcosmicToplelevelManagementCapabilitiesV1 as ManagementCapabilities; pub use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::ZcosmicToplelevelManagementCapabilitiesV1 as ManagementCapabilities;

View file

@ -3,11 +3,11 @@
use std::{collections::HashSet, sync::Mutex}; use std::{collections::HashSet, sync::Mutex};
use smithay::{ use smithay::{
output::Output,
reexports::wayland_server::{ reexports::wayland_server::{
backend::{ClientData, ClientId, GlobalId, ObjectId}, backend::{ClientData, ClientId, GlobalId, ObjectId},
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource,
}, },
wayland::output::Output,
}; };
use cosmic_protocols::workspace::v1::server::{ use cosmic_protocols::workspace::v1::server::{