I use XamDockManager and have some DockPanels (left, right, and bottom of the content)..
The problem is when I try to resize panel (by using mouse drag on DockedPaneSplitter), it intermittently cancelled (do nothing).When it occurs and I check DockedPaneSplitter_DragCompleted event, the e.Canceled is true.
From the test, this problem only occurs when all these conditions are true:1. Monitor DPI is different between primary and second monitor (I change [Display > Scale and Layout] to 175% to reproduce this)2. Application is not on primary monitor (put application on second monitor)3. HwndHost is set as content in our DockManagerPanel
Additional info: I am using dual monitors and run the application on my second monitor in Windows 10.
Please let me know what can caused resizing panel to be canceled, and how can I prevent this to happen.
Thanks,
Edo
Sorry for the delay, was busy for release.
I tried to add hook and filter for WM_CAPTURECHANGED as suggested. And the mouse captured element is the {Infragistics.Windows.DockManager.DockedPaneSplitter}
Sorry I must have missed the callstack you listed. Capture could have been cancelled because the window was deactivated or because something else captured the mouse or something else caused mouse capture to be released. Perhap you could try looking up at the FilterMessage item in the callstack and try to see what message is being processed or use spy++ or add an HwndSourceHook to your window's HwndSource. It's likely a WM_CAPTURECHANGED so maybe start by looking at the Mouse.Captured. If it's another element then presumably that element requested capture. If it's null then try using interop to call the GetCapture api to see which window took mouse capture if any.
Hi Andrew,
I tried to use WebBrowser, and the issue still occurs.
I posted the call stack on my second post (it is from my original app, not the small app - but I think it will be similar), most of them are coming from .NET framework.
From the call stack it seems Thumb.OnLostMouseCapture() triggering Thumb.CancelDrag(), but I don't know why that happens.
We haven't been able to reproduce the issue but I'm wondering if this is related to your reparenting the hwnd from a different process into your window. Are you able to reproduce this with an HwndHost that contains an hwnd belonging to your application's process? e.g. WebBrowser or WindowsFormsHost.
With regards to the drag being cancelled, the PaneSplitter is just a derived WPF Thumb and listens for its DragCompleted event. If WPF is raising that with the Canceled property of the event args set to true then it will cancel the splitter move. Perhaps you can try to debug why that is happening - e.g. evaluate the callstack of the DragCompleted since you mentioned seeing the Canceled was true. Maybe something else is capturing the mouse.
Hi Noriko,
I don't have warning when change display using scale and layout.
However, I have tried to restart computer after change it, and I can still reproduce the issue.
Video recording showing the issue: https://gofile.io/?c=49PGSZ