Skip to content
Open
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v0.6.29

### Bug Fixes
- fix: stabilize Linux tray panel close by @symonbaikov

---

### Changelog

**Full Changelog**: [v0.6.28...v0.6.29](https://github.com/openusage-community/openusage/compare/v0.6.28...v0.6.29)

- [72804ea](https://github.com/openusage-community/openusage/commit/72804ea7ca0dd84a223970709d243b7f9ef640b2) fix: stabilize Linux tray panel close by @symonbaikov

## v0.6.28

### Chores
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openusage",
"private": true,
"version": "0.6.28",
"version": "0.6.29",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openusage"
version = "0.6.28"
version = "0.6.29"
description = "OpenUsage is an open source AI subscription limit tracker"
authors = ["Robin Ebers"]
edition = "2024"
Expand Down Expand Up @@ -43,7 +43,7 @@ aes-gcm = "0.10.3"
sha2 = "0.11"

[target.'cfg(target_os = "linux")'.dependencies]
x11rb = "0.13.2"
gtk = "0.18"

[target.'cfg(target_os = "macos")'.dependencies]
# nspanel powers the floating menubar panel; macOS-only.
Expand Down
17 changes: 2 additions & 15 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,21 +556,8 @@ pub fn run() {

use tauri::Manager;

#[cfg(not(target_os = "macos"))]
if let Some(window) = app.get_webview_window("main") {
let win = window.clone();
window.on_window_event(move |event| {
if let tauri::WindowEvent::Focused(false) = event {
let is_visible = match win.is_visible() {
Ok(true) => true,
Ok(false) | Err(_) => return,
};
if crate::panel::should_hide_for_window_focus_loss_now(is_visible) {
let _ = win.hide();
}
}
});
}
#[cfg(target_os = "linux")]
panel::init(app.handle())?;

let version = app.package_info().version.to_string();
log::info!("OpenUsage v{} starting", version);
Expand Down
8 changes: 2 additions & 6 deletions src-tauri/src/panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,17 +650,13 @@ mod platform {
panel.hide();
}
}

pub fn should_hide_for_window_focus_loss_now(_is_visible: bool) -> bool {
true
}
}

#[cfg(not(target_os = "macos"))]
use crate::panel_non_macos as platform;

use platform::apply_panel_position;
pub use platform::{
hide_panel, init, should_hide_for_window_focus_loss_now, show_panel,
show_panel_at_logical_anchor, toggle_panel, toggle_panel_at_tray_icon,
hide_panel, init, show_panel, show_panel_at_logical_anchor, toggle_panel,
toggle_panel_at_tray_icon,
};
Loading
Loading