mapeditor / mapeditor/tiled

Tiled sometimes opens the same map in two separate tabs, causing confusing behaviour (especially in Worlds)

Open
#3,099 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

Took me a while to figure out what was going on - I ended up writing out a whole issue report about the various things I was noticing, such as disappearing maps, changes being reverted/restored seemingly at random, the currently selected layer changing inappropriately when I switch between maps, etc. However when reviewing the video clips I recorded for the bug report, I realized that the issues I was observing seemed to be caused entirely by the fact that Tiled had opened up the same map in multiple tabs. It appears to have been picking between the tabs randomly when deciding what to render whenever I had a different map in the same world selected, and also picking randomly when I click on the world to focus it (the tab it ends up focusing is not always the same one that it was rendering).

Here are the two video clips I recorded, which I initially believed were recordings of some sort of data-loss bug, but I now realize just display the extremely confusing consequences of having the same map open in multiple tabs. Keeping a close eye on the tab bar at the top during these clips sheds light on what's going on here.

Video 1: Changes appearing and disappearing as I swap between maps.
https://user-images.githubusercontent.com/49110090/124789780-9069e400-df18-11eb-984b-84905c1a82b1.mp4

Video 2: Maps appearing and disappearing as I swap between maps. A single cluster of ground tiles also appears and disappears at random - at one point when I click on the map with the disappearing tiles, it opens the version that _does_ have them, and immediately afterwards I focus it again, opening the version that _doesn't_ have them. Looking at the tab bar reveals that it is in fact opening two different tabs. About 75% of the way through the clip, I close and reopen Tiled, which syncs them all, superficially fixing the issue - however if I were to continue making changes without closing the duplicate tabs, I would likely end up running into these same problems again.
https://user-images.githubusercontent.com/49110090/124792401-f9eaf200-df1a-11eb-9ab3-23815989fa4c.mp4

I'm not sure what exactly resulted in multiple tabs of the same map being opened, though - I'll keep a careful eye out for this and update the report if I figure out how to reproduce that.

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

The report names no files or tests and does not provide a reliable reproduction, so start by reviewing the two linked videos and trying to reproduce duplicate map tabs in Tiled Worlds. Trace the map-opening and tab-focusing flow once the behavior can be reproduced; done should prevent the same map from being opened in conflicting tabs and keep rendering and focus consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.