MediaArea / MediaInfo

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://MediaArea.net/MediaInfo
BSD 2-Clause "Simplified" License
1.26k stars 149 forks source link

Windows GUI dark mode: avoid an unexpected popup #851

Closed JeromeMartinez closed 4 weeks ago

JeromeMartinez commented 4 weeks ago

See https://github.com/MediaArea/MediaInfo/pull/836#issuecomment-2126335967.

cjee21 commented 4 weeks ago

This does prevent the popup although it still changes views. All the issues seem to be with VCL's implementation of styles which re-spawns the entire window. Unfortunately wihout using styles it seems difficult to make dark mode in VCL. Non-VCL applications can change dark mode without closing and reopening window and they also have native translucent Windows titlebar in dark mode.

The change in this PR needs to be applied to ApplicationEvents1OnSettingChange too to prevent the same popup for when the mode is changed using Windows settings while MediaInfo is running.

cjee21 commented 4 weeks ago

Bug number 1 in https://github.com/MediaArea/MediaInfo/pull/836#issuecomment-2126335967 seems to only happen for files which are open via File Explorer context menu.

I suspect VCL's TrySetStyle is triggering FormShow which has code adding command line args to the list.

cjee21 commented 4 weeks ago

I found a possible solution for the files duplicating on dark mode change bug mentioned above. I will make a PR later.