mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75c79116a7 | |||
| 4f44ef081f | |||
| 4fc76b50d0 | |||
| e1f065ac23 | |||
| 7cc10ce1b5 |
Generated
+4
-4
@@ -2390,7 +2390,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "niri"
|
||||
version = "0.1.10"
|
||||
version = "0.1.10-1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"approx 0.5.1",
|
||||
@@ -2444,7 +2444,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "niri-config"
|
||||
version = "0.1.10"
|
||||
version = "0.1.10-1"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"csscolorparser",
|
||||
@@ -2461,7 +2461,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "niri-ipc"
|
||||
version = "0.1.10"
|
||||
version = "0.1.10-1"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"schemars",
|
||||
@@ -2471,7 +2471,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "niri-visual-tests"
|
||||
version = "0.1.10"
|
||||
version = "0.1.10-1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"gtk4",
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
members = ["niri-visual-tests"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.10"
|
||||
version = "0.1.10-1"
|
||||
description = "A scrollable-tiling Wayland compositor"
|
||||
authors = ["Ivan Molodetskikh <yalterz@gmail.com>"]
|
||||
license = "GPL-3.0-or-later"
|
||||
@@ -64,8 +64,8 @@ keyframe = { version = "1.1.1", default-features = false }
|
||||
libc = "0.2.162"
|
||||
libdisplay-info = "0.1.0"
|
||||
log = { version = "0.4.22", features = ["max_level_trace", "release_max_level_debug"] }
|
||||
niri-config = { version = "0.1.10", path = "niri-config" }
|
||||
niri-ipc = { version = "0.1.10", path = "niri-ipc", features = ["clap"] }
|
||||
niri-config = { version = "0.1.10-1", path = "niri-config" }
|
||||
niri-ipc = { version = "0.1.10-1", path = "niri-ipc", features = ["clap"] }
|
||||
notify-rust = { version = "~4.10.0", optional = true }
|
||||
ordered-float = "4.5.0"
|
||||
pango = { version = "0.20.4", features = ["v1_44"] }
|
||||
@@ -139,7 +139,7 @@ lto = "thin"
|
||||
debug = false
|
||||
|
||||
[package.metadata.generate-rpm]
|
||||
version = "0.1.10"
|
||||
version = "0.1.10.1"
|
||||
assets = [
|
||||
{ source = "target/release/niri", dest = "/usr/bin/", mode = "755" },
|
||||
{ source = "resources/niri-session", dest = "/usr/bin/", mode = "755" },
|
||||
|
||||
@@ -12,7 +12,7 @@ bitflags.workspace = true
|
||||
csscolorparser = "0.7.0"
|
||||
knuffel = "3.2.0"
|
||||
miette = "5.10.0"
|
||||
niri-ipc = { version = "0.1.10", path = "../niri-ipc" }
|
||||
niri-ipc = { version = "0.1.10-1", path = "../niri-ipc" }
|
||||
regex = "1.11.1"
|
||||
smithay = { workspace = true, features = ["backend_libinput"] }
|
||||
tracing.workspace = true
|
||||
|
||||
@@ -188,8 +188,8 @@ pub struct Touchpad {
|
||||
pub disabled_on_external_mouse: bool,
|
||||
#[knuffel(child)]
|
||||
pub middle_emulation: bool,
|
||||
#[knuffel(child, unwrap(argument), default = FloatOrInt(1.0))]
|
||||
pub scroll_factor: FloatOrInt<0, 100>,
|
||||
#[knuffel(child, unwrap(argument))]
|
||||
pub scroll_factor: Option<FloatOrInt<0, 100>>,
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
||||
@@ -210,8 +210,8 @@ pub struct Mouse {
|
||||
pub left_handed: bool,
|
||||
#[knuffel(child)]
|
||||
pub middle_emulation: bool,
|
||||
#[knuffel(child, unwrap(argument), default = FloatOrInt(1.0))]
|
||||
pub scroll_factor: FloatOrInt<0, 100>,
|
||||
#[knuffel(child, unwrap(argument))]
|
||||
pub scroll_factor: Option<FloatOrInt<0, 100>>,
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
|
||||
@@ -3183,7 +3183,7 @@ mod tests {
|
||||
left_handed: false,
|
||||
disabled_on_external_mouse: true,
|
||||
middle_emulation: false,
|
||||
scroll_factor: FloatOrInt(0.9),
|
||||
scroll_factor: Some(FloatOrInt(0.9)),
|
||||
},
|
||||
mouse: Mouse {
|
||||
off: false,
|
||||
@@ -3194,7 +3194,7 @@ mod tests {
|
||||
scroll_button: Some(273),
|
||||
left_handed: false,
|
||||
middle_emulation: true,
|
||||
scroll_factor: FloatOrInt(0.2),
|
||||
scroll_factor: Some(FloatOrInt(0.2)),
|
||||
},
|
||||
trackpoint: Trackpoint {
|
||||
off: true,
|
||||
|
||||
@@ -11,8 +11,8 @@ repository.workspace = true
|
||||
adw = { version = "0.7.1", package = "libadwaita", features = ["v1_4"] }
|
||||
anyhow.workspace = true
|
||||
gtk = { version = "0.9.3", package = "gtk4", features = ["v4_12"] }
|
||||
niri = { version = "0.1.10", path = ".." }
|
||||
niri-config = { version = "0.1.10", path = "../niri-config" }
|
||||
niri = { version = "0.1.10-1", path = ".." }
|
||||
niri-config = { version = "0.1.10-1", path = "../niri-config" }
|
||||
smithay.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
+47
-4
@@ -31,6 +31,7 @@ use smithay::input::SeatHandler;
|
||||
use smithay::utils::{Logical, Point, Rectangle, Transform, SERIAL_COUNTER};
|
||||
use smithay::wayland::pointer_constraints::{with_pointer_constraint, PointerConstraint};
|
||||
use smithay::wayland::tablet_manager::{TabletDescriptor, TabletSeatTrait};
|
||||
use touch_move_grab::TouchMoveGrab;
|
||||
|
||||
use self::move_grab::MoveGrab;
|
||||
use self::resize_grab::ResizeGrab;
|
||||
@@ -540,6 +541,10 @@ impl State {
|
||||
}
|
||||
}
|
||||
Action::ConfirmScreenshot => {
|
||||
if !self.niri.screenshot_ui.is_open() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.backend.with_primary_renderer(|renderer| {
|
||||
match self.niri.screenshot_ui.capture(renderer) {
|
||||
Ok((size, pixels)) => {
|
||||
@@ -560,6 +565,10 @@ impl State {
|
||||
self.niri.queue_redraw_all();
|
||||
}
|
||||
Action::CancelScreenshot => {
|
||||
if !self.niri.screenshot_ui.is_open() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.niri.screenshot_ui.close();
|
||||
self.niri
|
||||
.cursor_manager
|
||||
@@ -1743,6 +1752,12 @@ impl State {
|
||||
fn on_pointer_axis<I: InputBackend>(&mut self, event: I::PointerAxisEvent) {
|
||||
let source = event.source();
|
||||
|
||||
// We received an event for the regular pointer, so show it now. This is also needed for
|
||||
// update_pointer_contents() below to return the real contents, necessary for the pointer
|
||||
// axis event to reach the window.
|
||||
self.niri.pointer_hidden = false;
|
||||
self.niri.tablet_cursor_location = None;
|
||||
|
||||
let horizontal_amount_v120 = event.amount_v120(Axis::Horizontal);
|
||||
let vertical_amount_v120 = event.amount_v120(Axis::Vertical);
|
||||
|
||||
@@ -1882,10 +1897,11 @@ impl State {
|
||||
}
|
||||
|
||||
let scroll_factor = match source {
|
||||
AxisSource::Wheel => self.niri.config.borrow().input.mouse.scroll_factor.0,
|
||||
AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor.0,
|
||||
_ => 1.0,
|
||||
AxisSource::Wheel => self.niri.config.borrow().input.mouse.scroll_factor,
|
||||
AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,
|
||||
_ => None,
|
||||
};
|
||||
let scroll_factor = scroll_factor.map(|x| x.0).unwrap_or(1.);
|
||||
|
||||
let horizontal_amount = horizontal_amount.unwrap_or_else(|| {
|
||||
// Winit backend, discrete scrolling.
|
||||
@@ -2352,12 +2368,40 @@ impl State {
|
||||
return;
|
||||
};
|
||||
|
||||
let serial = SERIAL_COUNTER.next_serial();
|
||||
|
||||
let under = self.niri.contents_under(touch_location);
|
||||
|
||||
if !handle.is_grabbed() {
|
||||
if let Some(window) = under.window {
|
||||
self.niri.layout.activate_window(&window);
|
||||
|
||||
// Check if we need to start an interactive move.
|
||||
let mods = self.niri.seat.get_keyboard().unwrap().modifier_state();
|
||||
let mod_down = match self.backend.mod_key() {
|
||||
CompositorMod::Super => mods.logo,
|
||||
CompositorMod::Alt => mods.alt,
|
||||
};
|
||||
if mod_down {
|
||||
let (output, pos_within_output) =
|
||||
self.niri.output_under(touch_location).unwrap();
|
||||
let output = output.clone();
|
||||
|
||||
if self.niri.layout.interactive_move_begin(
|
||||
window.clone(),
|
||||
&output,
|
||||
pos_within_output,
|
||||
) {
|
||||
let start_data = TouchGrabStartData {
|
||||
focus: None,
|
||||
slot: evt.slot(),
|
||||
location: touch_location,
|
||||
};
|
||||
let grab = TouchMoveGrab::new(start_data, window.clone());
|
||||
handle.set_grab(self, grab, serial);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
} else if let Some(output) = under.output {
|
||||
@@ -2369,7 +2413,6 @@ impl State {
|
||||
self.niri.focus_layer_surface_if_on_demand(under.layer);
|
||||
};
|
||||
|
||||
let serial = SERIAL_COUNTER.next_serial();
|
||||
handle.down(
|
||||
self,
|
||||
under.surface,
|
||||
|
||||
Reference in New Issue
Block a user