aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-05-29 13:32:11 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-10 18:08:00 +0300
commite3406ac2556c7f68cd00f11b5856222dcce7f680 (patch)
tree06926e2b098d98b780345569bdfbf56a92c3c392 /src/handlers
parent22a948cc759498923c1e9806580962cdd2d7b3e2 (diff)
downloadniri-e3406ac2556c7f68cd00f11b5856222dcce7f680.tar.gz
niri-e3406ac2556c7f68cd00f11b5856222dcce7f680.tar.bz2
niri-e3406ac2556c7f68cd00f11b5856222dcce7f680.zip
Signal fractional scale to clients
Doesn't do anything yet because we don't bind the fractional scale manager and don't allow fractional scales.
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/compositor.rs10
-rw-r--r--src/handlers/layer_shell.rs7
-rw-r--r--src/handlers/mod.rs12
-rw-r--r--src/handlers/xdg_shell.rs9
4 files changed, 19 insertions, 19 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs
index 0d64faa3..845b720d 100644
--- a/src/handlers/compositor.rs
+++ b/src/handlers/compositor.rs
@@ -8,9 +8,8 @@ use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
use smithay::reexports::wayland_server::{Client, Resource};
use smithay::wayland::buffer::BufferHandler;
use smithay::wayland::compositor::{
- add_blocker, add_pre_commit_hook, get_parent, is_sync_subsurface, send_surface_state,
- with_states, BufferAssignment, CompositorClientState, CompositorHandler, CompositorState,
- SurfaceAttributes,
+ add_blocker, add_pre_commit_hook, get_parent, is_sync_subsurface, with_states,
+ BufferAssignment, CompositorClientState, CompositorHandler, CompositorState, SurfaceAttributes,
};
use smithay::wayland::dmabuf::get_dmabuf;
use smithay::wayland::shell::xdg::XdgToplevelSurfaceData;
@@ -19,6 +18,7 @@ use smithay::{delegate_compositor, delegate_shm};
use super::xdg_shell::add_mapped_toplevel_pre_commit_hook;
use crate::niri::{ClientState, State};
+use crate::utils::send_scale_transform;
use crate::window::{InitialConfigureState, Mapped, ResolvedWindowRules, Unmapped};
impl CompositorHandler for State {
@@ -37,10 +37,10 @@ impl CompositorHandler for State {
}
if let Some(output) = self.niri.output_for_root(&root) {
- let scale = output.current_scale().integer_scale();
+ let scale = output.current_scale();
let transform = output.current_transform();
with_states(surface, |data| {
- send_surface_state(surface, data, scale, transform);
+ send_scale_transform(surface, data, scale, transform);
});
}
}
diff --git a/src/handlers/layer_shell.rs b/src/handlers/layer_shell.rs
index 7862a9fe..ae4ffe66 100644
--- a/src/handlers/layer_shell.rs
+++ b/src/handlers/layer_shell.rs
@@ -3,7 +3,7 @@ use smithay::desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurf
use smithay::output::Output;
use smithay::reexports::wayland_server::protocol::wl_output::WlOutput;
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
-use smithay::wayland::compositor::{send_surface_state, with_states};
+use smithay::wayland::compositor::with_states;
use smithay::wayland::shell::wlr_layer::{
Layer, LayerSurface as WlrLayerSurface, LayerSurfaceData, WlrLayerShellHandler,
WlrLayerShellState,
@@ -11,6 +11,7 @@ use smithay::wayland::shell::wlr_layer::{
use smithay::wayland::shell::xdg::PopupSurface;
use crate::niri::State;
+use crate::utils::send_scale_transform;
impl WlrLayerShellHandler for State {
fn shell_state(&mut self) -> &mut WlrLayerShellState {
@@ -103,10 +104,10 @@ impl State {
.layer_for_surface(surface, WindowSurfaceType::TOPLEVEL)
.unwrap();
- let scale = output.current_scale().integer_scale();
+ let scale = output.current_scale();
let transform = output.current_transform();
with_states(surface, |data| {
- send_surface_state(surface, data, scale, transform);
+ send_scale_transform(surface, data, scale, transform);
});
layer.layer_surface().send_configure();
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index 8ee34c70..0a4ce334 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -22,7 +22,7 @@ use smithay::reexports::wayland_server::protocol::wl_output::WlOutput;
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
use smithay::reexports::wayland_server::Resource;
use smithay::utils::{Logical, Rectangle, Size};
-use smithay::wayland::compositor::{send_surface_state, with_states};
+use smithay::wayland::compositor::with_states;
use smithay::wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier};
use smithay::wayland::drm_lease::{
DrmLease, DrmLeaseBuilder, DrmLeaseHandler, DrmLeaseRequest, DrmLeaseState, LeaseRejected,
@@ -67,7 +67,7 @@ use crate::protocols::foreign_toplevel::{
};
use crate::protocols::gamma_control::{GammaControlHandler, GammaControlManagerState};
use crate::protocols::screencopy::{Screencopy, ScreencopyHandler};
-use crate::utils::output_size;
+use crate::utils::{output_size, send_scale_transform};
use crate::{delegate_foreign_toplevel, delegate_gamma_control, delegate_screencopy};
impl SeatHandler for State {
@@ -140,11 +140,11 @@ impl InputMethodHandler for State {
fn new_popup(&mut self, surface: PopupSurface) {
let popup = PopupKind::InputMethod(surface);
if let Some(output) = self.output_for_popup(&popup) {
- let scale = output.current_scale().integer_scale();
+ let scale = output.current_scale();
let transform = output.current_transform();
let wl_surface = popup.wl_surface();
with_states(wl_surface, |data| {
- send_surface_state(wl_surface, data, scale, transform);
+ send_scale_transform(wl_surface, data, scale, transform);
});
}
@@ -307,11 +307,11 @@ pub fn configure_lock_surface(surface: &LockSurface, output: &Output) {
let size = output_size(output);
states.size = Some(Size::from((size.w as u32, size.h as u32)));
});
- let scale = output.current_scale().integer_scale();
+ let scale = output.current_scale();
let transform = output.current_transform();
let wl_surface = surface.wl_surface();
with_states(wl_surface, |data| {
- send_surface_state(wl_surface, data, scale, transform);
+ send_scale_transform(wl_surface, data, scale, transform);
});
surface.send_configure();
}
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index 879bd1b0..c1e29ea4 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -14,8 +14,7 @@ use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
use smithay::reexports::wayland_server::Resource;
use smithay::utils::{Logical, Rectangle, Serial};
use smithay::wayland::compositor::{
- add_pre_commit_hook, send_surface_state, with_states, BufferAssignment, HookId,
- SurfaceAttributes,
+ add_pre_commit_hook, with_states, BufferAssignment, HookId, SurfaceAttributes,
};
use smithay::wayland::input_method::InputMethodSeat;
use smithay::wayland::shell::kde::decoration::{KdeDecorationHandler, KdeDecorationState};
@@ -34,7 +33,7 @@ use crate::input::resize_grab::ResizeGrab;
use crate::input::DOUBLE_CLICK_TIME;
use crate::layout::workspace::ColumnWidth;
use crate::niri::{PopupGrabState, State};
-use crate::utils::{get_monotonic_time, ResizeEdge};
+use crate::utils::{get_monotonic_time, send_scale_transform, ResizeEdge};
use crate::window::{InitialConfigureState, ResolvedWindowRules, Unmapped, WindowRef};
impl XdgShellHandler for State {
@@ -734,10 +733,10 @@ impl State {
if !initial_configure_sent {
if let Some(output) = self.output_for_popup(&PopupKind::Xdg(popup.clone()))
{
- let scale = output.current_scale().integer_scale();
+ let scale = output.current_scale();
let transform = output.current_transform();
with_states(surface, |data| {
- send_surface_state(surface, data, scale, transform);
+ send_scale_transform(surface, data, scale, transform);
});
}
popup.send_configure().expect("initial configure failed");