Compiled Programs Unwanted Minimize when Lost Focus

New I reckon, I am VB 5 /windows XP orphan now working from OS X Yosemite.

My compiled (Built) programs when open and have focus, always minimize if focus is lost to another screen object including generic Desktop. I am only building a desktop local use basic license version.

For example: Safari and compiled program are open and side by side on the screen, and the compiled program has focus.
Clicking on Safari makes the compiled program minimize.

Anyone know of a property that can be set that prevents automatic minimization of a compiled program when it loses focus-- or maybe there is a way to control that programmatically?

Alternately, suggestions for search words for a google search would be appreciated- no luck finding any discussion of that behavior searching many permutations of words like “XOJO compile/ built programs minimize lost focus” etc.

To the best of my knowledge, to duplicate the behaviour you are describing, you would need to ACTIVELY code something into the DEACTIVATE event (windows don’t have a LOSTFOCUS event) to cause this to happen… It is not a default behaviour that I have ever seen.

Clicking on another application will cause your app to LOSE FOCUS, but NOT automatically minimize

unless you do this in the DEACTIVATE event



Search your Source for “Minimize”. Sounds like you have Window.Minimize oder self.Minimize in your deactivate Event of your Window. :wink:

@Dave S was faster :smiley:

Dave S. : Highly respect your comments on other folk’s issues- they have been a great help in getting my feet wet, your comments always insightful. However, in this instance not as you expect: no code for a Deactivate Event for either App or Window. None the less I can duplicate the behavior described each and every time. You are exactly correct no Lost Focus event for windows or app. The sucker minimizes each time I click on another Application window- which I think would potentially trigger the deactivate event though I have not inserted one anywhere in project, and certainly no code for deactivates.

Sascha; There is no “minimize” coded into project, on search “minimize” it only occurs as a Window property (minimizeButton).

Tis a puzzler, despite no code or overt action, compiled program minimizes when deactivated. Appreciate your comments, I have researched the deactivate event following your pointers, learned a little more (every day!), but not yet found any discussion of similar behavior. D2

And its JUST a plain click - no modifier keys being held when you click ?
Holding down a modifier may make the OS minimize your app and it that case its not your code at all.

Just to be clear, when you say “minimize”, do you mean that the window(s) of your app is minimized to the Dock? As if you had clicked the yellow minimize button?

OSX does have a Single Application mode that can be enabled and sounds like it works as described, but @DerDuck Dickel stated that he had Safari and his app open side by side before clicking on Safari.

Norman: Just a plain click, a routine click on another app window, or desktop, or “anywhere” (quotes because can’t claim to have exhausted absolutely ‘all’ places I can click)- but to date anywhere away from my compiled XOJO app window. No modifier keys.

Gavin: yup minimizes to dock, same as if I had clicked yellow button.

Scott: I have to go away for a while, but I will check out internet into “single application mode”, that is a search key phrase I have not thought to use. The compiled program seems to act that way, though as you noted, clearly not the OS X environment as I often have several apps open on the desktop. However this may be a great clue for my puzzle, and I will hunt it down to see if apropos when I get back home…

Thanks to all- for a new guy its amazing to be able to discuss this with folks that are interested… my wife’s eyes glaze over…


There is one that makes a double click on the title bar minimize and app to the doc
But that would obviously be a double click not just a single click

I cant think of any other reason this would happen esp if there is no code in your app

Does a new empty desktop project do this as well ?

Norman- Great Test! Answer is NO. I made a totally empty new project and it does not minimize when I click away from it.

MUST be something in my code as initially suggested by Dave S.- especially as no one else seems to experience this.

I will look harder and report back. May be in the App close event if it triggers when I click away- I have a Quit in that event 'cause in design mode was concerned about ‘resume’ vs. ‘run’ when I red buttoned the project- that may have implications for the compiled versions I didn’t realize.

I have tools on my System which perform various tasks based on triggers like Window Names, File Dates, … (Hazel, TextExpander, Keyboard Maestro,…).

Maybe some kind of Tool is causing this? Would changing the name of the Window f.e. change the behaviour?

This only occurs on a built app, not when running the debug app?

FINALLY! Thanks Norman, testing on a code-less new project allowed me to find what causes the behavior! Nothing to do with Quit etc. or other overt code: Here is the answer:

A new project window Type (property?) defaults to Document. As ignorant newbie I changed that to Floating Window (crossing over from VB and not up on XOJO terminology- I thought-‘why would I want a document, I want a window…’).

As it turns out, a new code-less project with a default ‘document’ window does not minimize when not active— but if I change the window type to Floating Window… by gum the darn thing minimizes if anything else is clicked (I call it lost focus though no lost focus event per se, deactivate is probably more correct description).

So to fix problem, I made the window type a Document, and presto… all is good.

I think this solves the mystery. Thank you Norman for taking me back to basic bug catching: systematic comparison of unruly compiled program with an obedient absolute generic new project was the key. D2

You should probably check out the manual to learn about window types and how they behave.

Yup, figured that out about 14 hours ago!

Though actually I don’t think the manual makes it all that clear floating windows will minimize if not the active screen object, it talks mostly about behavior that puts it on top (or not) of other apps. It does say ‘document’ window type is most commonly used, but…
that discussion is not found until manual level 2, while I rashly started with manual level 1.

Even a search for XOJO Windows types on internet was not that useful until I figured out it seems is a Windows “Frame” property type, an that discussion points to the 2nd level manual.

It is curious that there doesn’t seem to be a lot of others that experienced this, I reckon Floating Windows are not much in use.

Probably the lesson is for a beginner to not change default settings unless sure of a reason to do so…


[quote=211528:@DerDuck Dickel]Probably the lesson is for a beginner to not change default settings unless sure of a reason to do so…


There is such thing as experience, that is not necessarily found in manuals. You may actually want the floating window one of these days, and at that point, you will remember.

Programming is as much a craft as an exercise in logic. Sometimes what seems like a mistake can become an important asset.