]> Dogcows Code - chaz/openbox/commitdiff
deal with when nothing has focus anymore
authorDana Jansens <danakj@orodu.net>
Fri, 27 Dec 2002 09:18:54 +0000 (09:18 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 27 Dec 2002 09:18:54 +0000 (09:18 +0000)
otk/eventdispatcher.cc
scripts/clientmotion.py
src/client.cc

index 1d4a4ec05f46d2f8e47ebbb821d3cd3f1e33aad2..cca49f82d6aa12cdfcccc9fc88d71d2c6fd078bf 100644 (file)
@@ -127,17 +127,18 @@ void OtkEventDispatcher::dispatchEvents(void)
   } else if (focus != None) {
     // the last focus event was a FocusIn, so unfocus what used to be focus and
     // focus this new target
+//    printf("FOCUSING: %lx\n", focus);
+    _focus_e.xfocus.type = FocusIn;
+    _focus_e.xfocus.window = focus;
+    dispatch(_focus_e);
+
     if (_focus != None) {
 //      printf("UNFOCUSING: %lx\n", _focus);
       _focus_e.xfocus.type = FocusOut;
       _focus_e.xfocus.window = _focus;
       dispatch(_focus_e);
     }
-//    printf("FOCUSING: %lx\n", focus);
-    _focus_e.xfocus.type = FocusIn;
-    _focus_e.xfocus.window = focus;
-    dispatch(_focus_e);
-
+    
     _focus = focus;
   }
   
index a8f4c306918d0507b7ac9d5ec1a221a07e2e05e5..60de370bf13b02c77fdf9d1cccc51194c8ad0dcf 100644 (file)
@@ -26,7 +26,9 @@ def def_motion_release(action, win, type, modifiers, button, xroot, yroot,
        global posqueue
        for i in posqueue:
                if i[0] == button:
-                       delete_Rect(i[3])
+                       client = Openbox_findClient(openbox, win)
+                       if client:
+                               delete_Rect(i[3])
                        posqueue.remove(i)
                        break
        
index 2461eff9161856005d306ea8993cbc889c58c434..243390a84ba78bf32e74cbc519f9a6f23eba5494 100644 (file)
@@ -907,6 +907,11 @@ void OBClient::unfocusHandler(const XFocusChangeEvent &e)
 
   frame->unfocus();
   _focused = false;
+
+  if (Openbox::instance->focusedClient() == this) {
+    printf("UNFOCUSED!\n");
+    Openbox::instance->setFocusedClient(this);
+  }
 }
 
 
This page took 0.025614 seconds and 4 git commands to generate.