MercuryTrade icon indicating copy to clipboard operation
MercuryTrade copied to clipboard

Multi-Monitor Bug (with toolbar/gui disappearing after swapping monitors)

Open Adjourner opened this issue 5 years ago • 2 comments

First of all - I dunno how often people say it to you, and as a fellow coder - Mercury Trade is just hands down awesome and I support your hard work for this great tool. I know how many hours it takes to put something like this together and it can honestly be a pain to manage a forum as well as you do, and dealing with entitled people who don't realize that because of you and your team - we wouldn't have this tool.

Now here are the specs of the PC that I'm having this issue with:

OS: Windows 10 CPU: Ryzen 7 2700X RAM: 16 GB Graphics Card: Nvidia GeForce GTX 1080 Monitor Resolutions: Primary - 3840 x 2160 Secondary - 1920 x 1080

Secondly - I've scoured this forum for quite some time (over a period of a couple months) and can't find anything on this specific issue - there are similar ones but none of them really have the answer i'm looking for. Now because of that search I've tried to run both versions of MT and as admin on both

Side-note - Even though these issues are happening I am still able to hear the program running in the background.

  • [ ] - Some reason when I hit restore defaults the bars don't move back to the default location on the primary monitor
  • [ ] - When adding/removing/swapping my monitors (which I do change them out a lot, for work with a kvm setup) and then I load path of exile, the toolbar will not move and stay on the previous monitor or will disappear (for when i'm removing that same monitor)
  • [ ] - Since the restore defaults feature doesn't work for me and when I swap between monitors (i'm thinking I could be very wrong with my thoughts, and this is just a bit guesswork/troubleshooting with my current trial and error) but it keeps the program is setup with the previous location with that specific monitor and when I swap to the other setup - my OS doesn't detect that monitor anymore, and MT doesn't show up anymore because it's still trying to show on the monitor previously that it was on (which of course they have different resolutions which mean it would never show up on the smaller screen).

*Now I have a temporary work around and that's swapping the monitors around so my main screen isn't the one that keeps swapping, but I'd like to be able to swap that specific monitor (just simpler for my setup).

** I've also setup the issues i'm having with order of importance - because if the 1st one is fixed the other 2 don't matter, and so on with fixing the 2nd the 3rd doesn't matter. I'm not picky which one you want to tackle. AND If you don't want to debug this issue that's completely fine - if you could just let me know what line of code sets up the x/y coordinates for the GUI on the respective monitors. I could easily edit the code myself or just the .ini file regarding it's positioning - for a dynamic spaced environment with multiple monitors I've looked through what code is there and i've noticed there's a theme with your positioning - I just am a bit lazy and don't want to have to reverse engineer the code, honestly because I'd rather be spending time playing the game since I don't have much time - anyways hit me up - i'm always down for this, and of course any edits I make i'd be happy to give you the code I came up with to fix these bugs.

Thanks for your time

Adjourner avatar Dec 15 '18 14:12 Adjourner

Got the exact same issue here, hope this gets fixed 👍

AlphaBetaGamma88 avatar Dec 16 '18 19:12 AlphaBetaGamma88

I had the same issue Good news: There is a solution!

MercuryTrade saves the positions in a file in .../Users/InsertYourWindowsUserHere/AppData/Local/MercuryTrade/configuration.json If you open it you will find a big JSON mess. What you are looking for are the "frameLocation" parts which define where the UI pieces of the MercuryTrade UI are located relative to the upper left corner of your main monitor. So your assumption is correct! They don't "disappear" when you unplug your secondary monitor... They stay exactly where they were, but you now are not able to reach them anymore ^^

To solve that you can just create a copy of that file (I love my backups baby!) and modify it.

  • Change the "frameLocation" coordinates into ones so that they would appear on your main monitor (so just something positive that isn't too high)
  • Move the UI elements to your other monitor and arrange everything to your liking
  • After you are satisfied with your configuration I would recommend setting the file to read-only (rightclick -> Properties -> check the checkbox Read-Only under Attributes) so MercuryTrade can not randomly decide to change something (happened to me every now and then)
  • If you want to have multiple configuration - just create another copy. You just have to juggle around a bit with their names so you don't get confused which one was for which setup... ~~totally didn't happen to me :P~~ What I ended up with was to have my 3 seperate configs named as configurationA.json, configurationB.json, configurationC.json. Then when I want to swap to for example B I delete configuration.json, create a copy of configurationB.json and rename that copy to configuration.json. This way it stays clean ^^

ZottelvonUrvieh avatar Jan 02 '19 06:01 ZottelvonUrvieh