コード例 #1
0
ファイル: allPythonContent.py プロジェクト: shobrook/pyreco
    def __init__(self, wid):
        self.wid = wid

        self.name = ewmh.get_wm_name(self.wid).reply() or 'N/A'
        debug('Connecting to %s' % self)

        window.listen(self.wid, 'PropertyChange', 'FocusChange')
        event.connect('PropertyNotify', self.wid, self.cb_property_notify)
        event.connect('FocusIn', self.wid, self.cb_focus_in)
        event.connect('FocusOut', self.wid, self.cb_focus_out)

        # This connects to the parent window (decorations)
        # We get all resize AND move events... might be too much
        self.parentid = window.get_parent_window(self.wid)
        window.listen(self.parentid, 'StructureNotify')
        event.connect('ConfigureNotify', self.parentid, 
                      self.cb_configure_notify)

        # A window should only be floating if that is default
        self.floating = config.floats_default

        # Not currently in a "moving" state
        self.moving = False

        # Load some data
        self.desk = ewmh.get_wm_desktop(self.wid).reply()

        # Add it to this desktop's tilers
        tile.update_client_add(self)

        # First cut at saving client geometry
        self.save()
コード例 #2
0
    def __init__(self, wid):
        self.wid = wid

        self.name = ewmh.get_wm_name(self.wid).reply() or "N/A"
        debug("Connecting to %s" % self)

        window.listen(self.wid, "PropertyChange", "FocusChange")
        event.connect("PropertyNotify", self.wid, self.cb_property_notify)
        event.connect("FocusIn", self.wid, self.cb_focus_in)
        event.connect("FocusOut", self.wid, self.cb_focus_out)

        # This connects to the parent window (decorations)
        # We get all resize AND move events... might be too much
        self.parentid = window.get_parent_window(self.wid)
        window.listen(self.parentid, "StructureNotify")
        event.connect("ConfigureNotify", self.parentid, self.cb_configure_notify)
        debug("Parent: %s" % str(self.parentid))
        # A window should only be floating if that is default
        self.floating = getattr(config, "floats_default", False)

        # Not currently in a "moving" state
        self.moving = False

        # Load some data
        self.desk = ewmh.get_wm_desktop(self.wid).reply()
        debug("Desk: %s" % str(self.desk))

        # Add it to this desktop's tilers
        ret = tile.update_client_add(self)
        # does this work?
        debug("Ret: %s" % str(ret))

        # First cut at saving client geometry
        self.save()
        debug("Init finished and save() called %s" % self)
コード例 #3
0
def active_window_handler() :
    global active_window
    # de-register all events (including 'PropertyChange' for name change notifications)
    # de-registering will fail if there is no active window:  
    # upon startup, or when the active window changed because a window was closed
    try :
        window.listen(active_window, )
    except :
        print 'failed to de-register events for active window'
    active_window = ewmh.get_active_window().reply()
    # register to listen for name changes on the active window
    try :
        window.listen(active_window, 'PropertyChange')
        # when the active window changes the title changes
        name_change_handler()
    except :
        print 'failed to register events for active window'
コード例 #4
0
ファイル: allPythonContent.py プロジェクト: shobrook/pyreco
    elif aname == '_NET_ACTIVE_WINDOW':
        activewin = ewmh.get_active_window().reply()
    elif aname == '_NET_CURRENT_DESKTOP':
        desktop = ewmh.get_current_desktop().reply()
        if visibles is None or len(visibles) == 1:
            visibles = [desktop]
    elif aname == '_NET_VISIBLE_DESKTOPS':
        visibles = ewmh.get_visible_desktops().reply()
    elif aname == '_NET_NUMBER_OF_DESKTOPS':
        desk_num = ewmh.get_number_of_desktops().reply()
    elif aname == '_NET_CLIENT_LIST_STACKING':
        stacking = ewmh.get_client_list_stacking().reply()
    elif aname == '_NET_WORKAREA':
        update_workarea()

window.listen(xpybutil.root, 'PropertyChange')
event.connect('PropertyNotify', xpybutil.root, cb_property_notify)

update_workarea()


########NEW FILE########
__FILENAME__ = tile
import xpybutil
import xpybutil.event as event
import xpybutil.util as util

from debug import debug

import state
from layouts import layouts
コード例 #5
0
ファイル: __init__.py プロジェクト: freundTech/htmlDE
def setup():
    window.listen(xpybutil.root, "PropertyChange")
    event.connect("PropertyNotify", xpybutil.root, handleEvents)
    t = Thread(target=event.main)
    t.start()
    print("desktops setup")
コード例 #6
0
ファイル: __init__.py プロジェクト: codecpacka/htmlDE
def setup():
    window.listen(xpybutil.root, "PropertyChange")
    event.connect("PropertyNotify", xpybutil.root, handleEvents)
    t = Thread(target=event.main)
    t.start()
    print("desktops setup")
コード例 #7
0
ファイル: state.py プロジェクト: inktrap/pytyle3

def cb_property_notify(e):
    global activewin, desk_num, desktop, monitors, phys_monitors, root_geom, stacking, visibles, workarea

    aname = util.get_atom_name(e.atom)
    if aname == "_NET_DESKTOP_GEOMETRY":
        root_geom = ewmh.get_desktop_geometry().reply()
        monitors = xinerama.get_monitors()
        phys_monitors = xinerama.get_physical_mapping(monitors)
    elif aname == "_NET_ACTIVE_WINDOW":
        activewin = ewmh.get_active_window().reply()
    elif aname == "_NET_CURRENT_DESKTOP":
        desktop = ewmh.get_current_desktop().reply()
        if visibles is None or len(visibles) == 1:
            visibles = [desktop]
    elif aname == "_NET_VISIBLE_DESKTOPS":
        visibles = ewmh.get_visible_desktops().reply()
    elif aname == "_NET_NUMBER_OF_DESKTOPS":
        desk_num = ewmh.get_number_of_desktops().reply()
    elif aname == "_NET_CLIENT_LIST_STACKING":
        stacking = ewmh.get_client_list_stacking().reply()
    elif aname == "_NET_WORKAREA":
        update_workarea()


window.listen(xpybutil.root, "PropertyChange")
event.connect("PropertyNotify", xpybutil.root, cb_property_notify)

update_workarea()
コード例 #8
0
    # de-register all events (including 'PropertyChange' for name change notifications)
    # de-registering will fail if there is no active window:  
    # upon startup, or when the active window changed because a window was closed
    try :
        window.listen(active_window, )
    except :
        print 'failed to de-register events for active window'
    active_window = ewmh.get_active_window().reply()
    # register to listen for name changes on the active window
    try :
        window.listen(active_window, 'PropertyChange')
        # when the active window changes the title changes
        name_change_handler()
    except :
        print 'failed to register events for active window'

window.listen(root, 'PropertyChange')
while True:
    e = conn.wait_for_event() # SIGINT will be caught upon blocking call return
    if not isinstance(e, xcb.xproto.PropertyNotifyEvent):
        # print 'unexpected message type', e
        continue
    aname = util.get_atom_name(e.atom)
    if aname == '_NET_ACTIVE_WINDOW':
        active_window_handler()
    if aname == 'WM_NAME':
        name_change_handler()
    # else :
    #    print 'ignoring', aname