Coder Social home page Coder Social logo

Comments (7)

sisco0 avatar sisco0 commented on June 25, 2024

Are we using the methods shown in https://svelte.dev/tutorial/custom-stores such as set?

from haruneko.

Sheepux avatar Sheepux commented on June 25, 2024

No, we're using nwjs maximize function that should handle such case by itself.
So this is a nwjs issue, but it probably means that something is missing for MacOS (an app id?)

from haruneko.

sisco0 avatar sisco0 commented on June 25, 2024

I attach some lines of interest

export const WindowController = writable<IWindowController>();

WindowController.set(windowController);

maximize = $WindowController.Maximize.bind($WindowController);

winMaximized =
window.outerWidth >= screen.availWidth &&
window.outerHeight >= screen.availHeight &&
window.screenTop <= screen['availTop'] &&
window.screenLeft <= screen['availLeft'];

Maybe winMaximized is not set to true for the MacOS case as this last complex condition is not met as expected?

from haruneko.

Sheepux avatar Sheepux commented on June 25, 2024

winMaximized is only here for the button action change
See

on:click={() => (winMaximized ? restore() : maximize())}

from haruneko.

Sheepux avatar Sheepux commented on June 25, 2024

on windows winMaximized is struggling when moving the window from a 1080p to a 4K screen. Could be related

from haruneko.

Sheepux avatar Sheepux commented on June 25, 2024

Possible issue with equality as the pixel ratio is not the same. There could be an error marging


(still investigating)

from haruneko.

Pierre-Monier avatar Pierre-Monier commented on June 25, 2024

For me (macOS M1 2020) I have no problem with maximized on start detection (on dev and prod), the issue I have is that winMaximized is not updated correctly. So I can only maximize or restore the app once, after that I'm blocked. The code is here :

    function updateWindowState() {
        winMaximized =
            window.outerWidth >= screen.availWidth &&
            window.outerHeight >= screen.availHeight &&
            window.screenTop <= screen['availTop'] &&
            window.screenLeft <= screen['availLeft'];
    }

The problem is that the window object is not updated inside the resize event listener, so winMaximized is never updated. I try getting the window object from the UIEvent but it's the same issue.

The only way to fix is to use nw.Window.get(). But since we wrap this inside the IWindowController, the clean way is to update this interface. So I prefer to ask first before I made any change.

Can you use the maximize button more than once on other platforms ?

from haruneko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.