-
Notifications
You must be signed in to change notification settings - Fork 52
Notepad++ freezes when working with undocked dialogs that use container-controls #17
Comments
I cannot give you a good answer as to why this crashes. I'd be happy to receive a PR when you fixed the bug. |
I did some digging around into this but could not track it down, even ran Notepad++ in a debugger and stepped through the code. The last thing Notepad++ appears to call is |
have you tried compiling the demo from the plugin pack and starting n++ ? there is an example of dockable windows |
Yes I was able to replicate the bug with the demo plugin but wasn't able to track down the cause of the problem. |
I too am facing some kind of issue with dock panel container, in which I was trying to host a WPF window inside the Win32 dock container provided by Npp. The problem was that whenever the hosted dock window is being re-sized or docked/undocked it goes blank or renders incorrectly. If anyone has any ideas or pointers on what could be the issue will be much helpful(I am deugging native Npp's WndProc messaging loop in the meantime to check what causes the flicker with the dock panel on re-size/move(dock/undock)) I will report back if I have any leads. |
okay, I did some profiling and can clearly see some hotspot in the gripper function in notepad++ main process which handles the dragging for the dock panel container. Probably its getting locked up in the Kernel or some bug (looping?) in the message handling loop Gripper::staticWinProc() of notepad++ process. Since Winforms are just a wrapper to WinAPI, probably there shouldn't be any issue using .NET. Let's see if anything more comes up. Attaching Profiled data: |
Found something on this: https://forums.codeguru.com/showthread.php?412421-endless-messages-WM_GETDLGCODE-when-focus-is-lost https://www.codeproject.com/Articles/470997/A-tale-of-two-flags-DS-CONTROL-and-WS-EX-CONTROLPA http://www.guyswithtowels.com/blog/10-things-i-hate-about-win32.html (See Nested Dialogs section) Looks like it's a InterOp issue(dialog manager doesn't find the target child/nested grid container and so it sends the message WM_GETDLGCODE infinitely to parent window message proc) when using managed .NET group containers inside unmanaged Win32 based window. This issue as it doesn't occur when using plain unmanaged Win32 APIs for creating windows or child containers. A work around suggested was to ...set the Extended style attribute of grid(group) control to WS_EX_CONTROLPARENT once the control is loaded or created. |
About the profiling screenshots attached earlier(I stepped into Npp source code to look what's happening):
There were lot of precautions and tips needed to deal with child controls and their message procs since lots of users have faced this issue and still weren't able to conclude the root cause of it. A Google search on this topic should now give more info.... I tried to hack the GridControl's style attribute to have WS_EX_CONTROLPARENT flag....but didnt complete the testing whether it resolves our issue...(I had some personal and office work)..maybe someone could try and report it? The content posted above is based on my quick research and understanding on Npp docking procedure so could be incorrect in some places for the NPP internal operations, I would suggest checking the original source code. |
Hi, was a solution found for the original issue ? I'm having the same issue using buttons inside a tab control. works fine when docked but freezes when the panel is undocked. |
@Denisf88 A work around suggested was to ...set the Extended style attribute of grid(group) control to WS_EX_CONTROLPARENT once the control is loaded or created. |
@Denisf88 can you check if that helps, I haven't been in touch with this codebase since sometime now...will check out when I get time. |
@mahee96 thanks for the info, I'm not quite sure how apply this workaround, will try figure it out. |
An exact description can be found here:
https://notepad-plus-plus.org/community/topic/12519/net-plugin-dockable-dialog-freezes-notepad
The text was updated successfully, but these errors were encountered: