bool OBClient::focus()
{
- if (!_can_focus) return false;
+ if (!_can_focus || _focused) return false;
XSetInputFocus(otk::OBDisplay::display, _window, RevertToNone, CurrentTime);
return true;
}
+void OBClient::unfocus()
+{
+ if (!_focused) return;
+
+ assert(Openbox::instance->focusedClient() == this);
+ Openbox::instance->setFocusedClient(0);
+}
+
+
void OBClient::focusHandler(const XFocusChangeEvent &)
{
frame->focus();
frame->unfocus();
_focused = false;
- if (Openbox::instance->focusedClient() == this) {
- printf("UNFOCUSING\n");
+ if (Openbox::instance->focusedClient() == this)
Openbox::instance->setFocusedClient(0);
- } else
- printf("UNFOCUSED ALREADY COULDNT UNFOCUS\n");
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.17u-20021222-0248
+ * Version 1.3.17u-20021226-0459
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
}
+static PyObject *_wrap_OBClient_unfocus(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ ob::OBClient *arg1 = (ob::OBClient *) 0 ;
+ PyObject * obj0 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"O:OBClient_unfocus",&obj0)) goto fail;
+ if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__OBClient,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+ (arg1)->unfocus();
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject *_wrap_OBClient_focusHandler(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::OBClient *arg1 = (ob::OBClient *) 0 ;
{ (char *)"OBClient_resize", _wrap_OBClient_resize, METH_VARARGS },
{ (char *)"OBClient_close", _wrap_OBClient_close, METH_VARARGS },
{ (char *)"OBClient_focus", _wrap_OBClient_focus, METH_VARARGS },
+ { (char *)"OBClient_unfocus", _wrap_OBClient_unfocus, METH_VARARGS },
{ (char *)"OBClient_focusHandler", _wrap_OBClient_focusHandler, METH_VARARGS },
{ (char *)"OBClient_unfocusHandler", _wrap_OBClient_unfocusHandler, METH_VARARGS },
{ (char *)"OBClient_propertyHandler", _wrap_OBClient_propertyHandler, METH_VARARGS },