Skip to content

Commit

Permalink
Hide dock icon on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed May 1, 2024
1 parent 6851fbb commit f14a06a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bewcloud-sync",
"private": true,
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
81 changes: 69 additions & 12 deletions src-tauri/Cargo.lock

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

3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bewcloud-sync"
version = "0.0.3"
version = "0.0.4"
description = "Desktop Sync Client for bewCloud"
authors = ["Bruno Bernardino"]
edition = "2021"
Expand All @@ -16,6 +16,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
async-std = "1.12.0"
chrono = "0.4.19"
cocoa = "0.25.0"

[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
Expand Down
7 changes: 7 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,13 @@ fn main() {
// Keeps app running when regularly "closed"
tauri::RunEvent::ExitRequested { api, .. } => {
api.prevent_exit();

use cocoa::appkit::{NSApp, NSApplication, NSApplicationActivationPolicy::*};

unsafe {
let app = NSApp();
app.setActivationPolicy_(NSApplicationActivationPolicyAccessory);
}
}

_ => {}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "bewCloud Desktop Sync",
"version": "0.0.3"
"version": "0.0.4"
},
"tauri": {
"allowlist": {
Expand Down

0 comments on commit f14a06a

Please sign in to comment.