cargo fmt
This commit is contained in:
parent
1979beaa39
commit
64c70be855
11 changed files with 110 additions and 75 deletions
|
|
@ -8,12 +8,12 @@ mod tests;
|
|||
|
||||
use self::event::*;
|
||||
use crate::xstate::{Decorations, MoveResizeDirection, WindowDims, WmHints, WmName, WmNormalHints};
|
||||
use crate::{timespec_from_millis, X11Selection, XConnection};
|
||||
use crate::{X11Selection, XConnection, timespec_from_millis};
|
||||
use clientside::MyWorld;
|
||||
use decoration::{DecorationsData, DecorationsDataSatellite};
|
||||
use hecs::Entity;
|
||||
use log::{debug, error, warn};
|
||||
use rustix::event::{poll, PollFd, PollFlags};
|
||||
use rustix::event::{PollFd, PollFlags, poll};
|
||||
use rustix::fs::Timespec;
|
||||
use smithay_client_toolkit::activation::ActivationState;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
|
@ -23,8 +23,9 @@ use std::os::unix::net::UnixStream;
|
|||
use std::time::Duration;
|
||||
use wayland_client::protocol::wl_subcompositor::WlSubcompositor;
|
||||
use wayland_client::{
|
||||
globals::{registry_queue_init, Global},
|
||||
protocol as client, Connection, EventQueue, Proxy, QueueHandle,
|
||||
Connection, EventQueue, Proxy, QueueHandle,
|
||||
globals::{Global, registry_queue_init},
|
||||
protocol as client,
|
||||
};
|
||||
use wayland_protocols::xdg::decoration::zv1::client::zxdg_decoration_manager_v1::ZxdgDecorationManagerV1;
|
||||
use wayland_protocols::xdg::decoration::zv1::client::zxdg_toplevel_decoration_v1::{self};
|
||||
|
|
@ -62,11 +63,11 @@ use wayland_protocols::{
|
|||
};
|
||||
use wayland_server::protocol::wl_seat::WlSeat;
|
||||
use wayland_server::{
|
||||
Client, DisplayHandle, Resource, WEnum,
|
||||
protocol::{
|
||||
wl_callback::WlCallback, wl_compositor::WlCompositor, wl_output::WlOutput, wl_shm::WlShm,
|
||||
wl_surface::WlSurface,
|
||||
},
|
||||
Client, DisplayHandle, Resource, WEnum,
|
||||
};
|
||||
use wl_drm::{client::wl_drm::WlDrm as WlDrmClient, server::wl_drm::WlDrm as WlDrmServer};
|
||||
use xcb::x;
|
||||
|
|
@ -485,7 +486,9 @@ impl<S: X11Selection> ServerState<NoConnection<S>> {
|
|||
.expect("Could not bind xdg_wm_base");
|
||||
|
||||
if xdg_wm_base.version() < 3 {
|
||||
warn!("xdg_wm_base version 2 detected. Popup repositioning will not work, and some popups may not work correctly.");
|
||||
warn!(
|
||||
"xdg_wm_base version 2 detected. Popup repositioning will not work, and some popups may not work correctly."
|
||||
);
|
||||
}
|
||||
|
||||
let compositor = global_list
|
||||
|
|
@ -504,8 +507,13 @@ impl<S: X11Selection> ServerState<NoConnection<S>> {
|
|||
.bind::<WpViewporter, _, _>(&qh, 1..=1, ())
|
||||
.expect("Could not bind wp_viewporter");
|
||||
|
||||
let fractional_scale = global_list.bind::<WpFractionalScaleManagerV1, _, _>(&qh, 1..=1, ())
|
||||
.inspect_err(|e| warn!("Couldn't bind fractional scale manager: {e}. Fractional scaling will not work."))
|
||||
let fractional_scale = global_list
|
||||
.bind::<WpFractionalScaleManagerV1, _, _>(&qh, 1..=1, ())
|
||||
.inspect_err(|e| {
|
||||
warn!(
|
||||
"Couldn't bind fractional scale manager: {e}. Fractional scaling will not work."
|
||||
)
|
||||
})
|
||||
.ok();
|
||||
|
||||
let activation_state = ActivationState::bind(&global_list, &qh)
|
||||
|
|
@ -692,7 +700,9 @@ impl<C: XConnection> ServerState<C> {
|
|||
}
|
||||
|
||||
if mixed_scale {
|
||||
warn!("Mixed output scales detected, choosing to give apps the smallest detected scale ({scale}x)");
|
||||
warn!(
|
||||
"Mixed output scales detected, choosing to give apps the smallest detected scale ({scale}x)"
|
||||
);
|
||||
}
|
||||
|
||||
debug!("Using new scale {scale}");
|
||||
|
|
@ -730,7 +740,9 @@ impl<C: XConnection> ServerState<C> {
|
|||
}),
|
||||
) {
|
||||
Ok(0) => {
|
||||
error!("Failed to flush clientside events (timeout)! Will try again later.");
|
||||
error!(
|
||||
"Failed to flush clientside events (timeout)! Will try again later."
|
||||
);
|
||||
}
|
||||
Ok(_) => {
|
||||
self.queue.flush().unwrap();
|
||||
|
|
@ -825,7 +837,9 @@ impl<S: X11Selection + 'static> InnerServerState<S> {
|
|||
let new_title = match &mut win.attrs.title {
|
||||
Some(w) => {
|
||||
if matches!(w, WmName::NetWmName(_)) && matches!(name, WmName::WmName(_)) {
|
||||
debug!("skipping setting window name to {name:?} because a _NET_WM_NAME title is already set");
|
||||
debug!(
|
||||
"skipping setting window name to {name:?} because a _NET_WM_NAME title is already set"
|
||||
);
|
||||
None
|
||||
} else {
|
||||
debug!("setting {window:?} title to {name:?}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue