Add Window to a viewport?

I want my Window to be on top of other viewports. So just adjusting the z-index isn't enough. But I can't get it to work and the documentation doesn't explain it either:

viewportRefers to the viewport (Viewport) associated with the window.
Code:
class Window_Popup < Window_Base  @@nap_viewport = Viewport.new  @@nap_viewport.z = 999  def initialize(..)    #@viewport = @@nap_viewport # Doesn't do anything.    viewport = @@nap_viewport # Doesn't do anything.    #self.viewport = @@nap_viewport # Obviously crashes because using "self" during the initialize()...    ..  end  ..end
At least Window.viewport is both a setter and a getter. But the above does absolutely nothing. I don't get it, where/how do I set the viewport?
Of course it crashes because you haven't call the original initialize method

It won't crash if you do it in this way

Code:
def initialize(...)  super  self.viewport = @@nap_viewportend
Ah of course... I figured that the setter did more than just assigning the variable. I just forgot to place it AFTER super(..). Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/add-window-to-a-viewport.31120/