NEWS for Python X Library
- Removed unused imports (thanks @Avasam).
- Avoid to use fcntl module on some environments (thanks @i2y).
- Change a test behavior for
unix_connect.get_socket
(thanks @i2y). - Fix accidental data change (thanks @Avasam).
- Prefer
bool
overLiteral[0, 1, None]
(thanks @Avasam). - Change parentheses to brackets in LICENSE (thanks @mtelka).
- Use archived link for X documentation resource (thanks @yaxollum).
- Fix for auth entry having no display number (thanks @Majiir).
- Fix return type inconsistency with the
pack_value
for classObject
(thanks @allfro). - Rename
add_extension_error
method toextension_add_error
(thanks @mattalexx).
- screensaver: fix screensaver protocol mismatch (thanks @yut23).
- XRandr: add version 1.5 support for RRSetMonitor RRGetMonitors and RRDeleteMonitors (thanks @allfro and @jklong).
- XInput: add event methods (thanks @dd4e).
- XResource: first implementation (thanks @alebastr).
- XRandr: add missing parameters to delete_output_mode function (thanks @jimmy-loyola).
- Drawable & XInput: Avoid using array.array.tostring() which wiil be removed in Python 3.9 (thanks @t-wissmann).
- DPMS: Display Power Management Signaling (by @thiagokokada)
- fix TypeError in socket.error exception handling for Python 3.x (by @t-wissmann)
- NV-CONTROL: set offset for all perf levels (by @Sporif)
- support legacy X servers like RealVNC's one (by @Gerardwx)
- enrich XFixes extension with XFixesSelectionNotify events (by @acrisci)
- add example xfixes-selection-notify.py (by @acrisci)
- fix two issues in NV-CONTROL extension (by @leinardi)
- add method get_clock_info into NV-CONTROL extension (by @leinardi)
- add default client version into Composite extension (by @jakogut)
- add Damage extension with the example (by @mgarg1 and @jakogut)
- fix increasing memory usage on display instantiation
- add first implementation by Roberto Leinardi (@leinardi)
- fix protocol handling: correctly support explicit Unix connections and fix support fox macOS
- improve Python 3 support: fix events sub-code handling and possible crashes when unpacking text data
- add support for error handlers to the Composite extension
- fix
xfixes
example - fix a bunch of typos in the code / documentation
- fix strings decoding: use Latin-1
- fix
Display.change_pointer_control
implementation - fix
Drawable.put_pil_image
implementation
- fix use under Windows Subsystem for Linux: when DISPLAY does not specify a protocol, and the implicit Unix socket connection fails, fallback to TCP (mimicking XCB's behavior).
- don't bundle a copy of texi2html to build the HTML documentation, but use the currently installed version instead.
- fix unclosed file in Xauth implementation
- fix support for
Window.set_wm_transient_for
- fix support for
Drawable.put_image
/Drawable.get_image
- use ASCII for decoding strings in Python 3 (same as Python 2)
- fix Python 3 warnings about
array.tostring()
(deprecated)
Improve response processing performance: reduce the number of
socket.recv
calls needed to receive a full response.
- don't throw an exception if
$XAUTHFILE
/~/.Xauthority
is missing - fix authentication work-around for SSH forwarding under Python 3
- improve
$DISPLAY
handling: support optional protocol prefix, and correctly handleunix:0.0
as:0.0
- fix Python 3 buffer abstraction
- fix interrupted select handling for Python 3.3/3.4
- fix Unix socket support when only an abstract address is available
- fix Xauth handling when using Python 2 and DISPLAY contains a remote IP
- fix String16 request field handling when using Python 3
- fix RECORD extension and example when using Python 3
- fix handling of properties: use byte strings for all X11 8-bits
strings, as not all of them are text properties (the window
getters/setters for
wm_name
,wm_icon_name
,wm_class
, andwm_client_machine
still return/expect Unicode strings)
Core:
- new window getter/setter for text properties:
get_full_text_property
andchange_text_property
; with automatic conversion to/from Unicode when the property type encoding is supported (STRING
andUTF8_STRING
)
Composite extension:
- support for
GetOverlayWindow
request
The project is now licensed under the GNU Lesser General Public License v2.1 or later (see the LICENSE file for details).
Support for Python versions older than 2.7 has been dropped. Support for Python 3 (3.3, 3.4 and 3.5) has been added. Note that Python-Xlib now depends on the six package (>=1.10) for combined Python 2 / 3 support.
With the change of license, and no way to contact the original author of the SHAPE extension, the code had to be rewritten from scratch. This resulted in a few minor API changes (see examples/shapewin.py).
Partial support for the SECURITY. XInput, and XFIXES extensions has been added.
- fix RECORD extension
- fixed OS X socket path
- fix handling of generic events
- fix handling of KeymapNotify events
- several fixes for the RandR extension
Improved support for newer versions of Mac OS X, a couple of new extensions, and several bugfixes.
Support for the composite extension, used to implement a composition manager (added for plcm work in plwm).
By itself this extension is not very useful, it is intended to be used together with the DAMAGE and XFIXES extensions. Typically you would also need RENDER or glX or some similar method of creating fancy graphics.
Keysym definitions for special function keys found on modern keyboards,
e.g. raise and lower volume, start specific applications, etc. Have a
look in Xlib/keysymdef/xf86.py to see what
there are and experiment with xev to see what your keyboard generates.
These definitions aren't brought in by default, so you must do this
after importing Xlib.XK
:
Xlib.XK.load_keysym_group('xf86')
The RANDR extension complements XINERAMA as a way of getting data about the physical screens making up a virtual screen in X. An example of usage can be found in examples/xrandr.py.
A couple of new extensions, a Python 2.5 fix and a couple of aliases
(Display.get_atom()
now uses the internal cache and added
Window.raise_window()
). Tabs converted to spaces (SF id: 1559082).
Alex Badea contributed a RECORD extension module, allowing Python Xlib programs to capture mouse and keyboard events (or all other core or extension events) easily. A demo is in the examples directory. See http://refspecs.freestandards.org/X11/recordlib.pdf for more information.
Mike Meyer contributed a Xinerama extension module, allowing Python Xlib programs to interrogate the X server about positions and sizes of multiple screens. Specifications are a bit tricky to find - http://sourceforge.net/projects/xinerama/ has some older specs and the source code of the xorg project (libs & server code) has "definitive" information.
Bugfix to correct handling of XAuthority file parsing under Python 2.5 causing failed authentication.
A small release to incorporate a number of minor corrections and bug
fixes, including small changes to keysym handling, .Xauthority
parsing, several fixes to sending/receiving/flushing data, addition of
WithdrawnState
to WMHints
. petli completed documentation for
Display
objects.
Jeffrey Boser contributed a SHAPE extension module, allowing Python Xlib programs to use shaped windows. Take a look at examples/shapewin.py for ideas on how to use it. For more information on shaped windows, see http://ftp.x.org/pub/R6.6/xc/doc/hardcopy/Xext/shape.PS.gz
In Python 2.2 FCNTL.FD_CLOEXEC
has disappeared and FCNTL
on the whole
is deprecated, so that had to be dealt with to make the Xlib work with
that version.
Regressions tests have been created for all requests, replies and events. The tests use PyUnit, and the old resource database test has been updated to use it too.
The bugs discovered by the regression tests have been fixed. Additionally, a subtle bug in the core engine which could cause a "can't happen"-error has also been found and fixed.
The xlib failed to parse the type code of events sent from other clients
using SendEvent
. This has been fixed, adding the field `send_event' to
all event objects.
The section "Event Types" in the manual has been written, detailing all event types in the core protocol. The manual is now ten pages thicker.
The Drawable methods put_image()
and get_image()
have been
implemented, but handling image data is still up to the user. There is
however, thanks to Ilpo Nyyssönen, a trivial method put_pil_image()
that will work on some combinations of image and drawable depth. It's
not perfect, but it's a start.
The documentation has been augmented with a chapter about event handling, and a chapter listing all X objects and their methods provided by the library. They are not described in any detail, though.
The module Xlib.XK
, which listed all keysyms, have been split up into
several sub-modules providing different sets of keysyms. By importing
Xlib.XK
only the miscellany and latin1 sets are loaded, thus removing
some unnecessary clutter.
Xlib.display.Display
has two new methods (lookup_string()
and
rebind_string()
) for translating keysyms into characters.
The order of the Xlib.display.Display
method send_event()
parameters
event_mask
and propagate has changed.
Some of the class names in Xlib.protocol.event
have changed, to have
the same name as the corresponding event type constant.
If a display has more than one screen, the default screen was always set
to the highest numbered one, irrespective of what the user specified in
$DISPLAY
.
Some response attributes in Xlib.protocol.request
accidentally included
a comma.
Python Xlib now uses distutils to make installation and distribution building easier.
A few incompatibilities with Python 2.0 has been fixed.
As it turns out, the attempted fix for 64-bit platforms in v0.6 didn't really work. Close study of structmodules.c gave the answer why, and now it really should work. Yeah.
Python Xlib is now at least 25% faster after the core of the protocol engine has been rewritten. This is some quite cute code: tailor-made methods are generated for all structures, resulting in a 650% speed-up in generating binary data, and a 75% speed-up in parsing binary data.
Interested Python hackers are recommended to take a look at the Struct
class in Xlib/protocol/rq.py
.
The struct and array modules uses sizeof(long)
to determine the number
of bytes used when representing the type code 'l'. On Intel and VAX,
this is 32 bits as expected. On Alpha, it's 64 bits. python-xlib now
probes how large each type code is to avoid this problem.
-
Functions implemented to get and set all ICCCM WM properties on Window objects.
-
Keymap cache implemented, with external
Xlib.display.Display
methodskeycode_to_keysym
,keysym_to_keycode
,keysym_to_keycodes
andrefresh_keyboard_mapping
. -
Two utils for debugging X traffic implemented.
utils/tcpbug.py
forwards a TCP connection and outputs the communication between the client and the server. This output can then be fed intoutils/parsexbug.py
, which will output all requests, responses, errors and events in a readable format.
-
Thread support completed, but not really stress-tested yet.
-
A framework for handling different platforms has been implemented, together with generic Unix code and some simple VMS code.
-
Some documentation has been written.
-
The usual bunch of bugfixes.