mirror of
https://github.com/neon443/DesktopGoose2.git
synced 2026-03-11 13:26:18 +00:00
add goosewindow
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
A9B30BD82E73040800EB41F9 /* DesktopGoose2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DesktopGoose2.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
A9B30BD82E73040800EB41F9 /* DesktopDuck.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DesktopDuck.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
A9B30BD92E73040800EB41F9 /* Products */ = {
|
A9B30BD92E73040800EB41F9 /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A9B30BD82E73040800EB41F9 /* DesktopGoose2.app */,
|
A9B30BD82E73040800EB41F9 /* DesktopDuck.app */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -48,9 +48,9 @@
|
|||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
A9B30BD72E73040800EB41F9 /* DesktopGoose2 */ = {
|
A9B30BD72E73040800EB41F9 /* DesktopDuck */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = A9B30BE42E73040900EB41F9 /* Build configuration list for PBXNativeTarget "DesktopGoose2" */;
|
buildConfigurationList = A9B30BE42E73040900EB41F9 /* Build configuration list for PBXNativeTarget "DesktopDuck" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
A9B30BD42E73040800EB41F9 /* Sources */,
|
A9B30BD42E73040800EB41F9 /* Sources */,
|
||||||
A9B30BD52E73040800EB41F9 /* Frameworks */,
|
A9B30BD52E73040800EB41F9 /* Frameworks */,
|
||||||
@@ -63,11 +63,11 @@
|
|||||||
fileSystemSynchronizedGroups = (
|
fileSystemSynchronizedGroups = (
|
||||||
A9B30BDA2E73040800EB41F9 /* DesktopGoose2 */,
|
A9B30BDA2E73040800EB41F9 /* DesktopGoose2 */,
|
||||||
);
|
);
|
||||||
name = DesktopGoose2;
|
name = DesktopDuck;
|
||||||
packageProductDependencies = (
|
packageProductDependencies = (
|
||||||
);
|
);
|
||||||
productName = DesktopGoose2;
|
productName = DesktopGoose2;
|
||||||
productReference = A9B30BD82E73040800EB41F9 /* DesktopGoose2.app */;
|
productReference = A9B30BD82E73040800EB41F9 /* DesktopDuck.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = A9B30BD32E73040800EB41F9 /* Build configuration list for PBXProject "DesktopGoose2" */;
|
buildConfigurationList = A9B30BD32E73040800EB41F9 /* Build configuration list for PBXProject "DesktopDuck" */;
|
||||||
developmentRegion = en;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
A9B30BD72E73040800EB41F9 /* DesktopGoose2 */,
|
A9B30BD72E73040800EB41F9 /* DesktopDuck */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 15.5;
|
MACOSX_DEPLOYMENT_TARGET = 15.5;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DesktopGoose2;
|
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DesktopDuck;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
REGISTER_APP_GROUPS = YES;
|
REGISTER_APP_GROUPS = YES;
|
||||||
SDKROOT = auto;
|
SDKROOT = auto;
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||||
MACOSX_DEPLOYMENT_TARGET = 15.5;
|
MACOSX_DEPLOYMENT_TARGET = 15.5;
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DesktopGoose2;
|
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DesktopDuck;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
REGISTER_APP_GROUPS = YES;
|
REGISTER_APP_GROUPS = YES;
|
||||||
SDKROOT = auto;
|
SDKROOT = auto;
|
||||||
@@ -322,7 +322,7 @@
|
|||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
A9B30BD32E73040800EB41F9 /* Build configuration list for PBXProject "DesktopGoose2" */ = {
|
A9B30BD32E73040800EB41F9 /* Build configuration list for PBXProject "DesktopDuck" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
A9B30BE22E73040900EB41F9 /* Debug */,
|
A9B30BE22E73040900EB41F9 /* Debug */,
|
||||||
@@ -331,7 +331,7 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
A9B30BE42E73040900EB41F9 /* Build configuration list for PBXNativeTarget "DesktopGoose2" */ = {
|
A9B30BE42E73040900EB41F9 /* Build configuration list for PBXNativeTarget "DesktopDuck" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
A9B30BE52E73040900EB41F9 /* Debug */,
|
A9B30BE52E73040900EB41F9 /* Debug */,
|
||||||
@@ -12,6 +12,9 @@ struct DesktopGoose2App: App {
|
|||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
ContentView()
|
ContentView()
|
||||||
|
.onAppear {
|
||||||
|
let x = GooseWindow()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
47
DesktopGoose2/GooseWindow.swift
Normal file
47
DesktopGoose2/GooseWindow.swift
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
//
|
||||||
|
// GooseWindow.swift
|
||||||
|
// DesktopGoose2
|
||||||
|
//
|
||||||
|
// Created by neon443 on 11/09/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class GooseWindow {
|
||||||
|
private var window: NSWindow
|
||||||
|
var shown: Bool = false
|
||||||
|
private var x = 1
|
||||||
|
private var time: Timer?
|
||||||
|
|
||||||
|
init() {
|
||||||
|
self.window = NSWindow(
|
||||||
|
contentRect: CGRect(
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: NSScreen.main!.frame.width,
|
||||||
|
height: NSScreen.main!.frame.width
|
||||||
|
),
|
||||||
|
styleMask: .borderless,
|
||||||
|
backing: .buffered,
|
||||||
|
defer: false
|
||||||
|
)
|
||||||
|
window.backgroundColor = .init(srgbRed: 1, green: 1, blue: 1, alpha: 0.1)
|
||||||
|
window.contentView = NSImageView()
|
||||||
|
window.isOpaque = false
|
||||||
|
window.level = NSWindow.Level.screenSaver + 1
|
||||||
|
window.ignoresMouseEvents = true
|
||||||
|
window.hasShadow = false
|
||||||
|
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllSpaces.union(.canJoinAllApplications).union(.stationary)
|
||||||
|
|
||||||
|
showHide()
|
||||||
|
}
|
||||||
|
|
||||||
|
func showHide() {
|
||||||
|
if shown {
|
||||||
|
window.orderOut(nil)
|
||||||
|
} else {
|
||||||
|
window.orderFront(nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user