[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/squeekboard][wip/a-wai/fix-sizing] fix wide mode

Arnaud Ferraris (@a-wai) gitlab at salsa.debian.org
Wed Apr 6 15:14:57 BST 2022



Arnaud Ferraris pushed to branch wip/a-wai/fix-sizing at Debian On Mobile / squeekboard


Commits:
424025d5 by Arnaud Ferraris at 2022-04-06T16:14:17+02:00
fix wide mode

- - - - -


2 changed files:

- debian/patches/output-store-physical-size.patch
- debian/patches/state-Derive-panel-size-from-physical-click-target-size.patch


Changes:

=====================================
debian/patches/output-store-physical-size.patch
=====================================
@@ -38,7 +38,7 @@ index 13c1b5d3..cb17efa8 100644
 +                        height: maybe_mm(phys_height),
 +                    },
 +                    transform,
-+                }); println!("physical: {}x{}", phys_width, phys_width);
++                });
 +            },
              None => log_print!(
                  logging::Level::Warning,
@@ -145,3 +145,4 @@ index d5109066..f4eb4f52 100644
  
 -- 
 GitLab
+


=====================================
debian/patches/state-Derive-panel-size-from-physical-click-target-size.patch
=====================================
@@ -1,13 +1,13 @@
-From 12cb187f966545a11c6add19f8e2d92fec295a7f Mon Sep 17 00:00:00 2001
+From 5e964381e3140c3d854846d347bac70540e1ccad Mon Sep 17 00:00:00 2001
 From: Dorota Czaplejewicz <dorota.czaplejewicz at puri.sm>
 Date: Wed, 6 Apr 2022 08:59:04 +0000
 Subject: [PATCH] state: Derive panel size from physical click target size
 
 ---
  src/outputs.rs | 16 ++++++++++++
- src/state.rs   | 70 +++++++++++++++++++++++++++++++++++++++-----------
+ src/state.rs   | 71 +++++++++++++++++++++++++++++++++++++++-----------
  src/util.rs    | 45 ++++++++++++++++++++++++++++++--
- 3 files changed, 114 insertions(+), 17 deletions(-)
+ 3 files changed, 115 insertions(+), 17 deletions(-)
 
 diff --git a/src/outputs.rs b/src/outputs.rs
 index cb17efa8..6d8fb7d4 100644
@@ -47,7 +47,7 @@ index cb17efa8..6d8fb7d4 100644
  #[derive(Clone, Copy, Debug)]
  pub struct Geometry {
 diff --git a/src/state.rs b/src/state.rs
-index 58d8e50e..44e6bd72 100644
+index 58d8e50e..d0e8cd5d 100644
 --- a/src/state.rs
 +++ b/src/state.rs
 @@ -9,7 +9,7 @@ use crate::animation;
@@ -59,7 +59,7 @@ index 58d8e50e..44e6bd72 100644
  use crate::util::Rational;
  use std::cmp;
  use std::collections::HashMap;
-@@ -242,23 +242,63 @@ impl Application {
+@@ -242,23 +242,64 @@ impl Application {
      fn get_preferred_height(output: &OutputState) -> Option<PixelSize> {
          output.get_pixel_size()
              .map(|px_size| {
@@ -77,7 +77,7 @@ index 58d8e50e..44e6bd72 100644
 +                        numerator: 720,
 +                        denominator: 65,
 +                    });
-+println!("geometry: {}x{}", output.geometry.and_then(|g| g.phys_size.width).unwrap_or(Millimeter(0)).0, output.geometry.and_then(|g| g.phys_size.height).unwrap_or(Millimeter(0)).0);
++
 +                // Based on what works on the L5
 +                const MINIMUM_TARGET_SIZE: Rational<Millimeter> = Rational {
 +                    numerator: Millimeter(948),
@@ -86,7 +86,7 @@ index 58d8e50e..44e6bd72 100644
 +
 +                // TODO: calculate based on selected layout
 +                const ROW_COUNT: u32 = 4;
-+println!("density: {}/{}", density.numerator, density.denominator);
++
                  let height = {
 -                    if px_size.width > px_size.height {
 -                        px_size.width / 5
@@ -101,9 +101,10 @@ index 58d8e50e..44e6bd72 100644
 -                            px_size.width * 7 / 12 // to match 360×210
 +                    let minimum_height = MINIMUM_TARGET_SIZE * ROW_COUNT as i32;
 +                    let minimum_height_px = (minimum_height * density).ceil().0 as u32;
-+println!("minimum heigh: {} mm ({} px)", minimum_height.numerator.0 / 100, minimum_height_px);
++
 +                    // Reduce height to match what the layout can fill.
 +                    // For this, we need to guess if normal or wide will be picked up.
++                    // This must match `eek_gtk_keyboard.c::get_type`.
 +                    // TODO: query layout database and choose one directly
 +                    let abstract_width
 +                        = PixelSize {
@@ -130,10 +131,10 @@ index 58d8e50e..44e6bd72 100644
                          }
 -                    }
 +                    };
-+                    println!("calculated: {} px (abstract width: {} px)", (height_as_widths * px_size.width as i32).ceil(), abstract_width);
 +                    cmp::min(
-+                        minimum_height_px, (height_as_widths * px_size.width as i32).ceil() as u32,
-+                        )
++                        minimum_height_px,
++                        (height_as_widths * px_size.width as i32).ceil() as u32,
++                    )
                  };
                  PixelSize {
                      scale_factor: output.scale as u32,
@@ -206,3 +207,4 @@ index f4eb4f52..e7a1c7af 100644
  
 -- 
 GitLab
+



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/squeekboard/-/commit/424025d577379eec5c667de76e190fd1e689ff75

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/squeekboard/-/commit/424025d577379eec5c667de76e190fd1e689ff75
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20220406/cd42ce43/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list