I need to have a special kind of window, something...
# compose-desktop
g
I need to have a special kind of window, something like this app does: A window that fills the whole screen and that opens on top of current applications, even if they are fullscreen (the app in the screenshot is made in electron, here is how it does it https://github.com/tom-james-watson/breaktimer-app/blob/master/app/main/lib/windows.ts#L80) I have two main issues: • getting the size of the screen in
Dp
• opening the window on top of the current application Seems like on electron there is this option which is what I need:
Copy code
breakWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
// Or maybe it's this one
breakWindow.moveTop();
Is this possible with swing and compose? Otherwise if it’s not possible • how can I request focus on the window so that the user gets moved to it?
2
t
You can use the WindowState to make you application fullscreen. But i do not think that you are able to put it in focus with the Compose api. Maybe it is possible with swing utilities.
k
It’s probably
moveTop
for which AWT’s equivalent is
Frame.toFront
You might also play with
setAlwaysOnTop
, but of course at some point it does become user-hostile if there are multiple apps that want to be like that
g
Uhm this is kinda unfortunate
It works fine on windows, the issues arise only in macos because the window doesn’t show on top of existing full screen windows. If anyone knows a fix for the it would be a big help ^^
Tried AppleScript too but didn’t seem to work, and it’s too hacky imo
k
Does that Electron API work on macos in this scenario?
https://github.com/electron/electron/issues/10078 is a discussion on the Electron side on things that don’t work, shouldn’t work or may work
g
The electron app works just fine for me, in the github issue you found they seem to describe a working fix
Kinda don’t like that the whole concept of kotlin multiplatform is being able to merge native stuff with shared code, and then being limited to swing for the desktop part