refactor(repo): change a bunch of everything
This commit is contained in:
parent
81f367e3aa
commit
81bee82c34
26 changed files with 352 additions and 127 deletions
|
@ -0,0 +1,147 @@
|
|||
From fafce5e8cc92f11c476c1c8079f73cdd038acc54 Mon Sep 17 00:00:00 2001
|
||||
From: Artur Manuel <amad@atl.tools>
|
||||
Date: Sun, 16 Feb 2025 03:31:46 +0000
|
||||
Subject: [PATCH] ipc: _{90,180,270} => Normal{90,180,270}
|
||||
|
||||
---
|
||||
niri-ipc/src/lib.rs | 6 +++---
|
||||
src/dbus/mutter_display_config.rs | 12 ++++++------
|
||||
src/ipc/client.rs | 6 +++---
|
||||
src/protocols/output_management.rs | 6 +++---
|
||||
src/render_helpers/clipped_surface.rs | 4 ++--
|
||||
src/utils/mod.rs | 12 ++++++------
|
||||
6 files changed, 23 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs
|
||||
index 3a585eb3..a6b90d25 100644
|
||||
--- a/niri-ipc/src/lib.rs
|
||||
+++ b/niri-ipc/src/lib.rs
|
||||
@@ -903,13 +903,13 @@ pub enum Transform {
|
||||
Normal,
|
||||
/// Rotated by 90°.
|
||||
#[serde(rename = "90")]
|
||||
- _90,
|
||||
+ Normal90,
|
||||
/// Rotated by 180°.
|
||||
#[serde(rename = "180")]
|
||||
- _180,
|
||||
+ Normal180,
|
||||
/// Rotated by 270°.
|
||||
#[serde(rename = "270")]
|
||||
- _270,
|
||||
+ Normal270,
|
||||
/// Flipped horizontally.
|
||||
Flipped,
|
||||
/// Rotated by 90° and flipped horizontally.
|
||||
diff --git a/src/dbus/mutter_display_config.rs b/src/dbus/mutter_display_config.rs
|
||||
index b8ab08f9..dd553555 100644
|
||||
--- a/src/dbus/mutter_display_config.rs
|
||||
+++ b/src/dbus/mutter_display_config.rs
|
||||
@@ -136,9 +136,9 @@ impl DisplayConfig {
|
||||
if let Some(logical) = output.logical.as_ref() {
|
||||
let transform = match logical.transform {
|
||||
niri_ipc::Transform::Normal => 0,
|
||||
- niri_ipc::Transform::_90 => 1,
|
||||
- niri_ipc::Transform::_180 => 2,
|
||||
- niri_ipc::Transform::_270 => 3,
|
||||
+ niri_ipc::Transform::Normal90 => 1,
|
||||
+ niri_ipc::Transform::Normal180 => 2,
|
||||
+ niri_ipc::Transform::Normal270 => 3,
|
||||
niri_ipc::Transform::Flipped => 4,
|
||||
niri_ipc::Transform::Flipped90 => 5,
|
||||
niri_ipc::Transform::Flipped180 => 6,
|
||||
@@ -201,9 +201,9 @@ impl DisplayConfig {
|
||||
scale: Some(niri_config::FloatOrInt(requested_config.scale)),
|
||||
transform: match requested_config.transform {
|
||||
0 => niri_ipc::Transform::Normal,
|
||||
- 1 => niri_ipc::Transform::_90,
|
||||
- 2 => niri_ipc::Transform::_180,
|
||||
- 3 => niri_ipc::Transform::_270,
|
||||
+ 1 => niri_ipc::Transform::Normal90,
|
||||
+ 2 => niri_ipc::Transform::Normal180,
|
||||
+ 3 => niri_ipc::Transform::Normal270,
|
||||
4 => niri_ipc::Transform::Flipped,
|
||||
5 => niri_ipc::Transform::Flipped90,
|
||||
6 => niri_ipc::Transform::Flipped180,
|
||||
diff --git a/src/ipc/client.rs b/src/ipc/client.rs
|
||||
index 8682d8d3..db1b614a 100644
|
||||
--- a/src/ipc/client.rs
|
||||
+++ b/src/ipc/client.rs
|
||||
@@ -466,9 +466,9 @@ fn print_output(output: Output) -> anyhow::Result<()> {
|
||||
|
||||
let transform = match transform {
|
||||
Transform::Normal => "normal",
|
||||
- Transform::_90 => "90° counter-clockwise",
|
||||
- Transform::_180 => "180°",
|
||||
- Transform::_270 => "270° counter-clockwise",
|
||||
+ Transform::Normal90 => "90° counter-clockwise",
|
||||
+ Transform::Normal180 => "180°",
|
||||
+ Transform::Normal270 => "270° counter-clockwise",
|
||||
Transform::Flipped => "flipped horizontally",
|
||||
Transform::Flipped90 => "90° counter-clockwise, flipped horizontally",
|
||||
Transform::Flipped180 => "flipped vertically",
|
||||
diff --git a/src/protocols/output_management.rs b/src/protocols/output_management.rs
|
||||
index 4f1ac8c0..411e9eb6 100644
|
||||
--- a/src/protocols/output_management.rs
|
||||
+++ b/src/protocols/output_management.rs
|
||||
@@ -666,9 +666,9 @@ where
|
||||
zwlr_output_configuration_head_v1::Request::SetTransform { transform } => {
|
||||
let transform = match transform {
|
||||
WEnum::Value(WlTransform::Normal) => Transform::Normal,
|
||||
- WEnum::Value(WlTransform::_90) => Transform::_90,
|
||||
- WEnum::Value(WlTransform::_180) => Transform::_180,
|
||||
- WEnum::Value(WlTransform::_270) => Transform::_270,
|
||||
+ WEnum::Value(WlTransform::_90) => Transform::Normal90,
|
||||
+ WEnum::Value(WlTransform::_180) => Transform::Normal180,
|
||||
+ WEnum::Value(WlTransform::_270) => Transform::Normal270,
|
||||
WEnum::Value(WlTransform::Flipped) => Transform::Flipped,
|
||||
WEnum::Value(WlTransform::Flipped90) => Transform::Flipped90,
|
||||
WEnum::Value(WlTransform::Flipped180) => Transform::Flipped180,
|
||||
diff --git a/src/render_helpers/clipped_surface.rs b/src/render_helpers/clipped_surface.rs
|
||||
index f8d074e9..303b81b3 100644
|
||||
--- a/src/render_helpers/clipped_surface.rs
|
||||
+++ b/src/render_helpers/clipped_surface.rs
|
||||
@@ -55,8 +55,8 @@ impl<R: NiriRenderer> ClippedSurfaceRenderElement<R> {
|
||||
let transform = elem.transform();
|
||||
// HACK: ??? for some reason flipped ones are fine.
|
||||
let transform = match transform {
|
||||
- Transform::_90 => Transform::_270,
|
||||
- Transform::_270 => Transform::_90,
|
||||
+ Transform::Normal90 => Transform::Normal270,
|
||||
+ Transform::Normal270 => Transform::Normal90,
|
||||
x => x,
|
||||
};
|
||||
let transform_matrix = Mat3::from_translation(Vec2::new(0.5, 0.5))
|
||||
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
|
||||
index e43bad89..274e45ca 100644
|
||||
--- a/src/utils/mod.rs
|
||||
+++ b/src/utils/mod.rs
|
||||
@@ -148,9 +148,9 @@ pub fn logical_output(output: &Output) -> niri_ipc::LogicalOutput {
|
||||
let size = output_size(output);
|
||||
let transform = match output.current_transform() {
|
||||
Transform::Normal => niri_ipc::Transform::Normal,
|
||||
- Transform::_90 => niri_ipc::Transform::_90,
|
||||
- Transform::_180 => niri_ipc::Transform::_180,
|
||||
- Transform::_270 => niri_ipc::Transform::_270,
|
||||
+ Transform::Normal90 => niri_ipc::Transform::Normal90,
|
||||
+ Transform::Normal180 => niri_ipc::Transform::Normal180,
|
||||
+ Transform::Normal270 => niri_ipc::Transform::Normal270,
|
||||
Transform::Flipped => niri_ipc::Transform::Flipped,
|
||||
Transform::Flipped90 => niri_ipc::Transform::Flipped90,
|
||||
Transform::Flipped180 => niri_ipc::Transform::Flipped180,
|
||||
@@ -169,9 +169,9 @@ pub fn logical_output(output: &Output) -> niri_ipc::LogicalOutput {
|
||||
pub fn ipc_transform_to_smithay(transform: niri_ipc::Transform) -> Transform {
|
||||
match transform {
|
||||
niri_ipc::Transform::Normal => Transform::Normal,
|
||||
- niri_ipc::Transform::_90 => Transform::_90,
|
||||
- niri_ipc::Transform::_180 => Transform::_180,
|
||||
- niri_ipc::Transform::_270 => Transform::_270,
|
||||
+ niri_ipc::Transform::Normal90 => Transform::Normal90,
|
||||
+ niri_ipc::Transform::Normal180 => Transform::Normal180,
|
||||
+ niri_ipc::Transform::Normal270 => Transform::Normal270,
|
||||
niri_ipc::Transform::Flipped => Transform::Flipped,
|
||||
niri_ipc::Transform::Flipped90 => Transform::Flipped90,
|
||||
niri_ipc::Transform::Flipped180 => Transform::Flipped180,
|
||||
--
|
||||
2.47.2
|
||||
|
19
packages/amadaluzian-niri/default.nix
Normal file
19
packages/amadaluzian-niri/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
niri,
|
||||
fetchFromGitHub,
|
||||
...
|
||||
}:
|
||||
niri.overrideAttrs (finalAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "YaLTeR";
|
||||
repo = "niri";
|
||||
rev = "master";
|
||||
hash = "sha256-BVTlrmelSAq+rlxwlRvsyZxHrmcviRu3aHJYG37Yq8c=";
|
||||
};
|
||||
patches =
|
||||
(finalAttrs.patches or [])
|
||||
++ [
|
||||
./0001-ipc-_-90-180-270-Normal-90-180-270.patch
|
||||
];
|
||||
cargoHash = "";
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue