|
@@ -63,6 +63,9 @@ public class WindowManager {
|
63
|
63
|
private static final SelectionListener selectionListener
|
64
|
64
|
= new WMSelectionListener();
|
65
|
65
|
|
|
66
|
+ /** The active window in the client. */
|
|
67
|
+ private static Window activeWindow = null;
|
|
68
|
+
|
66
|
69
|
/**
|
67
|
70
|
* Creates a new instance of WindowManager.
|
68
|
71
|
*/
|
|
@@ -323,6 +326,18 @@ public class WindowManager {
|
323
|
326
|
final List<Window> children = childWindows.get(window);
|
324
|
327
|
return children.toArray(new Window[children.size()]);
|
325
|
328
|
}
|
|
329
|
+
|
|
330
|
+ /**
|
|
331
|
+ * Retrieves the currently active window in the client, or null if no window
|
|
332
|
+ * is active.
|
|
333
|
+ *
|
|
334
|
+ * @since 0.6.3
|
|
335
|
+ *
|
|
336
|
+ * @return Active window or null
|
|
337
|
+ */
|
|
338
|
+ public static Window getActiveWindow() {
|
|
339
|
+ return activeWindow;
|
|
340
|
+ }
|
326
|
341
|
|
327
|
342
|
/**
|
328
|
343
|
* Fires the addWindow(Window) callback.
|
|
@@ -378,6 +393,7 @@ public class WindowManager {
|
378
|
393
|
/** {@inheritDoc} */
|
379
|
394
|
@Override
|
380
|
395
|
public void selectionChanged(final Window window) {
|
|
396
|
+ activeWindow = window;
|
381
|
397
|
for (SelectionListener listener : selListeners) {
|
382
|
398
|
listener.selectionChanged(window);
|
383
|
399
|
}
|