File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,16 +55,29 @@ function createWindow() {
5555 sandbox : false ,
5656 } ,
5757 // Use a frameless window so we can render a custom SnapDock titlebar
58- frame : false ,
58+ frame : false , // need to set to if dev == true else false
5959 // On macOS we can hint to hide the native title bar inset
6060 titleBarStyle : process . platform === 'darwin' ? 'hiddenInset' : undefined ,
6161 } ) ;
6262
63+ // --- DPI SCALING FIX ---
64+ const { screen } = require ( "electron" ) ;
65+ const scaleFactor = screen . getPrimaryDisplay ( ) . scaleFactor ;
66+
67+ let zoom = 1.0 ;
68+ if ( scaleFactor >= 1.25 && scaleFactor < 1.5 ) zoom = 1.10 ;
69+ else if ( scaleFactor >= 1.5 && scaleFactor < 2.0 ) zoom = 1.25 ;
70+ else if ( scaleFactor >= 2.0 ) zoom = 1.40 ;
71+
72+ mainWindow . webContents . setZoomFactor ( zoom ) ;
73+ // ------------------------
74+
6375 // Remove all menus
6476 mainWindow . setMenu ( null ) ;
6577 mainWindow . setMenuBarVisibility ( false ) ;
6678 mainWindow . setAutoHideMenuBar ( true ) ;
6779
80+ // need to unblock for dev builds or test builds
6881 // Block DevTools shortcuts
6982 mainWindow . webContents . on ( "before-input-event" , ( event , input ) => {
7083 if (
Original file line number Diff line number Diff line change 11{
22 "name" : " snapdock" ,
3- "version" : " 3.1.2 " ,
3+ "version" : " 3.1.3 " ,
44 "description" : " A Minimal, Modern Markdown Editor" ,
55 "synopsis" : " Fast, clean Markdown editor" ,
66 "homepage" : " https://snapdock.app" ,
You can’t perform that action at this time.
0 commit comments