#toggleMaximize and maximize isn't working | Nextjs 13.5

6 messages · Page 1 of 1 (latest)

alpine tree
#

This is my implementation component :

"use client"
import { appWindow } from '@tauri-apps/api/window'
import Image from 'next/image'
const Toolbar = () => {
  return (
    <div className="flex justify-end bg-gray-800 p-2" data-tauri-drag-region>
      <button className="p-2 hover:bg-yellow-600" onClick={() => appWindow.minimize()}>
<Image src="https://api.iconify.design/mdi:window-minimize.svg"
alt="minimize"
width={20}
height={20}
/>
     </button>
      <button className="p-2 hover:bg-green-600" onClick={()=>appWindow.toggleMaximize()}>
<Image
src="https://api.iconify.design/mdi:window-maximize.svg"
alt="maximize"
width={20}
height={20}
/>
      </button>
      <button className="p-2 hover:bg-red-700" onClick={() => appWindow.close()}>
      <Image src="https://api.iconify.design/mdi:close.svg" alt="close" width={20}
      height={20}/>
      </button>
    </div>
  );
};
export default Toolbar

it works completely fine as expected when I assign false to

tauri.conf.json
....
 "windows": [
      {
        "fullscreen": false,
        .....
}]
....

but when its set to true the other two buttons (minimize and close) works as expected but the toggleMaximize button just doesn't do anything.

whole lichen
#

i think you're the second person i heard saying that lately. Honestly this behavior makes sense to me, but feel free to open a github issue about this and maybe the team counts this as a bug :)

alpine tree
#

Yeah cool I'll raise a issue

whole lichen
# alpine tree I don't get it how does it make sense?? If it was opposite then makes sense to m...

for me fullscreen is kinda like a super version of maximization.
So if a window is fullscreen, what should trying to maximize it do? Nothing because it already kinda is maximized or exit fullscreen and then maximze it (the latter is what you're asking for right?).
In that same vain, what should a unmaximize() call do? nothing because fullscreen takes precedence over maximization state or exit fullscreen and then shrink the window.
Lastly, what should toggleMaximize do in a fullscreened window?

#

i hope you get what i'm trying to say, it's a bit hard to explain how it feels like x)