Viewer: Don't steal focus when the shader error window appears

Makes editing shaders (in the SkSL or Particles slides) tolerable.
Previously, every intermediate state (that didn't compile) would force
you to stop and click back in the code window.

Change-Id: Ibc12b8d697a6b5073e24020daa143a4047a5da31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301984
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2020-07-10 16:48:14 -04:00 committed by Skia Commit-Bot
parent 041796e603
commit 31890e2c37

View File

@ -2378,7 +2378,7 @@ void Viewer::drawImGui() {
if (gShaderErrorHandler.fErrors.count()) {
ImGui::SetNextWindowSize(ImVec2(400, 400), ImGuiCond_FirstUseEver);
ImGui::Begin("Shader Errors");
ImGui::Begin("Shader Errors", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
for (int i = 0; i < gShaderErrorHandler.fErrors.count(); ++i) {
ImGui::TextWrapped("%s", gShaderErrorHandler.fErrors[i].c_str());
SkSL::String sksl(gShaderErrorHandler.fShaders[i].c_str());