Capture event on title bar

Is it possible to capture an event when pop up window manually move (in client) clicking on title bar.

for eg.

I am opening a popup window (popup-2) from another popup (popup -1). I want to close popup-2 when I move my popup-1 by dragging title bar of popup-1

.