- if (window == windows.get(0)) {
- // Clicked on the same window, nothing to do
- assert (window.isActive());
- return;
- }
-
- // We will be switching to another window
- assert (windows.get(0).isActive());
- assert (windows.get(0) == activeWindow);
- assert (!window.isActive());
- if (activeWindow != null) {
- activeWindow.onUnfocus();
- activeWindow.setActive(false);
- activeWindow.setZ(window.getZ());
- }
- activeWindow = window;
- window.setZ(0);
- window.setActive(true);
- window.onFocus();