Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

A ZoomIt-like real-time screen annotation tool for Linux/Wayland, written in Rust.

Docs: https://wayscriber.com/docs/

<details>
<summary>Screenshots</summary>

Expand Down Expand Up @@ -38,6 +40,7 @@ https://github.com/user-attachments/assets/4b5ed159-8d1c-44cb-8fe4-e0f2ea41d818
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [Additional Information](#additional-information)
- [Docs](https://wayscriber.com/docs/)

---

Expand Down Expand Up @@ -216,7 +219,7 @@ sudo apt-get install wl-clipboard grim slurp # Debian/Ubuntu
sudo dnf install wl-clipboard grim slurp # Fedora
```

See **[docs/SETUP.md](docs/SETUP.md)** for detailed walkthroughs.
See https://wayscriber.com/docs/ for the latest documentation.

---

Expand Down Expand Up @@ -427,7 +430,7 @@ max_thickness = 8.0

To build without tablet support: `cargo build --release --no-default-features`

See **[docs/CONFIG.md](docs/CONFIG.md)** for the full reference.
See https://wayscriber.com/docs/ for the full reference.

---

Expand Down
11 changes: 7 additions & 4 deletions src/backend/wayland/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ use std::{
const TABLET_MANAGER_MAX_VERSION: u32 = 2;
use std::os::fd::AsRawFd;
use wayland_client::{
Connection, EventQueue, backend::{ReadEventsGuard, WaylandError},
Connection, EventQueue,
backend::{ReadEventsGuard, WaylandError},
globals::registry_queue_init,
};
#[cfg(tablet)]
Expand Down Expand Up @@ -165,11 +166,13 @@ fn dispatch_with_timeout(
return Ok(());
}

event_queue.flush().map_err(|e| anyhow::anyhow!(e.to_string()))?;
event_queue
.flush()
.map_err(|e| anyhow::anyhow!(e.to_string()))?;

if let Some(guard) = event_queue.prepare_read() {
let _ = read_events_with_timeout(guard, timeout)
.map_err(|e| anyhow::anyhow!(e.to_string()))?;
let _ =
read_events_with_timeout(guard, timeout).map_err(|e| anyhow::anyhow!(e.to_string()))?;
event_queue
.dispatch_pending(state)
.map_err(|e| anyhow::anyhow!(e.to_string()))?;
Expand Down
7 changes: 2 additions & 5 deletions src/backend/wayland/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ impl WaylandState {
}

pub(super) fn ui_animation_timeout(&self, now: Instant) -> Option<Duration> {
if self.ui_animation_interval.is_none() {
return None;
}
self.ui_animation_interval?;
self.ui_animation_next_tick
.map(|next| next.saturating_duration_since(now))
}
Expand All @@ -260,8 +258,7 @@ impl WaylandState {
if self.ui_animation_interval.is_none() {
return false;
}
self.ui_animation_next_tick
.is_some_and(|next| now >= next)
self.ui_animation_next_tick.is_some_and(|next| now >= next)
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/backend/wayland/state/toolbar/drag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,10 @@ impl WaylandState {
top_base_x
);
}
let margins_changed =
self.data.last_applied_top_margin != Some(top_margin_left)
|| self.data.last_applied_top_margin_top != Some(top_margin_top)
|| self.data.last_applied_side_margin != Some(side_margin_top)
|| self.data.last_applied_side_margin_left != Some(side_margin_left);
let margins_changed = self.data.last_applied_top_margin != Some(top_margin_left)
|| self.data.last_applied_top_margin_top != Some(top_margin_top)
|| self.data.last_applied_side_margin != Some(side_margin_top)
|| self.data.last_applied_side_margin_left != Some(side_margin_left);
if !margins_changed {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/backend/wayland/state/toolbar/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ impl WaylandState {
self.data.inline_side_hits.clear();
self.data.inline_top_rect = None;
self.data.inline_side_rect = None;
}

pub(super) fn clear_inline_toolbar_hover(&mut self) {
self.data.inline_top_hover = None;
self.data.inline_side_hover = None;
}
Expand All @@ -17,6 +20,7 @@ impl WaylandState {
) {
if !self.inline_toolbars_active() || !self.toolbar.is_visible() {
self.clear_inline_toolbar_hits();
self.clear_inline_toolbar_hover();
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/backend/wayland/state/toolbar/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ impl WaylandState {

if !any_visible {
self.clear_inline_toolbar_hits();
self.clear_inline_toolbar_hover();
}

self.refresh_keyboard_interactivity();
Expand Down
12 changes: 6 additions & 6 deletions src/backend/wayland/toolbar/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ impl ToolbarLayoutSpec {
pub(super) const TOP_START_X: f64 = 16.0;
pub(super) const TOP_HANDLE_SIZE: f64 = 18.0;
pub(super) const TOP_HANDLE_Y: f64 = 10.0;
pub(super) const TOP_ICON_BUTTON: f64 = 42.0;
pub(super) const TOP_ICON_BUTTON: f64 = 44.0;
pub(super) const TOP_ICON_BUTTON_Y: f64 = 6.0;
pub(super) const TOP_ICON_SIZE: f64 = 26.0;
pub(super) const TOP_ICON_SIZE: f64 = 28.0;
pub(super) const TOP_ICON_FILL_HEIGHT: f64 = 18.0;
pub(super) const TOP_ICON_FILL_OFFSET: f64 = 2.0;
pub(super) const TOP_TEXT_BUTTON_W: f64 = 60.0;
Expand Down Expand Up @@ -90,9 +90,9 @@ impl ToolbarLayoutSpec {
pub(super) const SIDE_TOGGLE_GAP: f64 = 6.0;
pub(super) const SIDE_CUSTOM_SECTION_HEIGHT: f64 = 120.0;
pub(super) const SIDE_STEP_HEADER_HEIGHT: f64 = 20.0;
pub(super) const SIDE_PRESET_CARD_HEIGHT: f64 = 88.0;
pub(super) const SIDE_PRESET_SLOT_SIZE: f64 = 30.0;
pub(super) const SIDE_PRESET_SLOT_GAP: f64 = 6.0;
pub(super) const SIDE_PRESET_CARD_HEIGHT: f64 = 100.0;
pub(super) const SIDE_PRESET_SLOT_SIZE: f64 = 40.0;
pub(super) const SIDE_PRESET_SLOT_GAP: f64 = 8.0;
pub(super) const SIDE_PRESET_ROW_OFFSET_Y: f64 = 24.0;
pub(super) const SIDE_PRESET_ACTION_GAP: f64 = 6.0;
pub(super) const SIDE_PRESET_ACTION_HEIGHT: f64 = 20.0;
Expand Down Expand Up @@ -1172,7 +1172,7 @@ mod tests {
let mut state = create_test_input_state();
state.toolbar_use_icons = true;
let snapshot = snapshot_from_state(&state);
assert_eq!(top_size(&snapshot), (736, 80));
assert_eq!(top_size(&snapshot), (758, 80));

state.toolbar_use_icons = false;
let snapshot = snapshot_from_state(&state);
Expand Down
Loading