osjs-client
osjs-client copied to clipboard
Maximize on render in a heavy application
I have an application which is heavy to load.
Although I maximize
it in render
event, there is a delay (means the user see app in its default dimension and after 1 or 2 seconds it is maximized).
How can I initially have my app full screen without any dealy?
// Create a new Window instance
const win = proc.createWindow({
id: 'ExampleReactApplicationWindow',
title: metadata.title.en_EN,
dimension:{width: 600, height: 750},
position: {left: 0, top: 0},
icon: proc.resource(metadata.icon),
attributes: {
mediaQueries: {
customBig: 'screen and (max-width: 1500px)',
customMedium: 'screen and (max-width: 1000px)',
customSmall:'screen and (max-width: 768px)'
},
minDimension:{width: 600, height: 750},
clamp: false,
},
});
win.on('render', () => {
win.maximize();
win.focus();
});
Have you tried maximizing before rendering ?
Have you tried maximizing before rendering ?
Yes, no delay happened for maximizing in this way, thanks.
Another problem happened due to having a responsive layout with media-queries
:
- The very first loading is based on mobile dimension layout in any desktop-size, and updated after one second (in the case I set
dimension: {width: 600, height: 600}
, or not set) - If I set dimension with some desktop layout such as
dimension: {width: 1600, height: 600}
the problem is fixed, but maximize button on mobile device will enlarge app as it is not expected.
const win = proc.createWindow({
id: 'ExampleReactApplicationWindow1',
title: metadata.title.en_EN,
dimension: {width: 600, height: 800},
position: {left: 0, top: 0},
icon: proc.resource(metadata.icon),
attributes: {
mediaQueries: {
customBig: 'screen and (max-width: 1500px)',
customMedium: 'screen and (max-width: 1100px)',
customSmall:'screen and (max-width: 768px)'
},
minDimension:{width: 600, height: 800},
clamp: false,
},
});
win.maximize();
but maximize button on mobile device will enlarge app as it is not expected.
Sorry. I'm not exactly sure what you mean by this.
Could you share some screenshots to illustrate the issue ?