Window origin

I’m on linux, and I’m trying to get the window origin but I’m not getting anything but zeros.

Here’s what I’m doing:

 wp = WindowProperties(
        if wp.hasOrigin():
            winX = wp.getXOrigin()
            winY = wp.getYOrigin()
            print 'no origin'
            return task.again

I found this ([url][solved] Window origin]) in the forums, but I’m unclear as to if this was actually fixed or not.

Hmm, are you waiting until the window is full realized? Try calling base.graphicsEngine.openWindows() before querying the window properties.


That didn’t seem to make a difference.

I haven’t tried it on windows yet, so it may work there.

Maybe I’m approaching my problem wrong. I have a panda window embedded in a wx frame (thanks to several great examples from the forums), and I’m having trouble managing the focus between the wx frame and the panda window. If the user alt-tabs, or opens up a dialog all of the keyboard events stop working until I set the the panda window to the foreground again.

My solution (and there may be other better solutions) is to track where the cursor is and set the panda window to the foreground if the cursor is within the bounds of the panda window.

So I plan on using the origin and the window size to figure that out.

The whole code is here (

Yeah, never mind that’s a pretty stupid way to handle focus.

It’s much cleaner and simpler to just reset to foreground on mouse1 click, and it looks like panda isn’t capturing the mouse1 click when it’s in the wx controls, so it works out perfect.

    def click(self):
        '''mouse 1 click'''
        wp = WindowProperties(
        if not wp.getForeground():

I’m still not able to grab the origin of the window though, but it’s no longer my biggest concern.