http://imagej.273.s1.nabble.com/Bugs-in-the-Window-menu-tp5024099p5024123.html
today's daily build, 1.53g1.
> Strange that you can't reproduce it; I see the same behaviour on different PC's, different Java versions and different ImageJ versions as long as they are newer than 1.52e.
>
> First, notice that this example only fails if the folder name is also "t1-head", as that will set the default name of the window when opened. If we rename the folder to "t0-head" the macro will not fail.
>
> Here is a more complete macro, which also creates the folder to be opened:
>
> run("Close All");
> run("T1 Head (16-bits)");
> dir = getDirectory("Temp");
> dir += "t1-head/";
> if (!File.isDirectory(dir)) File.makeDirectory(dir);
> print(dir);
> run("Image Sequence... ", "dir=[&dir] format=TIFF");
>
> run("Close All");
> run("Image Sequence...", "open=&dir sort");
> rename("t1-head");
> run("Image Sequence...", "open=&dir sort");
> rename("t2-head");
> run("Image Sequence...", "open=&dir sort");
> rename("t3-head");
> run("Image Sequence...", "open=&dir sort");
> rename("t4-head");
>
> I tried to use the debugger, and this reveals where the problem lies.
> See the attached screenshots if you still can't reproduce it.
>
> After we have imported the folder the first time, the first window is named "t1-head" as expected. When the folder is opened for the second time, the name of the new window is also "t1-head" since that is the name of the folder. So we now have two windows named "t1-head", and two menu entries "t1-head". The second rename correctly renames the second window to "t2-head", but the FIRST window menu entry named "t1-head" is changed instead of the second one. So now the names in the window menu entries no longer match the names of the windows. Then opening the folder for the third time, the same repeats. We get a second window named "t1-head", and the wrong window menu entry is renamed, so the "t1-head" entry pops down.
>
> Stein
>
> -----Original Message-----
> Sent: 25. oktober 2020 21:48
> Subject: Re: Bugs in the Window menu
>
>> On Oct 22, 2020, at 2:39 PM, Stein Rørvik <
[hidden email]> wrote:
>>
>> There has for a long time been a bug in the Window menu that sometimes causes the wrong image to be selected when selecting an image name from the dropdown, but I have not been able to reproduce it earlier as it depends on the order of window opening and closing. But today I found a simple way to reproduce the issue:
>
> I ran this test macro on MacOS and Windows and was not able to reproduce the problem. The images were always listed in the Window menu in the expected order.
>
> -wayne
>
>>
>> dir = "C:/Users/steinr/Temp/t1-head/"; run("Close All"); run("Image
>> Sequence...", "open=&dir sort"); rename("t1-head"); run("Image
>> Sequence...", "open=&dir sort"); rename("t2-head"); run("Image
>> Sequence...", "open=&dir sort"); rename("t3-head"); run("Image
>> Sequence...", "open=&dir sort"); rename("t4-head");
>>
>> Selecting the first image on the list selects the first window, but the window title entries in the Window menu is in the wrong order; "t1-head" is at the bottom of the list.
>>
>> This bug has been there for a couple of years; I reverted to earlier versions and found that this was working in 1.52e and fails in 1.52f.
>>
>> Another bug is that if a plugin should happen to install an entry to the Window menu, the plugin entry appears as expected before the list of open images, but the image titles in the menu do not match the corresponding image window. Probably the building of the window menu list forgets to take into account the possibility of extra menu entries already there. This bug does not occur in Fiji.
>>
>> Stein
>>
>> --
>> ImageJ mailing list:
>>
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimage>> j.nih.gov%2Fij%2Flist.html&data=04%7C01%7Cstein.rorvik%40sintef.no
>> %7C70c1195961484c9a41a608d8792bd61c%7Ce1f00f39604145b0b309e0210d8b32af
>> %7C1%7C0%7C637392576506306854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
>> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7n
>> AHXKI1PXLXdI9Sf5k2BRKJa%2BsDN7pkm%2BISO0RsQGw%3D&reserved=0
>
> --
> ImageJ mailing list:
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&data=04%7C01%7Cstein.rorvik%40sintef.no%7C70c1195961484c9a41a608d8792bd61c%7Ce1f00f39604145b0b309e0210d8b32af%7C1%7C0%7C637392576506306854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7nAHXKI1PXLXdI9Sf5k2BRKJa%2BsDN7pkm%2BISO0RsQGw%3D&reserved=0>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>