Compare commits

..
6 Commits
Author SHA1 Message Date
haraldandClaude Opus 5.5 e7e161e70c style: cargo fmt
Build & Publish Release / Android APK (push) Successful in 6m8s
Build & Publish Release / Build Packages & Publish to Gitea (push) Successful in 11m37s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:49:30 +01:00
haraldandClaude Opus 5.5 043f487e9c chore(release): bump version to 0.44.0
Build & Publish Release / Android APK (push) Successful in 5m55s
Build & Publish Release / Build Packages & Publish to Gitea (push) Failing after 1m10s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:37:36 +01:00
haraldandClaude Opus 5.5 3b0b4f51fb feat(pens): seven pens in the toolbar (Issue #56)
Pens 5-7 are stored in a new field, so versions before 0.44 still read
the first four instead of resetting all settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:34:35 +01:00
haraldandClaude Opus 5.5 14abadbd03 fix(ui): fit dialogs beside the toolbar on narrow screens (Issue #50)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:34:35 +01:00
haraldandClaude Opus 5.5 f279790e00 fix(ruler): stop a finger drag of the ruler when the pen comes near (Issue #55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:34:35 +01:00
haraldandClaude Opus 5.5 7bd3d9e82f fix(touch): hand on a touch lift without waiting for the next frame (Issues #28, #55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:34:27 +01:00
12 changed files with 198 additions and 31 deletions

No files matched your search

Generated
+1 -1
View File
@@ -1540,7 +1540,7 @@ dependencies = [
[[package]]
name = "ink-notes"
version = "0.43.0"
version = "0.44.0"
dependencies = [
"ab_glyph",
"android_logger",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "ink-notes"
version = "0.43.0"
version = "0.44.0"
edition = "2021"
description = "Notizbuch-App für Stift, Touch und Maus unter Linux"
repository = "https://gitea.pansi.eu/harald/ink-notes"
+1 -1
View File
@@ -22,7 +22,7 @@ Die Oberfläche gibt es auf Deutsch und Englisch; ink-notes folgt der Systemspra
## Funktionen
### Schreiben und Zeichnen
- **Vier Stifte** in der Werkzeugleiste, jeder mit eigener Farbe und Stärke (0,15–5 mm, mit Druckstärke). Ändert man Farbe oder Stärke, merkt sich der gewählte Stift das – auch über einen Neustart hinweg. **Textmarker** (halbtransparent, 4–8 mm) in vier Farben; innerhalb eines Strichs wird er nicht dunkler, erst ein neuer Strich deckt stärker.
- **Sieben Stifte** in der Werkzeugleiste, jeder mit eigener Farbe und Stärke (0,15–5 mm, mit Druckstärke). Ändert man Farbe oder Stärke, merkt sich der gewählte Stift das – auch über einen Neustart hinweg. **Textmarker** (halbtransparent, 4–8 mm) in vier Farben; innerhalb eines Strichs wird er nicht dunkler, erst ein neuer Strich deckt stärker.
- **Eigene Farben:** Jede Farbe in der Werkzeugleiste (Stifte, Textmarker, Text) lässt sich anpassen – gewählte Farbe erneut antippen, eine Vorgabe oder mit 🎨 einen freien Farbton wählen. Die Leiste merkt sich die Farben. Am Bildschirm erscheinen sie genauso wie im PDF- und Bildexport.
- **Glättung in zwei Stufen:** Während des Schreibens glättet ein 1€-Filter das Zittern, die Linie erscheint sofort. Beim Absetzen wird der Strich nachbearbeitet: Ecken (Knicke über 65°) bleiben erhalten und werden rund verbunden, der Druckverlauf wird geglättet, überflüssige Punkte entfallen, die Enden werden rund.
- **Druckkurve** im ☰-Menü an den eigenen Stift anpassen (weicher/härter, Schwelle gegen Grundrauschen).
+1 -1
View File
@@ -22,7 +22,7 @@ The interface is available in English and German; ink-notes follows the system l
## Features
### Writing and drawing
- **Four pens** in the toolbar, each with its own color and width (0.15–5 mm, pressure-sensitive). When you change a pen's color or width, it remembers that – also across restarts. **Highlighter** (semi-transparent, 4–8 mm) in four colors; it does not get darker within one stroke, only a new stroke covers more strongly.
- **Seven pens** in the toolbar, each with its own color and width (0.15–5 mm, pressure-sensitive). When you change a pen's color or width, it remembers that – also across restarts. **Highlighter** (semi-transparent, 4–8 mm) in four colors; it does not get darker within one stroke, only a new stroke covers more strongly.
- **Custom colors:** Every color in the toolbar (pens, highlighter, text) can be changed – tap the selected color again and pick a preset or any shade with 🎨. The toolbar remembers the colors. They look the same on screen as in PDF and image exports.
- **Two-stage smoothing:** While you write, a 1€ filter removes jitter and the line appears immediately. When you lift the pen, the stroke is refined: corners (bends over 65°) are kept and drawn round, the pressure curve is smoothed, redundant points are dropped and the ends become round.
- **Pressure curve** adjustable to your pen in the ☰ menu (softer/harder, threshold against base noise).
@@ -84,6 +84,11 @@
</branding>
<content_rating type="oars-1.1" />
<releases>
<release version="0.44.0" date="2026-11-09">
<description>
<p>Seven pens in the toolbar, dialogs that fit on phones, and touch lifts that arrive right away on GNOME, so the page glides after a swipe and the ruler no longer follows the hovering pen.</p>
</description>
</release>
<release version="0.43.0" date="2026-11-09">
<description>
<p>The pen draws without delay again on Wayland, and the eraser removes text boxes such as an inserted math result.</p>
+5
View File
@@ -84,6 +84,11 @@
</branding>
<content_rating type="oars-1.1" />
<releases>
<release version="0.44.0" date="2026-11-09">
<description>
<p>Seven pens in the toolbar, dialogs that fit on phones, and touch lifts that arrive right away on GNOME, so the page glides after a swipe and the ruler no longer follows the hovering pen.</p>
</description>
</release>
<release version="0.43.0" date="2026-11-09">
<description>
<p>The pen draws without delay again on Wayland, and the eraser removes text boxes such as an inserted math result.</p>
+4
View File
@@ -3,6 +3,10 @@
Notebook app for pen, touch and mouse on Linux (tested on Zorin OS 18 / Ubuntu 24.04).
### Highlights:
- **Seven pens**: The toolbar now has seven pens instead of four (new: violet, orange, gray). Each remembers its color and width; tap the selected pen again to change them. Older versions keep reading the first four pens (Issue #56)
- **Momentum scrolling on GNOME, second try**: GNOME could deliver the lift of a swipe only together with the next touch, because the library under winit held it back until the next touch frame. Lifts are now handed on right away, so the page glides on after a quick swipe (Issue #28)
- **Ruler stays put**: After moving the ruler with a finger, it could follow the hovering pen (same cause as above). In addition, a finger drag of the ruler now ends as soon as the pen comes near (Issue #55)
- **Dialogs on phones**: The notebook manager and the other dialogs were wider than a phone screen, partly under the toolbar and cut off at the right edge. They now fit beside the toolbar (Issue #50)
- **Pen without lag on Wayland**: Pen events reached the app only when something else woke it, so strokes trailed behind the pen or appeared only later. Every event from the compositor now wakes the app; it still uses no CPU while idle (Issue #53)
- **Eraser removes text**: The whole-stroke and partial erasers now remove a text box – typed text or an inserted math result – as soon as they touch it. The highlighter eraser leaves text alone, images are never erased (Issue #54)
- **Writing with the finger on Android**: "Draw with finger" (☰ → Input) is now remembered and starts switched on on Android, where phones usually have no pen. Before, it was off after every start, so after an update one finger only moved the page (Issue #50)
+6 -2
View File
@@ -1467,7 +1467,7 @@ pub fn run_with(
ui_state.pattern_color = ui_settings.pattern_color;
ui_state.pressure_curve = ui_settings.pressure_curve;
ui_state.continuous_scroll = ui_settings.continuous_scroll;
ui_state.pen_presets = ui_settings.pen_presets;
ui_state.pen_presets = ui_settings.pens();
ui_state.stylus_buttons = ui_settings.stylus_buttons.clone();
ui_state.set_eraser_radius_mm(ui_settings.eraser_radius_mm);
ui_state.math.set_enabled(ui_settings.math_assist);
@@ -1901,6 +1901,10 @@ pub fn run_with(
PenEvent::In => {
is_stylus_in_proximity = true;
stylus_tool_id = Some(tool);
// A finger that moved the ruler is done once the pen comes near:
// if its lift has not arrived yet, the ruler would follow the
// hovering pen (Issue #55). The pen grabs the ruler only on touch.
ui_state.ruler_drag = None;
}
PenEvent::Out => {
if is_stylus_in_proximity {
@@ -5590,7 +5594,7 @@ pub fn run_with(
ui_state.sync_tool_colors();
if !egui_ctx.is_using_pointer() {
let mut updated = ui_settings.clone();
updated.pen_presets = ui_state.pen_presets;
updated.set_pens(ui_state.pen_presets);
updated.active_pen = ui_state.active_pen;
updated.highlighter_colors = ui_state.highlighter_colors;
updated.active_highlighter = ui_state.active_highlighter;
+83 -10
View File
@@ -100,10 +100,16 @@ impl PenPreset {
}
}
/// Anzahl der Stifte in der Werkzeugleiste.
pub const PEN_PRESET_COUNT: usize = 4;
/// Anzahl der Stifte in der Werkzeugleiste (Issue #56: seven).
pub const PEN_PRESET_COUNT: usize = 7;
/// Standardstifte: Schwarz, Blau und Rot fein, Grün etwas kräftiger.
/// Pens stored in `pen_presets`. Versions before 0.44 expect exactly four there and would
/// reset all settings for any other length, so the further pens go to `more_pen_presets` and a
/// rollback keeps the first four.
pub const STORED_PEN_PRESETS: usize = 4;
/// Standardstifte: Schwarz, Blau und Rot fein, Grün etwas kräftiger, dazu Violett, Orange und
/// Grau.
pub const DEFAULT_PEN_PRESETS: [PenPreset; PEN_PRESET_COUNT] = [
PenPreset {
color: [0.12, 0.12, 0.14, 1.0],
@@ -121,6 +127,18 @@ pub const DEFAULT_PEN_PRESETS: [PenPreset; PEN_PRESET_COUNT] = [
color: [0.18, 0.65, 0.35, 1.0],
width_mm: 0.8,
},
PenPreset {
color: [0.55, 0.25, 0.75, 1.0],
width_mm: 0.5,
},
PenPreset {
color: [0.95, 0.55, 0.10, 1.0],
width_mm: 0.5,
},
PenPreset {
color: [0.45, 0.45, 0.48, 1.0],
width_mm: 0.5,
},
];
/// Farben des Textmarkers in der Werkzeugleiste (halbtransparent).
@@ -215,8 +233,10 @@ pub struct UiSettings {
/// Frühere globale Einstellung „Seiten durchgehend scrollen“: gilt nur noch für Notizbücher
/// ohne eigene Anordnung im Manifest (vor 0.28 angelegt), wird nicht mehr geändert
pub continuous_scroll: bool,
/// Stifte der Werkzeugleiste und der gewählte davon
pub pen_presets: [PenPreset; PEN_PRESET_COUNT],
/// Stifte der Werkzeugleiste und der gewählte davon: the first four here, the others in
/// `more_pen_presets` (see [`STORED_PEN_PRESETS`]); use [`Self::pens`]
pub pen_presets: [PenPreset; STORED_PEN_PRESETS],
pub more_pen_presets: Vec<PenPreset>,
pub active_pen: usize,
/// Eigene Farben von Textmarker und Text-Werkzeug und die gewählte davon
pub highlighter_colors: [[f32; 4]; 4],
@@ -248,7 +268,13 @@ impl Default for UiSettings {
pattern_color: PatternColor::default(),
pressure_curve: PressureCurve::default(),
continuous_scroll: true,
pen_presets: DEFAULT_PEN_PRESETS,
pen_presets: [
DEFAULT_PEN_PRESETS[0],
DEFAULT_PEN_PRESETS[1],
DEFAULT_PEN_PRESETS[2],
DEFAULT_PEN_PRESETS[3],
],
more_pen_presets: DEFAULT_PEN_PRESETS[STORED_PEN_PRESETS..].to_vec(),
active_pen: 0,
highlighter_colors: DEFAULT_HIGHLIGHTER_COLORS,
active_highlighter: 0,
@@ -283,9 +309,12 @@ impl UiSettings {
Err(_) => Self::default(),
};
settings.pressure_curve = settings.pressure_curve.sanitized();
for (preset, fallback) in settings.pen_presets.iter_mut().zip(DEFAULT_PEN_PRESETS) {
*preset = preset.sanitized(fallback);
let pens = settings.pens();
let mut sanitized = DEFAULT_PEN_PRESETS;
for ((preset, pen), fallback) in sanitized.iter_mut().zip(pens).zip(DEFAULT_PEN_PRESETS) {
*preset = pen.sanitized(fallback);
}
settings.set_pens(sanitized);
settings.active_pen = settings.active_pen.min(PEN_PRESET_COUNT - 1);
for (color, fallback) in settings
.highlighter_colors
@@ -307,6 +336,23 @@ impl UiSettings {
settings
}
/// All pens of the toolbar; pens missing in the file (older versions had four) are the
/// default pens.
pub fn pens(&self) -> [PenPreset; PEN_PRESET_COUNT] {
let mut pens = DEFAULT_PEN_PRESETS;
let stored = self.pen_presets.iter().chain(&self.more_pen_presets);
for (pen, stored) in pens.iter_mut().zip(stored) {
*pen = *stored;
}
pens
}
pub fn set_pens(&mut self, pens: [PenPreset; PEN_PRESET_COUNT]) {
self.pen_presets
.copy_from_slice(&pens[..STORED_PEN_PRESETS]);
self.more_pen_presets = pens[STORED_PEN_PRESETS..].to_vec();
}
/// Speichert die Einstellungen atomar.
pub fn save_to(&self, path: &Path) -> Result<(), StorageError> {
storage::atomic_write_json(path, self)
@@ -338,7 +384,14 @@ mod tests {
pen_presets: [PenPreset {
color: [0.5, 0.2, 0.7, 1.0],
width_mm: 1.5,
}; PEN_PRESET_COUNT],
}; STORED_PEN_PRESETS],
more_pen_presets: vec![
PenPreset {
color: [0.1, 0.6, 0.7, 1.0],
width_mm: 2.0,
};
PEN_PRESET_COUNT - STORED_PEN_PRESETS
],
active_pen: 2,
highlighter_colors: [[0.9, 0.5, 0.1, 0.35]; 4],
active_highlighter: 3,
@@ -372,6 +425,24 @@ mod tests {
assert_eq!(UiSettings::load_from(&path), UiSettings::default());
}
#[test]
fn test_seven_pens_stay_readable_for_older_versions() {
// Versions before 0.44 read `pen_presets` as exactly four pens (Issue #56)
#[derive(Deserialize)]
struct OldSettings {
pen_presets: [PenPreset; 4],
}
let mut settings = UiSettings::default();
let mut pens = DEFAULT_PEN_PRESETS;
pens[6].color = [0.3, 0.3, 0.9, 1.0];
settings.set_pens(pens);
let json = serde_json::to_string(&settings).unwrap();
let old: OldSettings = serde_json::from_str(&json).unwrap();
assert_eq!(old.pen_presets[..], DEFAULT_PEN_PRESETS[..4]);
let back: UiSettings = serde_json::from_str(&json).unwrap();
assert_eq!(back.pens(), pens);
}
#[test]
fn test_old_settings_file_keeps_new_defaults() {
// ui.json aus v0.3.x kennt nur die Seite der Werkzeugleiste
@@ -397,7 +468,7 @@ mod tests {
assert_eq!(curve.threshold, 0.0);
// Ohne Stifte: die Standardstifte; unsinnige Stifte werden begrenzt
assert_eq!(settings.pen_presets, DEFAULT_PEN_PRESETS);
assert_eq!(settings.pens(), DEFAULT_PEN_PRESETS);
assert_eq!(settings.active_pen, 0);
std::fs::write(
&path,
@@ -414,6 +485,8 @@ mod tests {
assert_eq!(settings.pen_presets[0].color, [1.0, 0.0, 0.5, 1.0]);
assert_eq!(settings.pen_presets[0].width_mm, 5.0);
assert_eq!(settings.pen_presets[1].width_mm, 0.15);
// Files from before 0.44 have four pens: the others are the default pens
assert_eq!(settings.pens()[4..], DEFAULT_PEN_PRESETS[4..]);
// Eigene Farben: Textmarker bleibt halbtransparent, Text deckend
std::fs::write(
+52 -12
View File
@@ -721,7 +721,7 @@ impl UiState {
}
/// Länge der längsten Farbpalette; so viel Platz hält die Leiste immer frei.
pub const MAX_PALETTE_LEN: usize = 5;
pub const MAX_PALETTE_LEN: usize = PEN_PRESET_COUNT;
/// Vertical gap between toolbar buttons and the height of a divider line.
pub const SIDEBAR_SPACING: f32 = 2.0;
pub const SIDEBAR_DIVIDER: f32 = 3.0;
@@ -2942,8 +2942,9 @@ fn file_picker_dialog(ctx: &egui::Context, state: &mut UiState, actions: &mut Ve
),
),
};
let width = dialog_width(ctx, state, 460.0);
dialog_window(title, state, false).show(ctx, |ui| {
ui.set_width(460.0);
ui.set_width(width);
touch_friendly_spacing(ui);
if dialog_header(ui, header, true) {
close = true;
@@ -3114,6 +3115,17 @@ fn dialog_window(title: &'static str, state: &UiState, danger: bool) -> egui::Wi
.frame(dialog_frame(danger))
}
/// Content width of a dialog: `wanted`, but at most what fits beside the toolbar, so that on a
/// phone the dialog is neither hidden under the toolbar nor cut off at the edge (Issue #50).
fn dialog_width(ctx: &egui::Context, state: &UiState, wanted: f32) -> f32 {
// Frame margins (20 each side) and a gap to the toolbar and the screen edge
let free = ctx.screen_rect().width()
- state.sidebar_reserved_width()
- 2.0 * 20.0
- 2.0 * UiState::SIDEBAR_MARGIN;
wanted.min(free).max(200.0)
}
/// Kopfzeile eines Dialogs mit Titel und optionalem Schließen-Knopf.
/// Gibt `true` zurück, wenn „Schließen“ getippt wurde.
fn dialog_header(ui: &mut egui::Ui, title: &str, closable: bool) -> bool {
@@ -4937,9 +4949,10 @@ pub fn render_ui(
// 3b. Dokumenten-Manager (Notizbücher wechseln, anlegen, umbenennen, löschen)
if state.is_document_menu_open {
let width = dialog_width(ctx, state, 420.0);
let doc_win = dialog_window(t!("Dokumenten-Manager"), state, false)
.show(ctx, |ui| {
ui.set_width(420.0);
ui.set_width(width);
touch_friendly_spacing(ui);
if dialog_header(ui, t!("📚 Notizbücher"), true) {
state.is_document_menu_open = false;
@@ -4955,13 +4968,13 @@ pub fn render_ui(
folder_breadcrumbs(ui, state, &folder);
ui.add_space(6.0);
// Neues Notizbuch oder neuer Ordner hier
ui.horizontal(|ui| {
// Neues Notizbuch oder neuer Ordner hier (narrow screens: buttons below)
ui.horizontal_wrapped(|ui| {
let text_edit = ui.add(
egui::TextEdit::singleline(&mut state.new_notebook_title_input)
.hint_text(t!("Name …"))
.margin(egui::vec2(8.0, 8.0))
.desired_width(190.0),
.desired_width(190.0_f32.min(ui.available_width())),
);
let create_btn = ui
.button(egui::RichText::new(t!("➕ Notizbuch")).strong())
@@ -5039,7 +5052,7 @@ pub fn render_ui(
let edit = ui.add(
egui::TextEdit::singleline(&mut state.renaming_title_input)
.margin(egui::vec2(8.0, 8.0))
.desired_width(260.0),
.desired_width(260.0_f32.min(ui.available_width() - 80.0)),
);
if ui.button("✔").clicked()
|| (edit.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)))
@@ -5204,9 +5217,10 @@ pub fn render_ui(
// 3c. Release- & Update-Center (Gitea Releases)
if state.is_update_dialog_open {
let width = dialog_width(ctx, state, 460.0);
let win = dialog_window(t!("Release- & Update-Center"), state, false)
.show(ctx, |ui| {
ui.set_width(460.0);
ui.set_width(width);
touch_friendly_spacing(ui);
if dialog_header(ui, t!("🚀 Updates & Versionen"), true) {
state.is_update_dialog_open = false;
@@ -5428,11 +5442,11 @@ pub fn render_ui(
.show(ui, |ui| {
ui.add_space(4.0);
ui.label(egui::RichText::new(t!("Gitea Server-URL:")).size(11.0));
ui.add(egui::TextEdit::singleline(&mut state.updater_server_url_input).desired_width(380.0));
ui.add(egui::TextEdit::singleline(&mut state.updater_server_url_input).desired_width(380.0_f32.min(ui.available_width())));
ui.add_space(4.0);
ui.label(egui::RichText::new(t!("Personal Access Token (optional für private Repos):")).size(11.0));
ui.add(egui::TextEdit::singleline(&mut state.updater_token_input).password(true).desired_width(380.0));
ui.add(egui::TextEdit::singleline(&mut state.updater_token_input).password(true).desired_width(380.0_f32.min(ui.available_width())));
ui.add_space(6.0);
if ui.button(egui::RichText::new(t!("💾 Einstellungen speichern")).size(11.5)).clicked() {
@@ -5504,9 +5518,10 @@ pub fn render_ui(
// 5. Nicht-wegklickbare Warnung bei Ladefehlern / Quarantäne (Block 1)
if let Some(warning) = notebook.load_warnings.get(&notebook.current_page().id) {
let width = dialog_width(ctx, state, 420.0);
dialog_window(t!("⚠ Datenintegritäts-Warnung"), state, true)
.show(ctx, |ui| {
ui.set_width(420.0);
ui.set_width(width);
touch_friendly_spacing(ui);
ui.horizontal(|ui| {
ui.colored_label(egui::Color32::from_rgb(255, 80, 80), "⚠");
@@ -5575,8 +5590,9 @@ pub fn render_ui(
// Notfall-/Sicherheits-Dialog bei Fehlschlag des Speicherns vor dem Beenden
if let Some(err) = &state.shutdown_error {
let mut dismiss = false;
let width = dialog_width(ctx, state, 460.0);
dialog_window(t!("⚠ Ungespeicherte Änderungen"), state, true).show(ctx, |ui| {
ui.set_width(460.0);
ui.set_width(width);
touch_friendly_spacing(ui);
ui.horizontal(|ui| {
ui.colored_label(egui::Color32::from_rgb(255, 80, 80), "⚠");
@@ -5758,6 +5774,30 @@ mod tests {
assert_eq!(PEN_WIDTH_PRESETS[3].0, 1.2);
}
#[test]
fn test_notebook_dialog_fits_beside_the_toolbar_on_a_phone() {
// Phone in portrait (Issue #50): the dialog was wider than the screen
let mut state = UiState::new();
state.is_document_menu_open = true;
state.available_notebooks = vec![NotebookSummary {
id: "nb-1".to_string(),
title: "Default notebook".to_string(),
page_count: 1,
modified_at: 100,
status: crate::storage::NotebookStatus::Normal,
error: None,
}];
state.current_notebook_id = "nb-1".to_string();
let screen = egui::vec2(412.0, 900.0);
let ctx = render_frames_sized(&mut state, &Notebook::new(), 8, screen);
let dialog = ctx
.memory(|m| m.area_rect(egui::Id::new(t!("Dokumenten-Manager"))))
.unwrap();
let toolbar = state.toolbar_rect.unwrap();
assert!(dialog.left() >= toolbar.right(), "{dialog:?} {toolbar:?}");
assert!(dialog.right() <= screen.x, "{dialog:?}");
}
#[test]
fn test_document_manager_ui_actions() {
let mut state = UiState::new();
+4
View File
@@ -22,6 +22,10 @@ docs of the original crate were removed.
the app (`AboutToWait`), also when the events belong to another queue on the same connection.
octotablet's pen events live on such a queue and only `dispatch_pending` it, so before, pen
strokes waited until something else woke the loop (Issue #53).
- `src/platform_impl/linux/wayland/seat/touch/mod.rs`: a touch lift (`wl_touch.up`) is handed
on right away instead of waiting for the next `wl_touch.frame`. On a GNOME laptop the lift
of a swipe only arrived with the next touch, which fits a frame sent before the lift: the page did not glide after a
swipe (Issue #28), and a ruler moved with the finger followed the hovering pen (Issue #55).
- `Cargo.toml`: `[lints.rust] warnings = "allow"`, because a path dependency is not built with
capped lints like a crates.io dependency.
@@ -2,14 +2,15 @@
use sctk::reexports::client::protocol::wl_seat::WlSeat;
use sctk::reexports::client::protocol::wl_surface::WlSurface;
use sctk::reexports::client::protocol::wl_touch::WlTouch;
use sctk::reexports::client::{Connection, Proxy, QueueHandle};
use sctk::reexports::client::protocol::wl_touch::{self, WlTouch};
use sctk::reexports::client::{Connection, Dispatch, Proxy, QueueHandle};
use sctk::reexports::csd_frame::FrameClick;
use std::time::Duration;
use sctk::compositor::SurfaceData;
use sctk::seat::touch::{TouchData, TouchHandler};
use sctk::seat::SeatState;
use crate::dpi::LogicalPosition;
use crate::event::{Touch, TouchPhase, WindowEvent};
@@ -286,4 +287,35 @@ impl TouchDataExt for WlTouch {
}
}
sctk::delegate_touch!(WinitState);
// ink-notes patch: sctk holds every touch event back until the compositor sends the
// `wl_touch.frame` that closes its group. On a GNOME laptop the lift of a swipe only arrived
// together with the next touch, which fits a frame sent before the matching `up`: the page could
// not glide (Issue #28) and a ruler moved with the finger followed the hovering pen (Issue #55).
// A lift is now handed on right away, after the events that came before it.
impl Dispatch<WlTouch, TouchData> for WinitState {
fn event(
state: &mut Self,
touch: &WlTouch,
event: wl_touch::Event,
data: &TouchData,
conn: &Connection,
qh: &QueueHandle<Self>,
) {
if let wl_touch::Event::Up { serial, time, id } = event {
// Hand on what sctk still holds, then the lift itself
<SeatState as Dispatch<WlTouch, TouchData, Self>>::event(
state,
touch,
wl_touch::Event::Frame,
data,
conn,
qh,
);
state.up(conn, qh, touch, serial, time, id);
} else {
<SeatState as Dispatch<WlTouch, TouchData, Self>>::event(
state, touch, event, data, conn, qh,
);
}
}
}