chore: update smithay

This commit is contained in:
Christian Meissl
2024-02-24 18:31:54 +01:00
committed by Ivan Molodetskikh
parent 494e98c123
commit 5ac350d51c
9 changed files with 70 additions and 41 deletions
Generated
+2 -2
View File
@@ -3072,7 +3072,7 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
[[package]]
name = "smithay"
version = "0.3.0"
source = "git+https://github.com/Smithay/smithay.git#3de7636e6cb562a1b9f14c76e17b0e4b27381c22"
source = "git+https://github.com/Smithay/smithay.git#b62ced79c70030680cdcd3d03233bc6b8df722e2"
dependencies = [
"appendlist",
"bitflags 2.4.2",
@@ -3144,7 +3144,7 @@ dependencies = [
[[package]]
name = "smithay-drm-extras"
version = "0.1.0"
source = "git+https://github.com/Smithay/smithay.git#3de7636e6cb562a1b9f14c76e17b0e4b27381c22"
source = "git+https://github.com/Smithay/smithay.git#b62ced79c70030680cdcd3d03233bc6b8df722e2"
dependencies = [
"drm",
"edid-rs",
+2 -1
View File
@@ -129,6 +129,7 @@ impl CompositorHandler for State {
let parent = window
.toplevel()
.expect("no x11 support")
.parent()
.and_then(|parent| self.niri.layout.find_window_and_output(&parent))
// Only consider the parent if we configured the window for the same
@@ -168,7 +169,7 @@ impl CompositorHandler for State {
// The toplevel remains unmapped.
let unmapped = entry.get();
if unmapped.needs_initial_configure() {
let toplevel = unmapped.window.toplevel().clone();
let toplevel = unmapped.window.toplevel().expect("no x11 support").clone();
self.queue_initial_configure(toplevel);
}
return;
+3 -1
View File
@@ -64,6 +64,7 @@ use crate::utils::output_size;
impl SeatHandler for State {
type KeyboardFocus = WlSurface;
type PointerFocus = WlSurface;
type TouchFocus = WlSurface;
fn seat_state(&mut self) -> &mut SeatState<State> {
&mut self.niri.seat_state
@@ -339,7 +340,7 @@ impl ForeignToplevelHandler for State {
fn close(&mut self, wl_surface: WlSurface) {
if let Some((window, _)) = self.niri.layout.find_window_and_output(&wl_surface) {
window.toplevel().send_close();
window.toplevel().expect("no x11 support").send_close();
}
}
@@ -348,6 +349,7 @@ impl ForeignToplevelHandler for State {
{
if !window
.toplevel()
.expect("no x11 support")
.current_state()
.capabilities
.contains(xdg_toplevel::WmCapabilities::Fullscreen)
+7 -3
View File
@@ -112,7 +112,7 @@ impl XdgShellHandler for State {
fn new_toplevel(&mut self, surface: ToplevelSurface) {
let wl_surface = surface.wl_surface().clone();
let unmapped = Unmapped::new(Window::new(surface));
let unmapped = Unmapped::new(Window::new_wayland_window(surface));
let existing = self.niri.unmapped_windows.insert(wl_surface, unmapped);
assert!(existing.is_none());
}
@@ -210,7 +210,9 @@ impl XdgShellHandler for State {
}
let layout_focus = self.niri.layout.focus();
if Some(&root) != layout_focus.map(|win| win.toplevel().wl_surface()) {
if Some(&root)
!= layout_focus.map(|win| win.toplevel().expect("no x11 support").wl_surface())
{
let _ = PopupManager::dismiss_popup(&root, &popup);
return;
}
@@ -771,7 +773,9 @@ impl State {
pub fn update_reactive_popups(&self, window: &Window, output: &Output) {
let _span = tracy_client::span!("Niri::update_reactive_popups");
for (popup, _) in PopupManager::popups_for_surface(window.toplevel().wl_surface()) {
for (popup, _) in PopupManager::popups_for_surface(
window.toplevel().expect("no x11 support").wl_surface(),
) {
match popup {
PopupKind::Xdg(ref popup) => {
if popup.with_pending_state(|state| state.positioner.reactive) {
+1 -1
View File
@@ -371,7 +371,7 @@ impl State {
}
Action::CloseWindow => {
if let Some(window) = self.niri.layout.focus() {
window.toplevel().send_close();
window.toplevel().expect("no x11 support").send_close();
}
}
Action::FullscreenWindow => {
+23 -8
View File
@@ -247,35 +247,45 @@ impl LayoutElement for Window {
}
fn request_size(&self, size: Size<i32, Logical>) {
self.toplevel().with_pending_state(|state| {
self.toplevel()
.expect("no x11 support")
.with_pending_state(|state| {
state.size = Some(size);
state.states.unset(xdg_toplevel::State::Fullscreen);
});
}
fn request_fullscreen(&self, size: Size<i32, Logical>) {
self.toplevel().with_pending_state(|state| {
self.toplevel()
.expect("no x11 support")
.with_pending_state(|state| {
state.size = Some(size);
state.states.set(xdg_toplevel::State::Fullscreen);
});
}
fn min_size(&self) -> Size<i32, Logical> {
with_states(self.toplevel().wl_surface(), |state| {
with_states(
self.toplevel().expect("no x11 support").wl_surface(),
|state| {
let curr = state.cached_state.current::<SurfaceCachedState>();
curr.min_size
})
},
)
}
fn max_size(&self) -> Size<i32, Logical> {
with_states(self.toplevel().wl_surface(), |state| {
with_states(
self.toplevel().expect("no x11 support").wl_surface(),
|state| {
let curr = state.cached_state.current::<SurfaceCachedState>();
curr.max_size
})
},
)
}
fn is_wl_surface(&self, wl_surface: &WlSurface) -> bool {
self.toplevel().wl_surface() == wl_surface
self.toplevel().expect("no x11 support").wl_surface() == wl_surface
}
fn set_preferred_scale_transform(&self, scale: i32, transform: Transform) {
@@ -285,7 +295,10 @@ impl LayoutElement for Window {
}
fn has_ssd(&self) -> bool {
self.toplevel().current_state().decoration_mode
self.toplevel()
.expect("no x11 support")
.current_state()
.decoration_mode
== Some(zxdg_toplevel_decoration_v1::Mode::ServerSide)
}
@@ -305,6 +318,7 @@ impl LayoutElement for Window {
fn is_fullscreen(&self) -> bool {
self.toplevel()
.expect("no x11 support")
.current_state()
.states
.contains(xdg_toplevel::State::Fullscreen)
@@ -312,6 +326,7 @@ impl LayoutElement for Window {
fn is_pending_fullscreen(&self) -> bool {
self.toplevel()
.expect("no x11 support")
.with_pending_state(|state| state.states.contains(xdg_toplevel::State::Fullscreen))
}
}
+10 -3
View File
@@ -361,7 +361,10 @@ impl<W: LayoutElement> Workspace<W> {
set_preferred_scale_transform(window, output);
}
window.toplevel().with_pending_state(|state| {
window
.toplevel()
.expect("no x11 support")
.with_pending_state(|state| {
if state.states.contains(xdg_toplevel::State::Fullscreen) {
state.size = Some(self.view_size);
} else {
@@ -1211,11 +1214,15 @@ impl Workspace<Window> {
&& col.active_tile_idx == tile_idx;
win.set_activated(active);
win.toplevel().with_pending_state(|state| {
win.toplevel()
.expect("no x11 support")
.with_pending_state(|state| {
state.bounds = Some(bounds);
});
win.toplevel().send_pending_configure();
win.toplevel()
.expect("no x11 support")
.send_pending_configure();
win.refresh();
}
}
+1 -1
View File
@@ -478,7 +478,7 @@ impl State {
self.niri
.layout
.focus()
.map(|win| win.toplevel().wl_surface().clone())
.map(|win| win.toplevel().expect("no x11 support").wl_surface().clone())
};
let layer_focus = |surface: &LayerSurface| {
surface
+2 -2
View File
@@ -96,7 +96,7 @@ pub fn refresh(state: &mut State) {
// the previous window and only then activate the newly focused window.
let mut focused = None;
state.niri.layout.with_windows(|window, output| {
let wl_surface = window.toplevel().wl_surface();
let wl_surface = window.toplevel().expect("no x11 support").wl_surface();
with_states(wl_surface, |states| {
let role = states
@@ -116,7 +116,7 @@ pub fn refresh(state: &mut State) {
// Finally, refresh the focused window.
if let Some((window, output)) = focused {
let wl_surface = window.toplevel().wl_surface();
let wl_surface = window.toplevel().expect("no x11 support").wl_surface();
with_states(wl_surface, |states| {
let role = states