Issue with setting ZoomLevel on creating browser

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Issue with setting ZoomLevel on creating browser

Postby sat » Wed May 17, 2017 10:21 am

I want to create browser with some predefined ZoomLevel. When i shall call Browser->Host->SetZoomLevel ?
I tried to call it on OnAfterCreated browser's callback, and it doesn't seems to work. I found a solution here to call SetZoomLevel with some delay (100ms) and it worked but looks weird for me. I mean what if on some machine 100ms is not enough ?
May be there is some other callback i can rely on ? Or was it fixed with a new version of CEF? Mine is 3.2623.1401.gb90a3be
Thx!
sat
Techie
 
Posts: 20
Joined: Thu Mar 26, 2015 8:59 am

Re: Issue with setting ZoomLevel on creating browser

Postby Czarek » Wed May 17, 2017 12:45 pm

Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Issue with setting ZoomLevel on creating browser

Postby sat » Thu May 18, 2017 4:32 am


Yep I saw this thread and this trick worked for me as i mentioned above. My question is why 50ms is required delay ? not 100ms or 1s ?
sat
Techie
 
Posts: 20
Joined: Thu Mar 26, 2015 8:59 am

Re: Issue with setting ZoomLevel on creating browser

Postby Czarek » Thu May 18, 2017 11:47 am

The referenced topic talks about 100 ms interval - it is called every 100 ms, not once, so it should be enough because it is called forever. You can try other values as well, it worked good in my case, so I didn't spend much time analyzing it.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 48 guests