# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


import logging
import pwm.atom
from pwm.ffi.xcb import xcb
        xcb.core.reparent_window(client, pwm.bar.primary.wid, 0, 0)

        # We reconfigure the window to use a reasonable size. The systray
        # specification explicitly says:
        #   Tray icons may be assigned any size by the system tray, and
        #   should do their best to cope with any size effectively
        size = pwm.bar.primary.height
        xcb.core.configure_window(
            client, *xcb.mask([(xcb.CONFIG_WINDOW_WIDTH, size),
                               (xcb.CONFIG_WINDOW_HEIGHT, size)]))

        # Send the XEMBED_EMBEDDED_NOTIFY message.
        # http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
        # An XEmbed message is an X11 client message with message type
        # "_XEMBED". The format is 32, the first three data longs carry the
        # toolkit's X time (l[0]), the message's major opcode (l[1]) and the
        # message's detail code (l[2]). If no detail is required, the value
        # passed has to be 0. The remaining two data longs (l[3] and l[4]) are
        # reserved for data1 and data2. Unused bytes of the client message are
        # set to 0. The event is sent to the target window with no event mask
        # and propagation turned off.
        event = pwm.windows.create_client_message(
            client,
            pwm.atom.get("_XEMBED"),
            xcb.CURRENT_TIME,
            XEMBED_EMBEDDED_NOTIFY,
            0,
            pwm.bar.primary.wid,
            xe_version)


# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


# Path: pwm/systray.py
import logging
import pwm.atom
from pwm.ffi.xcb import xcb

        xcb.core.reparent_window(client, pwm.bar.primary.wid, 0, 0)

        # We reconfigure the window to use a reasonable size. The systray
        # specification explicitly says:
        #   Tray icons may be assigned any size by the system tray, and
        #   should do their best to cope with any size effectively
        size = pwm.bar.primary.height
        xcb.core.configure_window(
            client, *xcb.mask([(xcb.CONFIG_WINDOW_WIDTH, size),
                               (xcb.CONFIG_WINDOW_HEIGHT, size)]))

        # Send the XEMBED_EMBEDDED_NOTIFY message.
        # http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
        # An XEmbed message is an X11 client message with message type
        # "_XEMBED". The format is 32, the first three data longs carry the
        # toolkit's X time (l[0]), the message's major opcode (l[1]) and the
        # message's detail code (l[2]). If no detail is required, the value
        # passed has to be 0. The remaining two data longs (l[3] and l[4]) are
        # reserved for data1 and data2. Unused bytes of the client message are
        # set to 0. The event is sent to the target window with no event mask
        # and propagation turned off.
        event = pwm.windows.create_client_message(
            client,
            pwm.atom.get("_XEMBED"),
            xcb.CURRENT_TIME,
            XEMBED_EMBEDDED_NOTIFY,
            0,
            pwm.bar.primary.wid,
            xe_version)


        xcb.core.send_event(False, client, xcb.EVENT_MASK_NO_EVENT, event)