mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app: enable creation of top most windows
Floating windows are rendered above all other non-floating windows. Apple Documentation: https://developer.apple.com/documentation/appkit/nswindow/level-swift.struct Signed-off-by: Thomas Banks <thomas@tombanks.me>
This commit is contained in:
@@ -241,6 +241,13 @@ static void setTitle(CFTypeRef windowRef, CFTypeRef titleRef) {
|
||||
}
|
||||
}
|
||||
|
||||
static void setWindowLevel(CFTypeRef windowRef, NSWindowLevel level) {
|
||||
@autoreleasepool {
|
||||
NSWindow *window = (__bridge NSWindow *)windowRef;
|
||||
window.level = level;
|
||||
}
|
||||
}
|
||||
|
||||
static int isWindowZoomed(CFTypeRef windowRef) {
|
||||
@autoreleasepool {
|
||||
NSWindow *window = (__bridge NSWindow *)windowRef;
|
||||
@@ -495,6 +502,9 @@ func (w *window) Configure(options []Option) {
|
||||
barTrans = C.YES
|
||||
titleVis = C.NSWindowTitleHidden
|
||||
}
|
||||
if cnf.TopMost {
|
||||
C.setWindowLevel(window, C.NSFloatingWindowLevel)
|
||||
}
|
||||
C.setWindowTitlebarAppearsTransparent(window, barTrans)
|
||||
C.setWindowTitleVisibility(window, titleVis)
|
||||
C.setWindowStyleMask(window, mask)
|
||||
|
||||
Reference in New Issue
Block a user