Good morning everybody :slightly_smiling_face: See...
# compose-desktop
r
Good morning everybody 🙂 Seeking for a little help here! I am supposed to upgrade a framework (&some demo applications) based on Compose v0.4 to v1.1. While upgrading, I’ve stumbled upon some classes which are not existing anymore, e.g.
LocalAppWindow
or
AppManager
Concret, I’m talking about this function, which should add some default key behaviour when pressing
ctrl
+ `q`:
Copy code
@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun add addDefaultKeyBehaviour(){
    val key: Key = if(System.getProperty("os.name") == "Mac OS X") Key.MetaLeft else Key.CtrlLeft
    LocalAppWindow.current.keyboard.setShortcut(KeysSet(setOf(key, Key.Q))){
        AppManager.focusedWindow?.close()
    }
}
As I could not find any migration tutorial, I would appreciate some advice on this 🙂 Thanks in advance!
r
@olonho thx, I’ll check it out 🙂
@olonho would you appear to know, how to close the whole App?
o
Call exitApplication function
r
Sorry, but I am struggling. Since we’re working on a framework, we do not have a window at hand. Is there a way to get the current window programmatically or pass it down as a parameter (e.g. by using a state)?