Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When minimizing and maximizing right afterwards the app is blank #39

Open
notAperson535 opened this issue May 27, 2024 · 3 comments
Open

Comments

@notAperson535
Copy link

After maximizing the app after minimizing, there is no content on the screen (Electron version 29.3.3):
image

const { app, BrowserWindow } = require('electron')
const { PARAMS, VALUE, MicaBrowserWindow, IS_WINDOWS_11, WIN10 } = require('mica-electron');
const path = require('node:path')

const createWindow = () => {
    const mainWindow = new MicaBrowserWindow({
        // titleBarStyle: "hidden",
        // titleBarOverlay: true,
        titleBarStyle: 'default',
        width: 800,
        height: 600,
        show: false,
        webPreferences: {
            webviewTag: true,
            preload: path.join(__dirname, 'preload.js'),
            sandbox: false
        }
    })

    mainWindow.setLightTheme()
    mainWindow.setMicaEffect()
    mainWindow.setRoundedCorner()
    mainWindow.alwaysFocused(true)

    mainWindow.webContents.once('dom-ready', () => {
        mainWindow.show();
    });

    mainWindow.webContents.on("did-attach-webview", (_, contents) => {
        contents.setWindowOpenHandler((details) => {
            mainWindow.webContents.send('open-url', details.url);
            return { action: 'deny' }
        })
    })

    mainWindow.loadFile('index.html')
}

app.whenReady().then(() => {
    createWindow()

    app.on('activate', () => {
        if (BrowserWindow.getAllWindows().length === 0) createWindow()
    })
})

app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') app.quit()
})
@notAperson535
Copy link
Author

Also might be a different issue but when the window is first created it is really small, as you can see in the screenshot

@GregVido
Copy link
Owner

Hi ! I did an update which partially fixes the problem (there is still the problem with the large screen). I spent a lot of time on it and it's quite complex. I hope I find a solution in time.

@notAperson535
Copy link
Author

Ok, minimizing on small window is now fixed, but as you said the maximized window still glitches out when minimized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants