X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fpython.cc;h=9905dec59b2dd93211793b9b451c6bec3d773d3b;hb=ab2968b3a5d61e2dc6b0a64153a7abb0078ee442;hp=912f196d332b20733ce2d6258dd22e0483821040;hpb=9e77a88d269bfafb78e56a646bfacebdd6ff4c5a;p=chaz%2Fopenbox diff --git a/src/python.cc b/src/python.cc index 912f196d..9905dec5 100644 --- a/src/python.cc +++ b/src/python.cc @@ -34,6 +34,7 @@ void python_init(char *argv0) PyRun_SimpleString("from openbox import *;"); // set up convenience global variables PyRun_SimpleString("openbox = Openbox_instance()"); + PyRun_SimpleString("display = Display_instance()"); // set up access to the python global variables PyObject *obmodule = PyImport_AddModule("__main__"); @@ -191,21 +192,14 @@ void set_reset_key(const std::string &key) ob::openbox->bindings()->setResetKey(key); } -PyObject *send_client_msg(Window target, int type, Window about, +PyObject *send_client_msg(Window target, Atom type, Window about, long data, long data1, long data2, long data3, long data4) { - if (type < 0 || type >= otk::Property::NUM_ATOMS) { - PyErr_SetString(PyExc_TypeError, - "Invalid atom type. Must be from otk::Property::Atoms"); - return NULL; - } - XEvent e; e.xclient.type = ClientMessage; e.xclient.format = 32; - e.xclient.message_type = - openbox->property()->atom((otk::Property::Atoms)type); + e.xclient.message_type = type; e.xclient.window = about; e.xclient.data.l[0] = data; e.xclient.data.l[1] = data1; @@ -213,7 +207,7 @@ PyObject *send_client_msg(Window target, int type, Window about, e.xclient.data.l[3] = data3; e.xclient.data.l[4] = data4; - XSendEvent(otk::Display::display, target, false, + XSendEvent(**otk::display, target, false, SubstructureRedirectMask | SubstructureNotifyMask, &e); Py_INCREF(Py_None); return Py_None;