TASEmulators / TASEmulators/BizHawk

[🪟] Window position not restored correctly on PC with multiple displays

Open
#3,544 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

App: EmuHawk Repro: Affects 2.11.1 Repro: Affects 2.8
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Summary

I have a dual monitors Windows 10 setup. My primary monitor (Monitor 1) is my laptop monitor. My secondary monitor (Monitor 2) is an external monitor.

My display arrangement looks like this:

image

If I run Emuhawk and drag it to Monitor 1, and then I opened the TAStudio and RAM Watch, both of them will appear on Monitor 2, all gathered together on one side. I have a GIF to show what is happening.

GIF

I do not know how to explain this properly, but I will do my best. When TAStudio is closed, the X and Y coordinates, and the width and height of the window are saved somewhere in the config.ini. Somehow, when TAStudio is opened, the X coordinate somehow isn't correct, so it defaults to the minimum value of Monitor 2's width (X: 0). This happens with the same thing with RAM Watch, where the X coordinate value would be limited by the minimum width of Monitor 2.

I am assuming that, because TAStudio is closed in the secondary monitor, and then EmuHawk is closed, the config.ini would store the X and Y coordinates of TAStudio of the secondary monitor, but not taking into account the total width of 2 monitors in a dual monitors setup.

Repro
  1. Have a dual monitor setup ready.
  2. Have the dual monitor set up so that the primary monitor is on the left side, and the secondary monitor is on the right side.
  3. Open EmuHawk.
  4. Open TAStudio.
  5. Drag EmuHawk to the primary monitor.
  6. Drag TAStudio to the secondary monitor.
  7. Close TAStudio.
  8. Close EmuHawk, so that the config.ini file is properly saved.
  9. Open EmuHawk.
  10. Open TAStudio. TAStudio should appear in the secondary monitor.
  11. Drag TAStudio to the primary monitor.
  12. Close TAStudio.
  13. Open TAStudio again. Observe TAStudio appears in the secondary monitor.
Output

There is no error output. EmuHawk, TAStudio, and RAM Watch windows all behave normally.

Host env.
  • BizHawk 2.8; Win10 Pro x64 21H2 Build 19044.2486; Intel/NVIDIA
  • BizHawk 2.9 RC2; Win10 Pro x64 21H2 Build 19044.2486; Intel/NVIDIA
  • BizHawk dev build at cf0ce0f5; Win10 Pro x64 21H2 Build 19044.2486; Intel/NVIDIA

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dual-monitor scenario in the issue, then inspect how TAStudio and RAM Watch window coordinates are saved to and restored from config.ini. Compare the stored positions with the monitors' combined coordinates; done means both windows reopen on the monitor and position where they were last closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.