I'm trying to implement a frameless window (on MacOS w/pyobjc but ideally this would be possible everywhere, I think electron does it everywhere).
Getting the titlebar transparent and the content to fill the whole window is pretty simple with:
window_mask = window_mask | AppKit.NSFullSizeContentViewWindowMask
...
self.window.setTitlebarAppearsTransparent_(True)
self.window.setTitleVisibility_(AppKit.NSWindowTitleHidden)
However, the frameless window cannot be dragged about because even the very top is covered by the WebView - as dragging the mouse moves this into text selection mode. Electron's solution is a Chrome-specific (annoying) -webkit-app-regon: drag CSS selector.
My thinking is it might be possible to achieve this by drawing a transparent box over the top X pixels of the NSWindow and making that draggable (using setMovableByWindowBackground_(True)).
I'm trying to implement a frameless window (on MacOS w/
pyobjcbut ideally this would be possible everywhere, I think electron does it everywhere).Getting the titlebar transparent and the content to fill the whole window is pretty simple with:
However, the frameless window cannot be dragged about because even the very top is covered by the
WebView- as dragging the mouse moves this into text selection mode. Electron's solution is a Chrome-specific (annoying)-webkit-app-regon: dragCSS selector.My thinking is it might be possible to achieve this by drawing a transparent box over the top X pixels of the
NSWindowand making that draggable (usingsetMovableByWindowBackground_(True)).