<div dir="ltr"><div>Is there a public / supported way to get notified when an OS-decorated window (native title pane from macOS, Windows, etc) is moved around or resized by the user grabbing the title bar or the border?</div><div><br></div><div>I want to get notified on that process starting so that I can hide all the popups. What I see is that at [1]
 this is how Swing's popup menu registers itself to get notified on 
window grabbing. Note that it's using internal, undocumented and 
inaccessible event mask. Then at [2] it gets notified that the window has been ungrabbed so that it can hide
 itself. Again, internal and inaccessible event class. And there's also APIs at [3] to grab / ungrab windows to have the whole process rolling.</div><div><br></div><div>Are there alternatives to these internal APIs that have been exposed as part of hiding the implementation details?</div><div><br></div><div>The only thing I could find so far is adding a component listener to the frame, but "componentMoved" is called with a noticeable lag, hundreds of milliseconds after the window has started moving.</div><div><br></div><div>[1] <a href="https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java#L790">https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java#L790</a></div><div>[2] <a href="https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java#L861">https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java#L861</a></div><div>[3] <a href="https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/awt/SunToolkit.java#L1641">https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/awt/SunToolkit.java#L1641</a></div></div>