booglybob / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

on_resize event handler not called on window resize on Linux (RC regression) #773

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Have you tried Pyglet 1.2 alpha1 or the repository code?

This issue does not happen in 1.2alpha1, it happens on the 1.2rc1 recently 
released on bitbucket and on the most recent version found there. From reading 
the mailing list I think that release is "official", and this is still the 
issue tracker for that code.

What steps will reproduce the problem?

I can reproduce it using this code:

import pyglet

window = pyglet.window.Window(vsync=False, resizable=True)
label = pyglet.text.Label('Hello, world',
                          color=(255,255,255,255),
                          x=window.width//2, y=window.height//2,
                          anchor_x='center', anchor_y='center',
                          )

@window.event
def on_draw():
    window.clear()
    label.draw()

@window.event
def on_resize(width, height):
    label.x = window.width // 2
    label.y = window.height // 2
pyglet.app.run()

The window shows up and can be resized, but the on_resize function is called 
once only on window creation but never again.

There is no error message, but expected behavior does not happen.

I've attached the output of python -m pyglet.info (The version there is 
misreported as being the alpha)

Any additional info (platform/language/hardware) that may be relevant?

I'm on Ubuntu 14.04 (trusty) on the Unity desktop. It happens on both Python 
2.7 and 3.4

Thanks!

Original issue reported on code.google.com by e...@asustin.net on 27 Jan 2015 at 10:15

Attachments: