isFocused, isMinimized, isActive

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

isFocused, isMinimized, isActive

Post by agamemnus »

isFocused, isMinimized, isActive

Those three functions are very confusing if you take them at face value, especially for beginners. A better explanation in the manual would really help. (renaming the functions would work even better)


In Windows (XP at least), these are how the states work:

isMinimized: The window is either minimized OR maximized.

isActive:
* If you click or set focus to another window, the window will be inactive.
* If you minimize a window (by clicking the "-"), the window will be inactive.
* If you minimize a window by clicking on it in the task bar while it is focused, it will still be active.

isFocused: This is true when the window is not minimized, and when the window is the "focused", active window. (how else to describe it?)


The big "gotchas" are that isMinimized can mean either "I'm minimized" OR "I'm maximized" and that isActive is sometimes true, even when isFocused is false. Essentially, as far as I can tell, the isActive does not seem to serve any purpose, and it is better to use a combination of isMinimized and isFocused.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The state of isActive is seen from the OS' point of view. There's a group of applications (probably only very few at each point in time) which get special attention by the OS. This can happen to apps which are minimized. Still, they get more CPU time or whatever things your OS is ready to give those.
The foxus is usually regarding the event input mechanism of the OS. So being focused means that certain events will only (or primarily) reach this app.
The minimized test should only return true if the app is indeed minimized. It uses a system call to check for this state, so the value should be correct. Maybe there's an update glitch somewhere. Having a test app which reproduces this problem is the only way to fix it in case there's really a bug.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

are DX resources allocated also in
windows that are minimized but active?
Last edited by REDDemon on Sat Nov 13, 2010 7:06 am, edited 1 time in total.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

Is that a question or a statement? :?
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

a question because every draw call when DX are not allocated make the app crash.

So it is usefull to know in how many cases that appen and I really don't know when it appen :)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I dunno, and am too lazy to check, but it should be easy to check... just test for when it is minimized and active and start a new irrlicht instance with dx.
Post Reply