RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
785 stars 259 forks source link

Alt-Tabbing while Edit Token dialog is opening can lock up MapTool #1198

Open Phergus opened 4 years ago

Phergus commented 4 years ago

Describe the bug Alt-tabbing from MapTool while the Edit Token dialog is opening can cause the UI to become non-responsive. This can be tricky to reproduce and is easiest when there are a lot of token properties so that it takes longer for the dialog to open.

To Reproduce Steps to reproduce the behavior:

  1. Double-click on token to open dialog
  2. Before dialog has finished loading, hit alt-tab to swap to another application.
  3. Switch back to MapTool and the dialog may or may not respond.

MapTool Info

Desktop (please complete the following information):

Additional context Reported on Discord by Zey. Campaign File used to reproduce issue: ZeyLockUpAltTabIssue.cmpgn.zip

Azhrei commented 4 years ago

macOS 10.14.6 (latest Mojave) MapTool 1.6.0-alpha-4 .dmg install (not current)

I was not able to reproduce this with the token editor open and all frames docked.

However, undocking some frames and trying again, I was able to replicate the OP's symptoms but due to a different issue, I think; keep reading.

The Mac has issue #1087 that causes dialogs to open below JIDE frames. This makes it look like MapTool is locked because the dialogs are modal and disallow access to the frames, but are not visible because they're under said frames. Because this issue was reported against Windows, I don't believe these are related (no "pop under" dialogs reported on Windows).

Also, I found this on Reddit regarding slow switching times for Alt-Tab. (If the switching time is slow, perhaps switching away and back is happening so fast that one or the other application isn't completely releasing the video in time?) It's based around full screen games, but the underlying issue is likely the way the video drivers are managing memory and talking to the OS.

Go to Settings > System > Focus Assist and toggle the switch for When I’m playing games to off.

When this happens on Windows, does the cursor still flash in the token editor dialog?

Phergus commented 4 years ago

I don't recall the cursor flashing but then the actual dialog hadn't finished rendering when alt-tabbing away so no property field was active. Note that being full screen isn't required for this to happen though I'm fairly sure the OP was running full screen.

Was only able to reproduce this with a large number of token properties and the Edit Token dialog took several seconds before it finished rendering the properties tab.

Azhrei commented 4 years ago

I loaded the campaign but didn't see any existing tokens and created one of my own. I'll try filling it up with a few KB of data in each property ;) and see what happens. I didn't place the focus in the property list, either; something else to try. I did make sure to cover the dialog with another window so that MT/Java would be forced to refresh the entire thing.

Cocoa on the mac (the GUI) might cache the contents of the dialog, meaning MT wouldn't have to redraw it every time the window exposed. I'm positive Windows doesn't cache it, and certainly not in full screen mode. (Full screen means the program has full control of the video and the OS can't even draw the preview window you usually get when you hold down Alt-Tab to see the list of apps.)

I'll continue to try various things on the mac...

Phergus commented 4 years ago

That campaign has a single map with twenty plus tokens on it. Not sure how you could miss them.

Azhrei commented 4 years ago

Hah, I found the issue. The file association was there for .cmpgn files, but it was one of my testing setups and it pointed to a version of MapTool that did not support command line campaign filenames. So the association was starting the app, and the app was ignoring the filename and using an empty campaign. My bad.

Even so, I couldn't reproduce the issue. I tried it with the token editor open and (a) the sub panel for a large property open, (b) the sub panel closed but the field highlighted, (c) the cursor at the start of a long field (so I could see the cursor flash), and JIDE frames docked and undocked (when not testing full screen). In every case, I made sure that the window I was switching to covered the dialog that was open (to force refresh of the panel, in case that was related).

I tried using Alt-Tab about 15 times or so in each of the different configurations.

I'll monitor this issue and test again if any new information becomes available on recreating it, but so far, no luck on macOS...

Merudo commented 4 years ago

Another campaign that produces the bug is from issue #472:

1) Load the campaign Empty Map with Two Tokens.zip 2) Double click on Dragon 3) Quickly press Alt+Tab 4) Wait a bit, and come back to MapTool 5) Often, the token window will freeze

Jmr3366 commented 1 year ago

Is this still an issue as I can't duplicate this problem?