mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 19:47:43 +01:00
chore: allow(deprecated) to silence warnings (#931)
This commit is contained in:
@@ -1,9 +1,18 @@
|
|||||||
//! credits to: https://github.com/ayangweb/ayangweb-EcoPaste/blob/169323dbe6365ffe4abb64d867439ed2ea84c6d1/src-tauri/src/core/setup/mac.rs
|
//! credits to: https://github.com/ayangweb/ayangweb-EcoPaste/blob/169323dbe6365ffe4abb64d867439ed2ea84c6d1/src-tauri/src/core/setup/mac.rs
|
||||||
|
//!
|
||||||
|
//! # allow(deprecated)
|
||||||
|
//!
|
||||||
|
//! This file uses some deprecated interfaces from the `tauri_nspanel` crate. The
|
||||||
|
//! only way to get rid of them is to bump that crate (v2->v2.1), we are not going
|
||||||
|
//! to do that because doing that bump requires a re-write of the code in this
|
||||||
|
//! file and v2 has been working well. So we allow these deprecated interfaces.
|
||||||
|
|
||||||
use crate::common::MAIN_WINDOW_LABEL;
|
use crate::common::MAIN_WINDOW_LABEL;
|
||||||
use objc2_app_kit::NSNonactivatingPanelMask;
|
use objc2_app_kit::NSNonactivatingPanelMask;
|
||||||
use tauri::{AppHandle, Emitter, EventTarget, WebviewWindow};
|
use tauri::{AppHandle, Emitter, EventTarget, WebviewWindow};
|
||||||
use tauri_nspanel::{WebviewWindowExt, cocoa::appkit::NSWindowCollectionBehavior, panel_delegate};
|
#[allow(deprecated)]
|
||||||
|
use tauri_nspanel::cocoa::appkit::NSWindowCollectionBehavior;
|
||||||
|
use tauri_nspanel::{WebviewWindowExt, panel_delegate};
|
||||||
|
|
||||||
const WINDOW_FOCUS_EVENT: &str = "tauri://focus";
|
const WINDOW_FOCUS_EVENT: &str = "tauri://focus";
|
||||||
const WINDOW_BLUR_EVENT: &str = "tauri://blur";
|
const WINDOW_BLUR_EVENT: &str = "tauri://blur";
|
||||||
@@ -32,6 +41,7 @@ pub fn platform(
|
|||||||
panel.set_floating_panel(true);
|
panel.set_floating_panel(true);
|
||||||
|
|
||||||
// Open the window in the active workspace and full screen
|
// Open the window in the active workspace and full screen
|
||||||
|
#[allow(deprecated)]
|
||||||
panel.set_collection_behaviour(
|
panel.set_collection_behaviour(
|
||||||
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace
|
NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace
|
||||||
| NSWindowCollectionBehavior::NSWindowCollectionBehaviorStationary
|
| NSWindowCollectionBehavior::NSWindowCollectionBehaviorStationary
|
||||||
@@ -39,6 +49,7 @@ pub fn platform(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Define the panel's delegate to listen to panel window events
|
// Define the panel's delegate to listen to panel window events
|
||||||
|
#[allow(deprecated)]
|
||||||
let delegate = panel_delegate!(EcoPanelDelegate {
|
let delegate = panel_delegate!(EcoPanelDelegate {
|
||||||
window_did_become_key,
|
window_did_become_key,
|
||||||
window_did_resign_key,
|
window_did_resign_key,
|
||||||
|
|||||||
Reference in New Issue
Block a user