webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and HTML5 in the frontend, all in a lightweight portable lib.
https://webui.me
MIT License
2.36k stars 144 forks source link

Question: how to set full screen display at startup? #324

Closed zzdoreen closed 5 months ago

zzdoreen commented 5 months ago

hello . I want to know Is there any way to set full screen display on startup?

I‘m using C programing language

fibodevy commented 5 months ago

Hello

I‘m using C programing language

It doesn't matter. WebUI doesn't provide any method to run the application in full screen and doesn't control the window itself. You have to manipulate the window using Java Script (moving, resizing). For full screen it would be:

var body = document.getElementsByTagName('body')[0];
body.requestFullscreen();
zzdoreen commented 5 months ago
var body = document.getElementsByTagName('body')[0];
body.requestFullscreen();

But, this function requires user interaction before it can be executed, otherwise an exception will be reported. Permissions check failed

fibodevy commented 5 months ago

Unfortunately. Maybe simulating a click on the window would be a workaround. Or display some kind of splash window for user to click, then enter full screen mode? Until browsers provide command line options to skip such permission issues we have to use hackish workarounds.

zzdoreen commented 5 months ago

thanks reply

jinzhongjia commented 5 months ago

Do you mean exclusive full screen?

jinzhongjia commented 5 months ago

see this: https://github.com/webui-dev/webui/blob/2a5f0c98fbb267a5aed921a8678f3f108bb12a6e/include/webui.h#L231C19-L231C34

fibodevy commented 5 months ago

Oh right, I completely forgot about Kiosk mode

zzdoreen commented 5 months ago

see this: https://github.com/webui-dev/webui/blob/2a5f0c98fbb267a5aed921a8678f3f108bb12a6e/include/webui.h#L231C19-L231C34

Yes ! thank you!!!!!!