-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call GetZoomLevel On CEF UI Thread #954
Conversation
…a failure mode of just returning 0. Here's a cheesy temporary solution to adding a full on GetZoomLevelAsync method that returns a .Net task.
@@ -110,7 +110,7 @@ | |||
<ClCompile> | |||
<Optimization>Disabled</Optimization> | |||
<AdditionalIncludeDirectories>$(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir)</AdditionalIncludeDirectories> | |||
<PreprocessorDefinitions>_DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
<PreprocessorDefinitions>_DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CEF
require OS_WIN
to be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does if you want the base::Bind(...) overloads for __stdcall. (Sadly, Marshal.GetNativeFunctionPointerForDelegate
doesn't like generic delegates or generic parameters. 😦 So that atttempt didn't work either. Ugh.
I figured it would probably be good to leave it in case CEF uses the define for other stuff.
Bill
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does if you want the base::Bind(...) overloads for __stdcall.
I couldn't figure out what changes in this PR
would require a new pre-processor directive, makes sense now. Since it has a potential purpose then happy to leave in 👍
Works as advertised 👍 Merge away. |
Call GetZoomLevel On CEF UI Thread
GetZoomLevel is required to be called from the UI thread, but it has a failure mode of just returning 0 when its not on the UI thread. Here's a cheesy temporary solution to avoid adding a full on GetZoomLevelAsync method that returns a .Net task.
Bill