I had two programs running: gimp (which had 2 windows) and chromium. Grouping of taskbar buttons is disabled, so I had 3 buttons on taskbar. I closed one of gimp windows. The rest two button collapsed into one (see attached screenshot). Reproducible: Didn't try
Created attachment 71808 [details] screenshot.png
I'm able to reproduce bug. 1. Run GIMP. It should create _one_ taskbar button (for its document window). Sometimes it created two taskbar buttons, one for document and one for toolbox. In that case you may not be able to reproduce. 2. File->New, Ok. It created document in the same window. 3. File->New, Ok. It create document in the new window. 4. Run chromium. After this step you should have the following buttons order on taskbar: chromium, second gimp window, first gimp window (see attached screenshot). If toolbox window still has button on taskbar you wouldn't be able to reproduce bug. 5. Close _second_ gimp window. The first and third taskbar buttons collapse into one.
Created attachment 71809 [details] before-collapse.png
*** This bug has been marked as a duplicate of bug 229614 ***