4 new revisions:
Revision: 366115f05fe5
Author: Andre D <
an...@andred.ca>
Date: Sun Jul 22 23:59:36 2012
Log: Fixed lib.py failing in python3
http://code.google.com/p/pyglet/source/detail?r=366115f05fe5
Revision: 20fec3d828ee
Author: Andre D <
an...@andred.ca>
Date: Sun Jul 22 22:55:17 2012
Log: Corrected X11 resize
http://code.google.com/p/pyglet/source/detail?r=20fec3d828ee
Revision: e361f696b159
Author: Andre D <
an...@andred.ca>
Date: Thu Jul 26 18:49:00 2012
Log: Update view size on map
http://code.google.com/p/pyglet/source/detail?r=e361f696b159
Revision: 37270a64e461
Author: Andre D <
an...@andred.ca>
Date: Thu Jul 26 19:47:51 2012
Log: Fixed set_location() being incorrect in tiling (non-reparenting)
windo...
http://code.google.com/p/pyglet/source/detail?r=37270a64e461
==============================================================================
Revision: 366115f05fe5
Author: Andre D <
an...@andred.ca>
Date: Sun Jul 22 23:59:36 2012
Log: Fixed lib.py failing in python3
http://code.google.com/p/pyglet/source/detail?r=366115f05fe5
Modified:
/pyglet/lib.py
=======================================
--- /pyglet/lib.py Sat Jun 16 09:49:26 2012
+++ /pyglet/lib.py Sun Jul 22 23:59:36 2012
@@ -115,9 +115,9 @@
lib = _TraceLibrary(lib)
return lib
except OSError, o:
- if ((self.linux_not_found_error not in o.message) and
- (self.darwin_not_found_error not in o.message)):
- print "Unexpected error loading library %s: %s" %
(name, o.message)
+ if ((self.linux_not_found_error not in o.args[0]) and
+ (self.darwin_not_found_error not in o.args[0])):
+ print "Unexpected error loading library %s: %s" %
(name, o.args[0])
raise
path = self.find_library(name)
if path:
==============================================================================
Revision: 20fec3d828ee
Author: Andre D <
an...@andred.ca>
Date: Sun Jul 22 22:55:17 2012
Log: Corrected X11 resize
http://code.google.com/p/pyglet/source/detail?r=20fec3d828ee
Modified:
/pyglet/window/xlib/__init__.py
=======================================
--- /pyglet/window/xlib/__init__.py Wed Apr 25 13:37:41 2012
+++ /pyglet/window/xlib/__init__.py Sun Jul 22 22:55:17 2012
@@ -1225,9 +1225,9 @@
w, h = ev.xconfigure.width, ev.xconfigure.height
x, y = ev.xconfigure.x, ev.xconfigure.y
if self._width != w or self._height != h:
- self._update_view_size()
self._width = w
self._height = h
+ self._update_view_size()
self._needs_resize = True
if self._x != x or self._y != y:
self.dispatch_event('on_move', x, y)
==============================================================================
Revision: e361f696b159
Author: Andre D <
an...@andred.ca>
Date: Thu Jul 26 18:49:00 2012
Log: Update view size on map
http://code.google.com/p/pyglet/source/detail?r=e361f696b159
Modified:
/pyglet/window/xlib/__init__.py
=======================================
--- /pyglet/window/xlib/__init__.py Sun Jul 22 22:55:17 2012
+++ /pyglet/window/xlib/__init__.py Thu Jul 26 18:49:00 2012
@@ -403,7 +403,9 @@
if self._override_redirect:
# Possibly an override_redirect issue.
self.activate()
-
+
+ self._update_view_size()
+
self.dispatch_event('on_resize', self._width, self._height)
self.dispatch_event('on_show')
self.dispatch_event('on_expose')
==============================================================================
Revision: 37270a64e461
Author: Andre D <
an...@andred.ca>
Date: Thu Jul 26 19:47:51 2012
Log: Fixed set_location() being incorrect in tiling (non-reparenting)
window managers
http://code.google.com/p/pyglet/source/detail?r=37270a64e461
Modified:
/pyglet/window/xlib/__init__.py
=======================================
--- /pyglet/window/xlib/__init__.py Thu Jul 26 18:49:00 2012
+++ /pyglet/window/xlib/__init__.py Thu Jul 26 19:47:51 2012
@@ -433,6 +433,18 @@
byref(attributes))
return attributes.root
+ def _is_reparented(self):
+ root = c_ulong()
+ parent = c_ulong()
+ children = pointer(c_ulong())
+ n_children = c_uint()
+
+ xlib.XQueryTree(self._x_display, self._window,
+ byref(root), byref(parent), byref(children),
+ byref(n_children))
+
+ return root.value != parent.value
+
def close(self):
if not self._window:
return
@@ -506,16 +518,17 @@
return self._width, self._height
def set_location(self, x, y):
- # Assume the window manager has reparented our top-level window
- # only once, in which case attributes.x/y give the offset from
- # the frame to the content window. Better solution would be
- # to use _NET_FRAME_EXTENTS, where supported.
- attributes = xlib.XWindowAttributes()
- xlib.XGetWindowAttributes(self._x_display, self._window,
- byref(attributes))
- # XXX at least under KDE's WM these attrs are both 0
- x -= attributes.x
- y -= attributes.y
+ if self._is_reparented():
+ # Assume the window manager has reparented our top-level window
+ # only once, in which case attributes.x/y give the offset from
+ # the frame to the content window. Better solution would be
+ # to use _NET_FRAME_EXTENTS, where supported.
+ attributes = xlib.XWindowAttributes()
+ xlib.XGetWindowAttributes(self._x_display, self._window,
+ byref(attributes))
+ # XXX at least under KDE's WM these attrs are both 0
+ x -= attributes.x
+ y -= attributes.y
xlib.XMoveWindow(self._x_display, self._window, x, y)
def get_location(self):