I made him a test version to check the screen id of main window and sheet. I can see that in the middle of doing things the sheet window changes the screen.
Xojo 2020r2.1 and 2019r3, macOS Catalina. I can’t reproduce the problem with High Sierra.
@ChristopheDV : you jokester. The icons are in disabled look because the sheet is showing.
@Sam Rowlands: sigh… This is a garden variety sheet shown with ShowModalWithin.
Changing size of window: have been doing that since forever. The progress window shows the current mailbox path. If you have a long mailbox path then the app changes the height of the window.
Nope, only using one window.
Okay, good to know.
The user said that he has the problem for a longer time. I’ll assume that he has rebooted.
Whenever the mailbox changes the height of the window is recalculated. The user said that at sometimes then the sheet escapes.
At my end, this happens with Sheet windows containing Toolbar items.
The project seen above is the last one that still needs to be converted to newer Xojo versions,
removing Toolbar items from Sheet windows (no longer possible with recent Xojo due to framework reasons), and probably going away from Sheet windows as well.
hmmm… While I have to confess that I’ve never tried to use a Toolbar on a sheet, I am not sure this is it as I don’t see @Beatrix_Willius using a Toolbar there.
I’ll admit that it might be more than one thing causing this issue.
While you may no longer be able to use the Xojo Toolbar in a sheet window, you can ‘roll’ your own pretty easily, with a canvas, some duct tape and black jacks.
Yes, it is. And you’re right, on the Willius screenshot I don’t see toolbar items as well.
As said, I’m working on a Xojo 2020 version of this project, either removing Toolbar items from sheet windows or re-thinking about them, as you wrote, with Canvas items.
The sheet windows used in my projects, that doesn’t have a toolbar, are not movable around.
My example seen above has been made with a Xojo 2018 version.
Probably the issue seen above results from a combination of macOS version used + older compiler (framework version used).
Did some screensharing this morning with another user. The user had 2 screens and there, too, the sheet window was not on the same screen as the main window. Sugar!
Did you check the logs? I added a sheet window to my debug builds to test it more easily, and when it opens I will see this in the messages pane:
Attempting to show sheet window ‘Virtueller Kontrollstreifen (VCS)’ with no parent
I know you do have a parent window, but I encountered some weird parent misassignments in sheet windows myself which I could alleviate by setting the parent on global app level.
Yup. There I could see that the sheet window moves back to the main screen. However, checking that the window still has a parent is a good idea. As with everything even a measly progress window is nowadays complex: pagepanel with 3 panels, can change its height and so on.