Replies: 2 comments 3 replies
-
In order to call the macOS libraries without OBJC you’ll need to use purego. However, I don’t think ebitengine exposes the native macOS window to be able to change that property. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I tried capturing the window using Objective-C and changing the property with the function below and several variations of it; I can get the window, but changing the property does not have any effect. #cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
void setWindowCollectionBehavior() {
dispatch_async(dispatch_get_main_queue(), ^{
NSApplication *app = [NSApplication sharedApplication];
NSWindow *window = app.mainWindow;
[window setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
});
} Does anyone have any different suggestions? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created a program that aims to place a transparent, floating, and borderless window covering the entire screen. Then, I can send commands via Unix Domain Socket and draw on the screen (imitating the behavior of drawing on the screen with BASIC as we did in the 8-bit era.). It would be effortless to do this using Ebitengine, but I ran into a problem; I want the program to be visible in all "spaces", and that's the only thing I couldn't do in Ebitengine.
So, I wrote a small snippet of code in Objective-C to test the concept, which worked perfectly.
The only property I need is
NSWindowCollectionBehavior
with the valueNSWindowCollectionBehaviorCanJoinAllSpaces
, which makes the window visible in all spaces.Here is a link to this property in my prototype:
https://github.com/crgimenes/NeoFrame/blob/master/screen/screen_macos.go#L31
If anyone has any idea how to do this in Ebitengine, it will help me a lot; writing the program in Go will be much simpler than in Objective-C.
Beta Was this translation helpful? Give feedback.
All reactions