resizing window causes objects to remain on screen

Bug #1076136 reported by Thomas Gull
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Invalid
Undecided
Unassigned

Bug Description

Using the following code to resize the window causes objects (such as DirectButtons, etc) to remain on screen even when they are destroyed.

wp = WindowProperties()
newRes = self.GetKey('VIDEO', 'Resolution')
newX, newY = newRes.split('x')
wp.setSize(int(newX), int(newY))
fs = self.GetKey('VIDEO', 'Fullscreen')
wp.setFullscreen(fs)
base.openMainWindow()
base.win.requestProperties(wp)
base.graphicsEngine.openWindows()
self.winResetSuccess = True

This does not happen after simply switching from fullscreen to window mode, it happens when changing resolution of the screen.

Thanks.

Tags: resize window
Revision history for this message
rdb (rdb) wrote :

What do you mean? Are you expecting this code to destroy your DirectButtons?

Revision history for this message
Thomas Gull (tgull1) wrote :

No, sorry if I was not clear enough.

So here is some more code (self.buttons is a list):
self.buttons.append(DirectOptionMenu(text="Resolution:", initialitem=curRes, items=sizes, pos=(-.2, 1, .6), scale=BUTTON_SCALE, command=self.SetResolution))

(from class OptionsMenu)
def SetResolution(self, newRes):
        self.controller.SetKey('VIDEO', 'Resolution', newRes)
        self.controller.AddFlag(RESET_WINDOW_GAME)
        self.windowReset = True

(from class GameController)
 if self.FLAGS & RESET_WINDOW_GAME:
            self.FLAGS -= RESET_WINDOW_GAME
            self.winResetSuccess = False
            self.StateManager.StopCurrentState()
            self.ResetWindow()

    def ResetWindow(self):
        wp = WindowProperties()
        newRes = self.GetKey('VIDEO', 'Resolution')
        newX, newY = newRes.split('x')
        wp.setSize(int(newX), int(newY))
        fs = self.GetKey('VIDEO', 'Fullscreen')
        wp.setFullscreen(fs)
        base.openMainWindow()
        base.win.requestProperties(wp)
        base.graphicsEngine.openWindows()
        self.winResetSuccess = True

(from OptionsMenu again)
def ShowMenu(self, task):
        if self.done:
            for each in self.buttons:
                each.destroy()
            return task.done
        if self.windowReset and self.controller.CheckWinReset():
            for each in self.buttons:
                each.destroy()
            self.ShowOptions()
            self.windowReset = False
        return task.cont

After the window changes resolution however, objects are not destroyed. It doesn't matter if it's a button or what because other objects remain on screen. Somehow even with other objects they remain on screen.

However, when it goes into our actual game the objects disappear. So let me see if there is something going on before you really look into it and I will come back and post another comment if I can't find something.

Thanks and sorry for being a pain

Revision history for this message
rdb (rdb) wrote :

It's very unclear what you're asking here. It sounds like you're expecting openMainWindow() to reset the scene graphs, which is certainly not what it is supposed to do. If you wish to remove all objects, you must set up a new scene graph, not open a new window.

If you believe this is a bug, please attach a concise test case that we can run that reproduces the issue in question, and I will change the bug status back.

Changed in panda3d:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.