]> Dogcows Code - chaz/openbox/blobdiff - src/python.cc
wrapper changes
[chaz/openbox] / src / python.cc
index 12e74eeea1b0d5f1c6effe5b8206602167b4c465..9905dec59b2dd93211793b9b451c6bec3d773d3b 100644 (file)
@@ -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;
This page took 0.02018 seconds and 4 git commands to generate.