Strange reversion to full screen

Hello
I have a Xojo application (AquaView) which displays marine information.
The application takes data from a number of serial ports (typically 6 ports, tide, weather, etc), does some processing and displays the data as graphs.
It normally runs in a window, about 1/2 of the full screen.

It has been running well for some time, but every week or so the application suddenly jumps to full screen mode. I have no idea why.
I have never actually seen it change, but the operator comes back to the computer and sees that it has gone to full screen mode.
The rest of the application runs normally.

The only way to get it to go back to normal display mode is to restart the application.

Any thoughts?

Thanks

Normal running

Jumps to Full Screen mode

DId you search through your code looking for call to a method that will maximize the window ?

Tha Maximize button is not disabled, then the user may click on it. Log something when the window is maximized and also capture the call stack to identify what happens prior to the window going maximized.

Can someone connect to the computer and maximize the Window ?

hi Gilles
Thanks for the reply.

Yes, I have searched for WindowMain.Maximize - nowhere in the code.

Your suggestion about someone simply hitting the maximize icon is of course a reasonable comment to explain why it goes to full screen mode. However, normally I run the program with the maximize icon disabled.
While trying to find the reason for the strange jumping to full screen mode, I ran a version with the maximize icon enabled (which is the one shown in the figure), thinking that, at least the operator can click on the icon and return it to normal mode, without having to restart.
But, f it goes to full screen mode spontaneously, clicking the icon simply returns it to a slightly-less-than-fullscreen-mode, not back to normal mode.

Note that clicking the maximize icon manually does send it to full-screen mode as expected. If this has been done manually, then clicking the icon again returns to normal mode, as expected.

Yes, someone CAN connect remotely and click the maximize icon. Everything works as above, i.e. as expected.

Yes I can start logging when the application goes to full-screen.
I was hoping there would some simpler explanation without going into debugging exersize.

Note I have written many real world Xojo applications and have never seen an application spontaneously jump to full-screen mode for no apparent reason.

I’m not sure if this is what I’m thinking about, macOS now has a snap window option, which if you drag a window in a certain way will make it occupy the whole screen, without going full screen. Other systems have similar annoying tricks, perhaps that is it?

In the worst case and while you are searching for the cause of the issue, if the window is always visible on monitors with the same resolution, scaling and aspect ratio, you could sporadically restore the position and size of the window using a timer (read: reposition only when the current values ​​deviate from the default values).

hi Ian
Yes I know of those functions.
But in this case that isn’t the issue, since in general no one touches the system and we come back in the morning and application has gone to full-screen. We know no one has manually interacted with it (local or remote) because it because it’s in a locked server room, and remote access is disabled.

The application is actually quite an important application for many tide gauges in the harbour.

1 Like

hi Sascha
Yes I can do that and periodically re-establish the main window while troubleshooting the real cause.
And it always worries me a little when the program does something I don’t understand.

Generally speaking, Xojo has been a reliable language for real time apps. I’ve been using it for a few years and this is the first time it’s done wacky.
Luckily all the other functions (reading real time data, writing to data files, etc) are working OK. Which is important since a lot of people are relying on the data and displays.

Investigations:
Put some logging in the resized event?

Preventions:
Why not make the window fixed size. Turn off resizable, minimise, maximise buttons etc

hi Ian
Yes, I have done all those things.
Turn off resizable, no minimise, maximise icons etc
It still resizes to full-screen by itself!
But only every week or so.

I see it’s a windows app. Which version of Xojo was it built with? Is it running in what OS version? Are you using plugins? Are you using declares? Is it running in a more than one display? Any chance of disconnect/reconnect some of those displays by any kind of event, even like electric fails on one of those monitors?

Sounds like the display is resizing and causing the app to do so. Possible bad monitor, cable etc.

hi Rick
Here’s answers to your questions, in order:
2023, r4.1 (year the original app was written)
Windows 11
No plugins
No
One display
Display is not connected/reconnected
Displays have not failed
(note this is highly reliable hardware as the application has to run 24/7 for tide monitoring)

hi Ian
Nothing wrong with the monitor or cables
note 1 this is highly reliable hardware as the application has to run 24/7 for tide monitoring
note 2 just to re-iterate: The rest of the application has run continuously for several years, processing tide data, writing files, etc.
This problem is entirely in the way the main window re-sizes itself roughly once a week.

Is the app made of 2 parts? I guess one logger (for years ok) and one presenter (I presume new, showing new symptoms never seem before) ?

Have the monitor part worked ok in the past? If yes, what changed? (Xojo version, updated code, updated hardware…) If no, I suppose it’s a new code using Xojo 2023r4.1

It doesn’t get to the root of the problem, but if you set the minimum and maximum window width and height to your desired size it should prevent resizing.

If it’s still going full screen, then that would be even more strange.

hi Rick - There’s only one application.
When I said “the rest of the application” I simply meant all the (important) parts concerned with inputting and processing the data and writing to files, as compared with the parts that display on the screen.

Jared - yes I will start doing explicit things like that.

However I would have thought that 1. making the window non-resizable, 2. ensuring there’s nothing in the program which resizes the window, and 3. disabling the maximize/minimize icon would have stopped the main window from re-sizing.

My main reason for asking this question was to see if anyone else had seen spontaneous re-sizing to full-screen. After many responses, apparently this is not something that anyone has seen for unaccountable reasons.

Peanut gallery: could he throw an exception in the Resized handler and run a stack trace to see where the event is coming from? Would the Resized event even be accurate in the sense that it would indicate why the actual resizing occurred?

Thanks Eric. Yes there are a number of debugging techniques I could use, including the one you suggested.

The main reason for asking the original question is to see if anyone else has seen something like this, before I spend time on debugging. This may be difficult to find, since it occurs so rarely (about once a week), and it may take a while to catch.

Since no one apparently has, I’ll start debugging and put a lot of breakpoints and triggers, etc in the code.

Rgds

I can tell you that this is not true on macOS. Full screen is different than maximized.