Zend certified PHP/Magento developer

Understanding the prioritization of window visibility

I am wondering about the window visibility priority system that allows some windows to stay overtop of some other windows. For example:

  • when we use ‘Picture in picture’ mode in Chrome, we can force a video feed to be overlaid on top of most other program windows.

  • when we use a script, like this AutoHotKey script: ^SPACE:: Winset, Alwaysontop, , A we can force most program windows to stay overlaid on top of most other program windows.

  • When a program is set to full screen mode (like a game or media player) it’s window visibility will take priority over most programs.

I am interested in understanding the system that assigns the hierarchies of the program window visibility, and how Windows manages these hierarchies.

For example, why is the ‘Picture in picture’ mode in Chrome allowed to overlay everything except a full screen game? I thought perhaps all full screen programs took priority, however when SMPlayer is in full screen mode, the ‘Picture in picture’ mode in Chrome still takes priority.

So my question is this; what system is used to prioritize window visibility, and how are the hierarchies assigned to each program and their different modes?