X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=7e9d0ea0b15bec5c9d69855a174d7262fcc109b0;hb=098fa0ce20f440da3140adad2cfe8ae9a6854d46;hp=947471c241b8341ca50976b646b450e0b268e27a;hpb=fe55bb846db1933d8d6f023236298940cab441f8;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 947471c2..7e9d0ea0 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -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