MicrosoftEdge / MicrosoftEdge/WebView2Feedback

ICoreWebView2Controller.set_Bounds throws System.Runtime.InteropServices.COMException (HRESULT: 0x8007139F)

Open
#1,568 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority-low tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Exception
System.Runtime.InteropServices.COMException
The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)

Description
Moving a splitter caused resize event. Resize event caused WebView2.OnSizeChanged. ICoreWebView2Controller.set_Bounds throwed System.Runtime.InteropServices.COMException.

Callstack
bei Microsoft.Web.WebView2.Core.Raw.ICoreWebView2Controller.set_Bounds(tagRECT Bounds)
bei Microsoft.Web.WebView2.Core.CoreWebView2Controller.set_Bounds(Rectangle value)
bei Microsoft.Web.WebView2.WinForms.WebView2.OnSizeChanged(EventArgs e)
bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
bei System.Windows.Forms.Control.UpdateBounds()
bei System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
bei System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
bei System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
bei System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
bei System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ContainerControl.OnLayout(LayoutEventArgs e)
bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
bei System.Windows.Forms.Control.OnResize(EventArgs e)
bei System.Windows.Forms.UserControl.OnResize(EventArgs e)
bei System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
bei System.Windows.Forms.Control.UpdateBounds()
bei System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.UserControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
bei System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
bei System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
bei System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
bei System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
bei System.Windows.Forms.Control.OnResize(EventArgs e)
bei System.Windows.Forms.Panel.OnResize(EventArgs eventargs)
bei System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
bei System.Windows.Forms.Control.UpdateBounds()
bei System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
bei System.Windows.Forms.Layout.DefaultLayout.ApplyCachedBounds(IArrangedElement container)
bei System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
bei System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
bei System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ContainerControl.OnLayout(LayoutEventArgs e)
bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
bei System.Windows.Forms.Control.OnResize(EventArgs e)
bei System.Windows.Forms.UserControl.OnResize(EventArgs e)
bei System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
bei System.Windows.Forms.Control.UpdateBounds()
bei System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.UserControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
bei System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
bei System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
bei System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
bei System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
bei System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
bei System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
bei System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
bei System.Windows.Forms.Control.PerformLayout()
bei System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
bei System.Windows.Forms.Control.ResumeLayout()
bei System.Windows.Forms.SplitContainer.UpdateSplitter()
bei System.Windows.Forms.SplitContainer.set_SplitterDistance(Int32 value)

Version
SDK: 1.0.705.50
Runtime: Evergreen 91.0.864.70
Framework: WinForms (x86)
OS: Microsoft Windows Server 2019 Standard (Version: 10.0.17763)

Repro Steps
Moving a splitter. Having a WebView2 in lower pane and a data grid in upper pane.

AB#34856494

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported call path from WebView2.OnSizeChanged to ICoreWebView2Controller.set_Bounds and reproduce it by moving a splitter with a WebView2 in the lower WinForms pane. Compare the reported SDK 1.0.705.50, Evergreen runtime 91.0.864.70, x86 framework, and Windows Server 2019 environment; done means the resize no longer throws the reported COMException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.