]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
lets make it compile at least
[chaz/openbox] / src / client.cc
index df9ad8a6baae795f72c8d5eda50c6ee94d0c9f02..e626081ce19e871a2fe37e25653f5f257ee69ed0 100644 (file)
@@ -882,8 +882,14 @@ void OBClient::unfocus()
 }
 
 
-void OBClient::focusHandler(const XFocusChangeEvent &)
+void OBClient::focusHandler(const XFocusChangeEvent &e)
 {
+#ifdef    DEBUG
+  printf("FocusIn for 0x%lx\n", e.window);
+#endif // DEBUG
+  
+  OtkEventHandler::focusHandler(e);
+
   frame->focus();
   _focused = true;
 
@@ -891,15 +897,30 @@ void OBClient::focusHandler(const XFocusChangeEvent &)
 }
 
 
-void OBClient::unfocusHandler(const XFocusChangeEvent &)
+void OBClient::unfocusHandler(const XFocusChangeEvent &e)
 {
+#ifdef    DEBUG
+  printf("FocusOut for 0x%lx\n", e.window);
+#endif // DEBUG
+  
+  OtkEventHandler::unfocusHandler(e);
+
   frame->unfocus();
   _focused = false;
+
+  if (Openbox::instance->focusedClient() == this) {
+    printf("UNFOCUSED!\n");
+    Openbox::instance->setFocusedClient(this);
+  }
 }
 
 
 void OBClient::configureRequestHandler(const XConfigureRequestEvent &e)
 {
+#ifdef    DEBUG
+  printf("ConfigureRequest for 0x%lx\n", e.window);
+#endif // DEBUG
+  
   OtkEventHandler::configureRequestHandler(e);
 
   // XXX: if we are iconic (or shaded? (fvwm does that)) ignore the event
@@ -986,4 +1007,26 @@ 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;
+
+#ifdef    DEBUG
+  printf("ReparentNotify for 0x%lx\n", e.window);
+#endif // DEBUG
+
+  OtkEventHandler::reparentHandler(e);
+
+  /*
+    This event is quite rare and is usually handled in unmapHandler.
+    However, if the window is unmapped when the reparent event occurs,
+    the window manager never sees it because an unmap event is not sent
+    to an already unmapped window.
+  */
+
+  // this deletes us etc
+  Openbox::instance->screen(_screen)->unmanageWindow(this);
+}
+
 }
This page took 0.021293 seconds and 4 git commands to generate.