Exit fullscreen resizing bug?

When exiting fullscreen in a built osx application the window doesn’t return to the default size. It turns into a window but the window remains the size of the screen. I see this behaviour in db 2802. Is this a bug?

Is there a way to turn of the fullscreen feature altogether?

this is my build settings:

window = {         defaultMode = "normal",         defaultViewWidth = 1024,         defaultViewHeight = 768,         minViewWidth = 1024,         minViewHeight = 768,         enableCloseButton = true,         enableMaximizeButton = false,         enableMinimizeButton = true,         suspendWhenMinimized = true,         titleText = { default = "My Application" },     },

this is my config:

application = { content = { width = 320, height = 480, scale = "letterbox", xAlign = "center", yAlign = "center", fps = 60, }, }

thanks

Strange. When changing these build.setting values:

        defaultViewWidth = 1280,         defaultViewHeight = 720,         minViewWidth = 1280,         minViewHeight = 720,

it resizes correctly.

OS X tries remember window sizes in the user’s preferences and that can cause strange behavior when testing with different settings (it’s generally not an issue once an app’s window sizes have settled down).

Try removing the app’s preferences using a command like:

defaults delete com.mycompany.myapp

(substituting your own values, obviously)

Thanks Perry

I think it would be nice if it was possible to add an event listener for window size changes.

Then we could adjust the graphic layout when the window is resized or when it goes into fullscreen on screens with different ratios.

I guess that is a feature request :slight_smile:

It’s already implemented :slight_smile:  Take a look at  SampleCode/Interface/DesktopWindow , in particular the  onResized event handling.

Amazing!

I guess I will have to do my homework better before requesting stuff next time :slight_smile:

I too have an issue with resizing.

If I make my app full screen by clicking the green “maximise” button top left of the window it goes full screen. No problem so far. But then when I try and turn it back to the original size by clicking the green button again, the window shifts so it’s partly off the screen (i.e.: part of the window is outside my Macbook’s screen - it’s like the whole thing has shifted up and right by about 200 pixels).

I’ve tried various default / min sizes including those mentioned above and I get the same behaviour with each.

I’ve also tried deleting the defaults as suggested but I get a message saying my app doesn’t exist. I’m definitely using the same identifier I used in the provisioning profile so not sure why it can’t find it. Message is:

Domain (uk.co.keystagefun.osx.testApp) not found.

Anyone else experienced anything like this? My code is below.

Relevant part of build.settings file:

orientation =         {                 default = "landscapeRight",                 supported =                 {                         "landscapeRight", "landscapeLeft"                 },         }, window = { defaultMode = "normal", defaultViewWidth = 1280, defaultViewHeight = 720, minViewWidth = 1280, minViewHeight = 720, resizable = false, enableCloseButton = true, enableMinimizeButton = true, enableMaximizeButton = true, },

config.lua:

content = {   width = 320,   height = 480,   scale = "letterbox",   audioPlayFrequency = 44100,    imageSuffix =   {       ["-hd"] = 1.5,   }, },

One way to find the preferences for an app is run it, move its window then quit and run:

ls -ltr ~/Library/Preferences

The preferences for your app should be at the bottom of the listing because they were recently modified.  Remove the .plist from the end of the name and use that with the defaults command.

Does the CoronaSDK sample Interface/DesktopWindow exhibit the same issues you see with your own app?

Thanks for getting back to me so quickly Perry. I did what you suggested and got the following entry for my app:

uk.co.keystagefun.osx.testApp.plist

I removed the .plist and ran the following:

defaults delete uk.co.keystagefun.osx.testApp

But I still get the message:

Domain (uk.co.keystagefun.osx.testApp) not found. Defaults have not been changed.

I’ve triple checked it and it definitely doesn’t seem to run…

If anyone has any ideas they’d be much appreciated.

Thanks.

Paste the line from the ls -ltr command you ran that has your app’s id on it.

It was uk.co.keystagefun.osx.testApp.plist

Does the CoronaSDK sample  Interface/DesktopWindow  exhibit the same issues you see with your own app?

Okay - I’ve done some testing.

When I set “resizable” to false in the sample app then yes, exactly the same thing happens.

And if I set resizable to true in my app then it works okay.

So basically, with resizable set to false, any app seems to exhibit the same behaviour, namely that when in full screen mode, if I hover my mouse top left and then tap the green button that appears, the entire window shifts up and right so it’s partly off the screen (about 30% - 40% of the window is off screen). There is then no way to get it back on the screen as the green maximise button is no longer available as that presumably is also off screen. So I have to choose to Exit from the Mac menu and then relaunch.

BUT…

Interestingly, if I open the sample app full screen and then click the button you’ve included within the actual app to “maximise” I can then use the green Apple maximise button no problem and the window doesn’t move off screen. I can flick between full screen and maximised window and everything works perfectly, but only after I’ve manually clicked the button you included in the app.

Obviously I don’t really want to include a maximise button within the app myself. I could code it do this automatically the first time the app runs but I would prefer the user to start in full screen.

Is this a general bug or is it only happening to me?

Thanks.

@keystagefun

I am seing the same thing as you.

Even after succesfully running the defaults delete command.

Daily Build 2810 and higher implements the resetting of the remembered window position if Shift is held down while app starts.  This will provide a way to reset things if you can’t find the app’s preferences.

I’m having some trouble reproducing the issue you describe with the DesktopWindow sample. I made it not resizable but everything still worked as I expected it to.  One thing that is a little confusing from your description is that you seem to be using “fullscreen” and “maximize” interchangeably when they are distinct concepts.  “Maximize” means “make the window the size of the screen”, “fullscreen” means “enter a non-windowed special mode that occupies the whole screen” (these are OS X concepts which we implement).

 Can you list the steps I should take with the sample and what I should see?

Hi Perry.

Sorry for the confusion.

Okay - in the top left of any Mac window there are 3 buttons - a red one to close, a yellow one to minimise and a green one that toggles between full screen and window mode.

It’s this green one I’m referring to.

If I launch my app in full screen mode by setting that as the default launch mode in my build.settings file and then hover my mouse top left of the screen, I see these 3 buttons appear. If I press the green one I find my app shifts upwards and to the right so that around 30% - 40% of the app is off screen.

The 3 buttons are then not available so I can only close the app via the menu bar at the top.

The same thing happens with your example app and it happened the first time I ran it.

So it should just be a 3 step process to recreate it:

  • Launch the sample app (it launches in full screen mode by default)

  • Hover your mouse top left of your screen

  • Then press the green button that appears in the menu bar (next to the red close button)

The app should then move partially off screen.

Sounds like @ojnab is seeing the same thing.

Thanks,

Ian

Yes it is exactly what I am seeing.

Thanks for the details … they help a lot.

That doesn’t happen for me.  What version of OS X are you running?

El Capitan - 10.11.1

Thanks.

I am on El Capitan - 10.11.1 too.

 

I investigated this a bit further. The issue doesn’t appear when I build the samplecode DesktopWindow project, but it still happens when building my own project. 

 

So I decided to attach a sample project showing the bug. You can find it here:

http://www.shakebrowser.net/ResizeBug.zip

 

In the screenshots folder you will find screenshots showing how the bug looks on my computer.

 

Hope this will help tracking it down.

Thanks.

How does your sample project differ from the DesktopWindow project?  I ask because that seems to be the crux of the matter :slight_smile: