]> Dogcows Code - chaz/openbox/commitdiff
handle maprequests after mapped correctly. thus making gaim happy again
authorDana Jansens <danakj@orodu.net>
Mon, 6 Jan 2003 04:57:42 +0000 (04:57 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 6 Jan 2003 04:57:42 +0000 (04:57 +0000)
src/client.cc
src/client.hh
src/openbox_wrap.cc
src/rootwindow.cc
src/screen.cc

index 01e9a56ccdf41a3f281aeebfb5a8f324f00b4b22..23de426a3bf13f39f12440ba8b5dc8d1e94b120c 100644 (file)
@@ -1107,7 +1107,7 @@ void OBClient::unfocus()
 void OBClient::focusHandler(const XFocusChangeEvent &e)
 {
 #ifdef    DEBUG
-  printf("FocusIn for 0x%lx\n", e.window);
+//  printf("FocusIn for 0x%lx\n", e.window);
 #endif // DEBUG
   
   OtkEventHandler::focusHandler(e);
@@ -1122,7 +1122,7 @@ void OBClient::focusHandler(const XFocusChangeEvent &e)
 void OBClient::unfocusHandler(const XFocusChangeEvent &e)
 {
 #ifdef    DEBUG
-  printf("FocusOut for 0x%lx\n", e.window);
+//  printf("FocusOut for 0x%lx\n", e.window);
 #endif // DEBUG
   
   OtkEventHandler::unfocusHandler(e);
@@ -1236,7 +1236,10 @@ void OBClient::destroyHandler(const XDestroyWindowEvent &e)
 void OBClient::reparentHandler(const XReparentEvent &e)
 {
   // this is when the client is first taken captive in the frame
-  if (e.parent == frame->plate()) return;
+  if (e.parent == frame->plate()) {
+    printf("Ignored ReparentNotify for 0x%lx\n", e.window);
+    return;
+  }
 
 #ifdef    DEBUG
   printf("ReparentNotify for 0x%lx\n", e.window);
@@ -1255,17 +1258,4 @@ void OBClient::reparentHandler(const XReparentEvent &e)
   Openbox::instance->screen(_screen)->unmanageWindow(this);
 }
 
-
-void OBClient::mapRequestHandler(const XMapRequestEvent &e)
-{
-  printf("\nMAP REQUEST\n\n");
-  
-  otk::OtkEventHandler::mapRequestHandler(e);
-
-  if (_shaded)
-    shade(false);
-  // XXX: uniconify the window
-  focus();
-}
-
 }
index 067ccccc3f0be9b9702dbdf2ec4ea0a51e3ed18d..dd4bfe9faddc3073553158dc61602751a4f87260 100644 (file)
@@ -535,7 +535,6 @@ public:
   virtual void unmapHandler(const XUnmapEvent &e);
   virtual void destroyHandler(const XDestroyWindowEvent &e);
   virtual void reparentHandler(const XReparentEvent &e);
-  virtual void mapRequestHandler(const XMapRequestEvent &e);
 #if defined(SHAPE)
   virtual void shapeHandler(const XShapeEvent &e);
 #endif // SHAPE 
index 3df4afca97235301384062ad0101ac05743108bf..808f04668292052127f4114daed22fadb9138502 100644 (file)
@@ -656,22 +656,21 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
 #define  SWIGTYPE_p_ob__Openbox swig_types[8] 
 #define  SWIGTYPE_p_otk__Strut swig_types[9] 
 #define  SWIGTYPE_p_XConfigureRequestEvent swig_types[10] 
-#define  SWIGTYPE_p_XMapRequestEvent swig_types[11] 
-#define  SWIGTYPE_p_otk__OtkEventHandler swig_types[12] 
-#define  SWIGTYPE_p_otk__Rect swig_types[13] 
-#define  SWIGTYPE_p_ob__OBWidget swig_types[14] 
-#define  SWIGTYPE_p_XFocusChangeEvent swig_types[15] 
-#define  SWIGTYPE_p_XClientMessageEvent swig_types[16] 
-#define  SWIGTYPE_p_otk__OBProperty swig_types[17] 
-#define  SWIGTYPE_p_otk__OtkEventDispatcher swig_types[18] 
-#define  SWIGTYPE_p_XPropertyEvent swig_types[19] 
-#define  SWIGTYPE_p_XDestroyWindowEvent swig_types[20] 
-#define  SWIGTYPE_p_otk__BImageControl swig_types[21] 
-#define  SWIGTYPE_p_PyObject swig_types[22] 
-#define  SWIGTYPE_p_ob__OBBindings swig_types[23] 
-#define  SWIGTYPE_p_ob__MwmHints swig_types[24] 
-#define  SWIGTYPE_p_XUnmapEvent swig_types[25] 
-static swig_type_info *swig_types[27];
+#define  SWIGTYPE_p_otk__OtkEventHandler swig_types[11] 
+#define  SWIGTYPE_p_otk__Rect swig_types[12] 
+#define  SWIGTYPE_p_ob__OBWidget swig_types[13] 
+#define  SWIGTYPE_p_XFocusChangeEvent swig_types[14] 
+#define  SWIGTYPE_p_XClientMessageEvent swig_types[15] 
+#define  SWIGTYPE_p_otk__OBProperty swig_types[16] 
+#define  SWIGTYPE_p_otk__OtkEventDispatcher swig_types[17] 
+#define  SWIGTYPE_p_XPropertyEvent swig_types[18] 
+#define  SWIGTYPE_p_XDestroyWindowEvent swig_types[19] 
+#define  SWIGTYPE_p_otk__BImageControl swig_types[20] 
+#define  SWIGTYPE_p_PyObject swig_types[21] 
+#define  SWIGTYPE_p_ob__OBBindings swig_types[22] 
+#define  SWIGTYPE_p_ob__MwmHints swig_types[23] 
+#define  SWIGTYPE_p_XUnmapEvent swig_types[24] 
+static swig_type_info *swig_types[26];
 
 /* -------- TYPES TABLE (END) -------- */
 
@@ -2614,28 +2613,6 @@ static PyObject *_wrap_OBClient_reparentHandler(PyObject *self, PyObject *args)
 }
 
 
-static PyObject *_wrap_OBClient_mapRequestHandler(PyObject *self, PyObject *args) {
-    PyObject *resultobj;
-    ob::OBClient *arg1 = (ob::OBClient *) 0 ;
-    XMapRequestEvent *arg2 = 0 ;
-    PyObject * obj0  = 0 ;
-    PyObject * obj1  = 0 ;
-    
-    if(!PyArg_ParseTuple(args,(char *)"OO:OBClient_mapRequestHandler",&obj0,&obj1)) goto fail;
-    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__OBClient,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_XMapRequestEvent,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if (arg2 == NULL) {
-        PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; 
-    }
-    (arg1)->mapRequestHandler((XMapRequestEvent const &)*arg2);
-    
-    Py_INCREF(Py_None); resultobj = Py_None;
-    return resultobj;
-    fail:
-    return NULL;
-}
-
-
 static PyObject * OBClient_swigregister(PyObject *self, PyObject *args) {
     PyObject *obj;
     if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@@ -2837,7 +2814,6 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"OBClient_unmapHandler", _wrap_OBClient_unmapHandler, METH_VARARGS },
         { (char *)"OBClient_destroyHandler", _wrap_OBClient_destroyHandler, METH_VARARGS },
         { (char *)"OBClient_reparentHandler", _wrap_OBClient_reparentHandler, METH_VARARGS },
-        { (char *)"OBClient_mapRequestHandler", _wrap_OBClient_mapRequestHandler, METH_VARARGS },
         { (char *)"OBClient_swigregister", OBClient_swigregister, METH_VARARGS },
         { (char *)"mbind", _wrap_mbind, METH_VARARGS },
         { (char *)"kbind", _wrap_kbind, METH_VARARGS },
@@ -2875,7 +2851,6 @@ static swig_type_info _swigt__p_ob__OBClient[] = {{"_p_ob__OBClient", 0, "ob::OB
 static swig_type_info _swigt__p_ob__Openbox[] = {{"_p_ob__Openbox", 0, "ob::Openbox *", 0},{"_p_ob__Openbox"},{0}};
 static swig_type_info _swigt__p_otk__Strut[] = {{"_p_otk__Strut", 0, "otk::Strut *", 0},{"_p_otk__Strut"},{0}};
 static swig_type_info _swigt__p_XConfigureRequestEvent[] = {{"_p_XConfigureRequestEvent", 0, "XConfigureRequestEvent *", 0},{"_p_XConfigureRequestEvent"},{0}};
-static swig_type_info _swigt__p_XMapRequestEvent[] = {{"_p_XMapRequestEvent", 0, "XMapRequestEvent *", 0},{"_p_XMapRequestEvent"},{0}};
 static swig_type_info _swigt__p_otk__OtkEventHandler[] = {{"_p_otk__OtkEventHandler", 0, "otk::OtkEventHandler *", 0},{"_p_ob__OBActions", _p_ob__OBActionsTo_p_otk__OtkEventHandler},{"_p_otk__OtkEventHandler"},{"_p_ob__Openbox", _p_ob__OpenboxTo_p_otk__OtkEventHandler},{"_p_ob__OBClient", _p_ob__OBClientTo_p_otk__OtkEventHandler},{0}};
 static swig_type_info _swigt__p_otk__Rect[] = {{"_p_otk__Rect", 0, "otk::Rect *", 0},{"_p_otk__Rect"},{0}};
 static swig_type_info _swigt__p_ob__OBWidget[] = {{"_p_ob__OBWidget", 0, "ob::OBWidget *", 0},{"_p_ob__OBWidget"},{"_p_ob__OBClient", _p_ob__OBClientTo_p_ob__OBWidget},{0}};
@@ -2903,7 +2878,6 @@ _swigt__p_ob__OBClient,
 _swigt__p_ob__Openbox, 
 _swigt__p_otk__Strut, 
 _swigt__p_XConfigureRequestEvent, 
-_swigt__p_XMapRequestEvent, 
 _swigt__p_otk__OtkEventHandler, 
 _swigt__p_otk__Rect, 
 _swigt__p_ob__OBWidget, 
index 81b19ee16495e66e1c7b5964a3a4a376ea86daae..78017dd37ad4d92087844e8ff48615753348f132 100644 (file)
@@ -109,7 +109,20 @@ void OBRootWindow::mapRequestHandler(const XMapRequestEvent &e)
   printf("MapRequest for 0x%lx\n", e.window);
 #endif // DEBUG
 
-  Openbox::instance->screen(_info->screen())->manageWindow(e.window);
+  /*
+    MapRequest events come here even after the window exists instead of going
+    right to the client window, because of how they are sent and their struct
+    layout.
+  */
+  OBClient *c = Openbox::instance->findClient(e.window);
+
+  if (c) {
+    if (c->shaded())
+      c->shade(false);
+    // XXX: uniconify the window
+    c->focus();
+  } else
+    Openbox::instance->screen(_info->screen())->manageWindow(e.window);
 }
 
 }
index 307404ffce87aa48629f585a7b271100367f8880..d7cea02481150041f944d0e00469d1ec136e8d0e 100644 (file)
@@ -527,6 +527,8 @@ void OBScreen::manageWindow(Window window)
   EventData *data = new_event_data(window, EventNewWindow, 0);
   Openbox::instance->bindings()->fireEvent(data);
   Py_DECREF((PyObject*)data);
+
+  printf("Managed window 0x%lx\n", window);
 }
 
 
This page took 0.040484 seconds and 4 git commands to generate.