Skip to content

Commit 7f42b47

Browse files
committed
fix(linux): window drag stuck mouse bug
- Fixed critical bug where dragging custom title bar on Linux caused mouse to get stuck in drag mode, preventing any other interaction - Root cause: egui's widget-level drag tracking desynchronized with window manager after ViewportCommand::StartDrag was sent - Solution: bypass egui's drag state machine entirely using raw input detection (primary_pressed()) for immediate window drag initiation Release v0.2.5.2: - Updated README.md with v0.2.5.2 release notes - Updated CHANGELOG.md with full v0.2.5.2 release details - Updated ROADMAP.md to mark v0.2.5.2 as released - Synced all features/fixes from ROADMAP to CHANGELOG
1 parent e0fbcfc commit 7f42b47

5 files changed

Lines changed: 82 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
*No unreleased changes.*
11+
12+
## [0.2.5.2] - 2026-01-20
13+
14+
### Added
15+
16+
#### New Features
17+
- **Delete Line shortcut** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Cmd/Ctrl+D deletes current line (configurable in settings) - thanks [@abcd-ca](https://github.com/abcd-ca)!
18+
- **Move Line Up/Down** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Alt+Up/Down swaps current line with adjacent line - thanks [@abcd-ca](https://github.com/abcd-ca)!
19+
- **macOS file type associations** ([#30](https://github.com/OlaProeis/Ferrite/pull/30)) - Ferrite appears in Finder's "Open With" menu for .md, .json, .yaml, .toml, .txt files - thanks [@abcd-ca](https://github.com/abcd-ca)!
20+
21+
#### Internationalization
22+
- **I18n audit & cleanup** - Comprehensive audit of hardcoded strings, replacement with translation keys
23+
- **Orphaned key removal** - Removed ~200 unused translation keys from locale files
24+
- **Locale file sync** - All locale files now have consistent structure matching en.yaml
25+
- **New language support** - Added Estonian and Norwegian Bokmål via Weblate community translations
26+
1027
### Fixed
1128

29+
#### Bug Fixes
1230
- **Ctrl+X cutting entire document** - Fixed egui bug where Ctrl+X with no text selection would cut the entire document. Now correctly does nothing when nothing is selected.
31+
- **Linux window drag stuck mouse** - Fixed critical bug where dragging the custom title bar on Linux caused the mouse to get "stuck" in drag mode. Root cause: egui's widget-level drag tracking desynchronized with the window manager after `ViewportCommand::StartDrag`. Fix bypasses egui's drag state machine entirely, using raw input detection (`primary_pressed()`) for immediate, reliable window drag initiation.
32+
- **Split mode cursor position** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Line operations now work correctly in Split view; rendered pane no longer overwrites cursor position - thanks [@abcd-ca](https://github.com/abcd-ca)!
33+
- **macOS modifier tooltips** ([#28](https://github.com/OlaProeis/Ferrite/pull/28), [#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Tooltips now show "Cmd+E" on macOS instead of hardcoded "Ctrl+E" - thanks [@abcd-ca](https://github.com/abcd-ca)!
34+
- **Semantic minimap highlight accuracy** - Use byte offsets matching search behavior for correct highlight positioning
35+
36+
> **Note:** Opening files via "Open With" or dragging onto app icon not yet supported on macOS due to [winit#1751](https://github.com/rust-windowing/winit/issues/1751). Workaround: use `open -a Ferrite file.md` or File > Open.
1337
1438
## [0.2.5.1] - 2026-01-17
1539

@@ -380,6 +404,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
380404

381405
## Version History
382406

407+
- **0.2.5.2** - Delete Line shortcut, Move Line Up/Down, macOS file associations, Linux window drag fix, I18n cleanup, new language support
383408
- **0.2.5.1** - Multi-encoding support, memory optimization (250MB → 60-80MB), CPU optimization (10% → <1% idle), cursor positioning improvements, Intel Mac CPU fix, bug fixes
384409
- **0.2.5** - Mermaid refactor, CSV viewer, semantic minimap, i18n, CJK indentation, custom fonts, snippets, TOC generation, drag-drop images, document statistics, main menu redesign, split view editing, bug fixes
385410
- **0.2.3** - Editor productivity release (Go to Line, Duplicate Line, Move Line, Auto-close, Smart Paste, Line Width)
@@ -388,6 +413,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
388413
- **0.2.0** - Major feature release (Split View, Mermaid, Minimap, Git integration, and more)
389414
- **0.1.0** - Initial public release
390415

416+
[0.2.5.2]: https://github.com/OlaProeis/Ferrite/compare/v0.2.5-hotfix.1...v0.2.5-hotfix.2
391417
[0.2.5.1]: https://github.com/OlaProeis/Ferrite/compare/v0.2.5...v0.2.5-hotfix.1
392418
[0.2.5]: https://github.com/OlaProeis/Ferrite/compare/v0.2.3...v0.2.5
393419
[0.2.3]: https://github.com/OlaProeis/Ferrite/compare/v0.2.2...v0.2.3

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ferrite"
3-
version = "0.2.5-hotfix.1"
3+
version = "0.2.5-hotfix.2"
44
edition = "2021"
55
description = "A fast, lightweight text editor for Markdown, JSON, and more"
66
repository = "https://github.com/OlaProeis/Ferrite"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
A fast, lightweight text editor for Markdown, JSON, YAML, and TOML files. Built with Rust and egui for a native, responsive experience.
1717

18-
> ⚠️ **Platform Note:** Ferrite has been primarily developed and tested on **Windows**. While it should work on Linux and macOS, these platforms have not been extensively tested. If you encounter issues, please [report them](https://github.com/OlaProeis/Ferrite/issues).
18+
> ⚠️ **Platform Note:** Ferrite is developed and tested on **Windows** and **Linux**. macOS support is experimental. If you encounter issues, please [report them](https://github.com/OlaProeis/Ferrite/issues).
1919
2020
<details>
2121
<summary><strong>🛡️ Antivirus False Positives</strong></summary>
@@ -84,9 +84,9 @@ This transparency is intentional — I want others to learn from (and improve up
8484
|------------|------------|----------|
8585
| ![Raw Editor](assets/screenshots/raw-dark.png) | ![Split View](assets/screenshots/split-dark.png) | ![Zen Mode](assets/screenshots/zen-dark.png) |
8686

87-
> **v0.2.5.1 Released:** Multi-encoding file support, **major memory optimization** (250MB → 60-80MB idle), **CPU optimization** (10% → <1% idle), improved cursor positioning, and more. See [CHANGELOG.md](CHANGELOG.md) for full details.
87+
> **v0.2.5.2 Released:** Delete Line shortcut (Ctrl+D), Move Line Up/Down (Alt+↑/↓), **Linux window drag fix**, macOS file associations, I18n cleanup with Estonian & Norwegian Bokmål support. See [CHANGELOG.md](CHANGELOG.md) for full details.
8888
89-
> 📦 **v0.2.5 Highlights:** Native CSV/TSV viewer with rainbow columns, Mermaid diagram improvements (YAML frontmatter, classDef styling, subgraphs), semantic minimap, i18n with Weblate, split view dual editing, drag & drop images, TOC generation, snippets, and custom fonts.
89+
> 📦 **v0.2.5.1 Highlights:** Multi-encoding file support, major memory optimization (250MB → 60-80MB idle), CPU optimization (10% → <1% idle), improved cursor positioning, and Intel Mac CPU fix.
9090
9191
## Features
9292

ROADMAP.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,22 @@ Fixed 100% CPU usage on Intel Macs in Rendered mode:
157157

158158
---
159159

160-
### v0.2.5-hotfix2 (In Progress) - Editor Shortcuts, macOS & I18n
160+
### v0.2.5.2 (Released) - Editor Shortcuts, macOS, Linux & I18n
161161

162-
> **Status:** In Progress
162+
> **Status:** Released (2026-01-20)
163163
164-
Point release with new keyboard shortcuts, macOS improvements, and internationalization cleanup.
164+
Point release with new keyboard shortcuts, macOS improvements, Linux bug fixes, and internationalization cleanup.
165165

166166
#### New Features
167167
- [x] **Delete Line shortcut** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Cmd/Ctrl+D deletes current line (configurable in settings) - thanks [@abcd-ca](https://github.com/abcd-ca)!
168-
- [x] **Move Line Up/Down** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Alt+Up/Down swaps current line with adjacent line - thanks [@abcd-ca](https://github.com/abcd-ca)!
168+
- [x] **Move Line Up/Down** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Alt+Up/Down swaps current line with adjacent lines also in split view - thanks [@abcd-ca](https://github.com/abcd-ca)!
169169
- [x] **macOS file type associations** ([#30](https://github.com/OlaProeis/Ferrite/pull/30)) - Ferrite appears in Finder's "Open With" menu for .md, .json, .yaml, .toml, .txt files - thanks [@abcd-ca](https://github.com/abcd-ca)!
170170

171171
> **Note:** Opening files via "Open With" or dragging onto app icon not yet supported due to [winit#1751](https://github.com/rust-windowing/winit/issues/1751). Workaround: use `open -a Ferrite file.md` or File > Open.
172172
173173
#### Bug Fixes
174174
- [x] **Ctrl+X cutting entire document** - Fixed egui bug where Ctrl+X with no selection would cut everything. Filter out `Event::Cut` when nothing is selected.
175+
- [x] **Linux window drag stuck mouse** - Fixed critical bug where dragging the custom title bar on Linux caused the mouse to get "stuck" in drag mode. Bypassed egui's drag state machine using raw input detection for reliable window drag initiation.
175176
- [x] **Split mode cursor position** ([#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Line operations now work correctly in Split view; rendered pane no longer overwrites cursor position - thanks [@abcd-ca](https://github.com/abcd-ca)!
176177
- [x] **macOS modifier tooltips** ([#28](https://github.com/OlaProeis/Ferrite/pull/28), [#29](https://github.com/OlaProeis/Ferrite/pull/29)) - Tooltips now show "Cmd+E" on macOS instead of hardcoded "Ctrl+E" - thanks [@abcd-ca](https://github.com/abcd-ca)!
177178
- [x] **Semantic minimap highlight accuracy** - Use byte offsets matching search behavior for correct highlight positioning
@@ -533,7 +534,17 @@ Extract `FerriteEditor` as a standalone, framework-agnostic text editing library
533534

534535
## Completed ✅
535536

536-
### v0.2.5.1 (Current Release) - Memory, Encoding & Polish
537+
### v0.2.5.2 (Current Release) - Editor Shortcuts, macOS, Linux & I18n
538+
539+
See [CHANGELOG.md](CHANGELOG.md) for full release notes. Key highlights:
540+
- **Delete Line shortcut** - Cmd/Ctrl+D deletes current line
541+
- **Move Line Up/Down** - Alt+↑/↓ swaps lines
542+
- **macOS file type associations** - Ferrite appears in Finder's "Open With"
543+
- **Linux window drag fix** - Fixed stuck mouse when dragging custom title bar
544+
- **I18n cleanup** - Comprehensive audit, ~200 orphaned keys removed
545+
- **New languages** - Estonian and Norwegian Bokmål
546+
547+
### v0.2.5.1 - Memory, Encoding & Polish
537548

538549
See [CHANGELOG.md](CHANGELOG.md) for full release notes. Key highlights:
539550
- **Multi-encoding file support** - Auto-detect and preserve encodings (Latin-1, Shift-JIS, Windows-1252, etc.)

src/app.rs

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,20 +1289,52 @@ impl FerriteApp {
12891289
available.min,
12901290
egui::vec2(drag_width, available.height()),
12911291
);
1292-
let drag_response = ui.allocate_rect(drag_rect, egui::Sense::click_and_drag());
1292+
1293+
// IMPORTANT: We use Sense::hover() and handle drag detection manually via
1294+
// raw input state. This is necessary because:
1295+
//
1296+
// 1. When StartDrag is sent, the window manager takes over the drag operation
1297+
// 2. egui doesn't receive the mouse release event (WM handles it)
1298+
// 3. egui's widget interaction state gets confused, thinking the widget
1299+
// is still being interacted with
1300+
// 4. On the next click, drag_started() doesn't fire because egui thinks
1301+
// we're continuing an existing interaction
1302+
//
1303+
// By using raw input state (primary_pressed), we bypass egui's widget-level
1304+
// tracking entirely and get reliable drag detection every time.
1305+
let drag_response = ui.allocate_rect(drag_rect, egui::Sense::hover());
1306+
1307+
// Get raw pointer state - this is always accurate regardless of widget state
1308+
let (primary_pressed, double_clicked, pointer_pos) = ctx.input(|i| (
1309+
i.pointer.primary_pressed(),
1310+
i.pointer.button_double_clicked(egui::PointerButton::Primary),
1311+
i.pointer.interact_pos(),
1312+
));
1313+
1314+
// Check if pointer is in the drag area
1315+
let pointer_in_drag_area = pointer_pos
1316+
.map(|pos| drag_rect.contains(pos))
1317+
.unwrap_or(false);
12931318

12941319
// Handle double-click to maximize/restore
1295-
if drag_response.double_clicked() {
1320+
if double_clicked && pointer_in_drag_area {
12961321
ctx.send_viewport_cmd(egui::ViewportCommand::Maximized(!is_maximized));
12971322
}
12981323

12991324
// Handle drag to move window (but not if we're in a resize zone)
1300-
// The resize handling runs before UI rendering and sets the resize state
1325+
//
1326+
// We use primary_pressed() which is only true on the FRAME the button
1327+
// is pressed down. This ensures StartDrag is sent exactly once per click,
1328+
// preventing the "mouse stuck" bug on Linux.
13011329
let is_in_resize = self.window_resize_state.current_direction().is_some()
13021330
|| self.window_resize_state.is_resizing();
1303-
if drag_response.dragged() && !is_in_resize {
1331+
1332+
if primary_pressed && pointer_in_drag_area && !is_in_resize {
13041333
ctx.send_viewport_cmd(egui::ViewportCommand::StartDrag);
13051334
}
1335+
1336+
// Still use the response for hover effects if needed
1337+
let _ = drag_response;
13061338

13071339
// Window control buttons (right-to-left)
13081340
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {

0 commit comments

Comments
 (0)