]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
revert def_motion
[chaz/openbox] / src / screen.cc
index 947471c241b8341ca50976b646b450e0b268e27a..7e9d0ea0b15bec5c9d69855a174d7262fcc109b0 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
 #include "client.hh"
 #include "openbox.hh"
 #include "frame.hh"
+#include "bindings.hh"
 #include "otk/display.hh"
 
 static bool running;
@@ -89,6 +90,14 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config)
                                      otk::OBProperty::Atom_Cardinal,
                                      viewport, 2);
 
+  // create the window which gets focus when no clients get it
+  XSetWindowAttributes attr;
+  attr.override_redirect = true;
+  _focuswindow = XCreateWindow(otk::OBDisplay::display, _info->rootWindow(),
+                               -100, -100, 1, 1, 0, 0, InputOnly,
+                               _info->visual(), CWOverrideRedirect, &attr);
+  XMapWindow(otk::OBDisplay::display, _focuswindow);
+  
   // these may be further updated if any pre-existing windows are found in
   // the manageExising() function
   setClientList();     // initialize the client lists, which will be empty
@@ -392,6 +401,9 @@ void OBScreen::manageWindow(Window window)
   clients.push_back(client);
   // update the root properties
   setClientList();
+
+  // grab buttons on the window
+  Openbox::instance->bindings()->grabMouse(true, client);
 }
 
 
@@ -399,6 +411,9 @@ void OBScreen::unmanageWindow(OBClient *client)
 {
   OBFrame *frame = client->frame;
 
+  // ungrab buttons on the window
+  Openbox::instance->bindings()->grabMouse(false, client);
+
   // XXX: pass around focus if this window was focused
 
   // remove from the wm's map
This page took 0.022336 seconds and 4 git commands to generate.