Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.49.15] Unit display general tab rendering blank when new unit selected. #4876

Closed
SimonLandmine opened this issue Nov 6, 2023 · 13 comments · Fixed by #4939
Closed

[0.49.15] Unit display general tab rendering blank when new unit selected. #4876

SimonLandmine opened this issue Nov 6, 2023 · 13 comments · Fixed by #4939
Labels

Comments

@SimonLandmine
Copy link

0.49.15 standalone MM
Windows 10
Java11

Each time it is my turn to move (or when I switch which mech I wish to move), the 'general' tab of the unit display becomes completely blank (see screenshot). This is the case whether the display is docked or floating.

Using 'switch location' will force a refresh, as does 'switch view', but selecting a different mech to use will cause the error again.

image

Savegame: user 'SimonLandmine'
Woodland_2023-11-06_03-49.sav.gz

@SimonLandmine
Copy link
Author

UPDATE
If unit window currently on another tab, the other tab renders correctly, but the general tab is blank when switched to, which suggests the issue is specifically with the general tab.

@SimonLandmine
Copy link
Author

UPDATE
This only seems to be the case when the map is zoomed out to maximum or one notch beneath maximum. The Edge Cases ride again. (I should call my unit that.)

@kuronekochomusuke
Copy link
Collaborator

#4444

@neoancient
Copy link
Member

I've tried with the saved game and new games and I can't generate the same result.

@Sleet01
Copy link
Collaborator

Sleet01 commented Nov 29, 2023

I've tried with the saved game and new games and I can't generate the same result.

I'd guess this is due to some UI scale calculation or something, so it might not repro unless you have the same resolution and layout of desktop.

@SimonLandmine can you provide the screen resolution and layout for all screens that make up your desktop? Not just resolution for each screen, but also orientation, relative position, and virtual desktop size (if you have multiple monitors)?

@HoneySkull
Copy link
Collaborator

I've been able to reproduce this on Windows 11 with Java 11. I've actually spend a few days trying to debug it. It's weird though, because I can capture the text being set on the JLabel for the general panel when selecting a new unit in the move phase - and have proven there is nothing wrong with the fonts, size, etc.

I even, in my debugger put code in to override the text going into the general panel so that it says, "Hello World" and It still shows blank when selecting a new unit. (if you hit the mouse 4 button to hide the panel and then reshow it - it then displays.)

I had a theory that there was some setting in the boardview scaling that "hid" text when zooming all the way out, but confirmed that has nothing to do with the mech display general tab.

This almost seems like a Java Swing bug. But I'm not convinced because it is SOMEHOW linked to boardview scaling - but could it be memory? or concurrency related. I even tried putting in debug code to force repaint, redraw the panel, and lable and still had the same blank result until hiding and unhiding the dialog, or scaling the map in 2 clicks and then selecting a new unit - at which time the general panel is then displayed correctly.

I created a game with 1 board, 5 units and was able to reproduce the issue.

My next step was to see if somehow the z-layer setting on the JLabel was somehow rendering behind the background...

generalTabIssue.sav.gz

@HoneySkull
Copy link
Collaborator

I've tried with the saved game and new games and I can't generate the same result.

I'd guess this is due to some UI scale calculation or something, so it might not repro unless you have the same resolution and layout of desktop.

@SimonLandmine can you provide the screen resolution and layout for all screens that make up your desktop? Not just resolution for each screen, but also orientation, relative position, and virtual desktop size (if you have multiple monitors)?

I could reproduce this with docked and undocked layouts. I am using a single monitor - I haven't tried with a multi-monitor setup. I'm using default jvm settings and memory settings.

@HoneySkull
Copy link
Collaborator

image

@kuronekochomusuke
Copy link
Collaborator

im not getting it with your save. I have gotten it in the past, when I logged the linked issue. Was getting it a lot then, but have not seen it lately.

I have a NVidia 3060ti
image

It seemed to me related it html in labels and buttons when I was getting it.

If you reboot do you still get it?

@HoneySkull
Copy link
Collaborator

Yes - I can get it to occur consistently when the map is zoomed all the way out at the two most zoomed out levels. I wonder if its a Java 11 vs Java 17 issue. Can you get this issue to occur when you only allocate 4G ram for Megamek?

@kuronekochomusuke
Copy link
Collaborator

kuronekochomusuke commented Dec 2, 2023

zoom out the game board to max level and I it get it with 8G

@HoneySkull
Copy link
Collaborator

I did find a code change that fixes this issue on my machine - but I need to do some more testing with it because I can't 100% explain why the change works. But I do have a theory.

@SimonLandmine
Copy link
Author

Sorry @Sleet01, was away from the home machine, although it looks like @HoneySkull may have a possible fix.
It's a bit of a potato, but I have 4G RAM allocated to MM.
I'm running three monitors (thanks to a DisplayPort dock), and this was running the affected MM window solely on the primary/central monitor.

Monitor specs are ...
Primary monitor (centre) - 1920x1080 (landscape)
Secondary monitor (left) - 1080x1920 (portrait)
Laptop monitor (right) - 1366x768 (landscape)
All are scaled at 100%.

NickAragua added a commit that referenced this issue Dec 5, 2023
#4876 Fix Unit Display General tab rendered blank when switching units.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants