Skip to content
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

Merged
merged 2 commits into from
Apr 16, 2015

Conversation

rassilon
Copy link
Contributor

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

…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.
@rassilon rassilon added this to the 39.0.1 milestone Apr 16, 2015
@amaitland amaitland changed the title GetZoomLevel is required to be called from the UI thread, but it has a f... Call GetZoomLevel On CEF UI Thread Apr 16, 2015
@@ -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>
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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 👍

@amaitland
Copy link
Member

Works as advertised 👍 Merge away.

rassilon added a commit that referenced this pull request Apr 16, 2015
Call GetZoomLevel On CEF UI Thread
@rassilon rassilon merged commit b3c331c into cefsharp:master Apr 16, 2015
@rassilon rassilon deleted the GetZoomFromUIThread branch April 16, 2015 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants