oviradoi / npp-explorer-plugin

Modified version of the Explorer plugin for Notepad++ that matches its colors with the current theme
62 stars 8 forks source link

NPP 8.4.9 -> 8.5: dark mode, missing explorer control repaint after theme change #39

Closed klaus101 closed 1 year ago

klaus101 commented 1 year ago

After updating Notepad++ 8.4.9 to 8.5 i noticed occasionally, that with dark mode the following happens:

changing a theme leads to a missing control repaint. Parts of the control, ie. treeview background and scrollbars, appear to be temporarely painted as by default light theme. See image below. When the style configurator dialog is closed, in parts it gets better. But at the end only a prog restart does fully help.

With NPP 8.5 there had been dark mode fixes, probably those do affect explorer's control redraw at theme switch.

Btw redraw: sadly, there was none reply on #38. You think it's nonsense? Would be very interested to hear.

explorer_broken_darktheme_changex

oviradoi commented 1 year ago

Thanks for reporting this. I will take a look when I get some more time.

klaus101 commented 1 year ago

Really many thanks for respecting both topics! For the current topic i just noticed it also happens without switching the theme itself. Eg. when certain style settings are altered within the style configurator. For instance: Global styles, Selected text color. When changing it: same effect. Definitively due to NPP 8.5 changes; it was not with 8.4.9.

oviradoi commented 1 year ago

Unfortunately, I could not reproduce this on my side.

Until version 1.9.6, the plugin contained code that tried to draw its controls with the same colors as Notepad++, not using NPP's dark mode code. This led to many bugs where the controls were not drawn properly or did not match NPP's style.

In version 1.9.7, all the custom code was removed from the plugin, and now we let NPP style our controls, so it's in charge of everything. The only exception is the splitter between the tree and file list, since NPP does not support styling that control so we have to do it ourselves.

If there really is a bug in drawing the controls, it is probably in Notepad++, as all the custom drawing code was removed from Explorer.

Also, I think switching styles is something that a regular user rarely does, so a small glitch that is fixed on restart is not a huge issue in my opinion.

If you are able to more reliably reproduce the problem, please let me know and I can take another look. Please include the version of Windows, the version of NPP and the version of the Explorer plugin. Also helpful would be the variant (x86 or x64), although I guess most people use x64 nowadays.

klaus101 commented 1 year ago

Yes, right, changing themes or style settings won't happen too often. So it's not dramatic, it was only an obervation when going from 8.4.9 to 8.5. Did look into the individual NPP release note issue fix descriptions, but could not gain a clue which might be specifically related to that,

OS: Windows 10 Home 22H2, 64bit. NPP 8.4.9 -> 8.5, portable x64, plugins: beneath the NPP-delivered ones: only explorer (x64, 1.9.7 or 1.9.8) and jsonviewer.

Steps to reproduce are easy:

That's all ... I add a video for info. You don't have this effect?

https://user-images.githubusercontent.com/31130146/224487357-e77437e3-4711-4897-9c3e-bdd5d81e10a3.mp4

klaus101 commented 1 year ago

ovirado, as, after your last description of your last change, it appears to me it could be rather a refresh problem on the NPP side. So i did open an NPP issue too (see link above), hoping that's in your interest too. Maybe there might be additional infos.

oviradoi commented 1 year ago

Hello again,

After some more testing, I was able to reproduce the problem. Indeed, it seems it's a problem in Notepad++'s code.

There are several other tree panels built into Notepad++ that have the same issue. They are the Project Panel, and Folder as Workspace.

If you try to open them using File -> Open Folder as Workspace and View -> Project Panels-> Project Panel 1, you will see that all of them have the same problem.

I think you can report this to Notepad++'s team. When they solve this issue it should also be solved for Explorer.

klaus101 commented 1 year ago

Hello oviradoi, thanks again for attention! Yes i see. Eg.: having not the explorer opened, but when having opened a folder as workspace, i see the issue too. - See image: foldler_as_workspace .

Meanwhile an info had been given within the NPP issue item. If both explorer as well as favorites panel are open (eg. see screenshot),

both_panels_opened

... then the issue does Not occur. It was suspected a variable might not been initialized.

Does this make any difference for you? Starts to become very mysterious for me.

klaus101 commented 1 year ago

Did a bit more testing. If i - for test - deinstall the explorer plugin, then the issue as showing up at "Folder as workspace" does NOT occur. So it might be the plugin, already when being installed/loaded, but not been started?

oviradoi commented 1 year ago

Thanks for testing this. I need to investigate it more on my side. Maybe it is the Explorer plugin breaking things, but I need to be sure about it.

oviradoi commented 1 year ago

@klaus101 indeed, it seems that the Explorer plugin was causing this problem. Notepad++ did not like it when Explorer invalidated the tree controls after the style changed.

This issue should be fixed in the latest release, v1.9.9

klaus101 commented 1 year ago

@oviradoi Wow, impressive! - Indeed, with the 1.9.9 the issue disappears. - Congratulations!

I'll report back to the NPP forum and close this item later the day. Many thanks oviradoi!