Proopai / eve-o-preview

An EVE client window switcher tool created to aid playing with multiple clients in CCP game EVE Online
https://forums.eveonline.com/t/eve-o-preview/4202
MIT License
32 stars 5 forks source link

EVE-O-Preview does not display thumbnails with the configured resolution #32

Open odon opened 1 week ago

odon commented 1 week ago

OS : Windows 11 GPU : RTX 3080Ti

Monitor 1: 3440x1440 Monitor 2: 1080x1920 (vertical)

Everything on Monitor 1

"ThumbnailSize": "403, 172"

Position is always ok, but sometimes thumbnail size is smaller than expected. A restart of EVE-O-Preview may fix the issue, or may cause even smaller thumbnails.

izakbar commented 1 week ago

I strongly suspect this is windows DPI scaling going on. I am currently investigating to see if adding to app.config will fix

    <System.Windows.Forms.ApplicationConfigurationSection>
        <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
    </System.Windows.Forms.ApplicationConfigurationSection>
izakbar commented 1 week ago

Oh this might be a fun one. It looks like windows is sending resize messages - and there is code in eve-o to ignore resize events for 500ms after window created.

private void Resize_Handler(object sender, EventArgs e)
{
    if (DateTime.UtcNow < this._suppressResizeEventsTimestamp)
    {
        return;
    }

The timeout is set :

private const int RESIZE_EVENT_TIMEOUT = 500;

private void SuppressResizeEvent()
{
    // Workaround for WinForms issue with the Resize event being fired with inconsistent ClientSize value
    // Any Resize events fired before this timestamp will be ignored
    this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(ThumbnailView.RESIZE_EVENT_TIMEOUT);
}
izakbar commented 1 week ago

gottem.

I have created a bugfix branch with this setting in config file instead of hardcoded constant - and setting to 1 makes the error occur 100% of the time Setting to > 500 (depends on your system I guess) reduces it.

"ThumbnailResizeTimeoutPeriod": 1200,