all repos — openbox @ 5bf463ea955bd7e27b1f04a1eefb28ec52309cb8

openbox fork - make it a bit more like ryudo

add the ability to close a window
Dana Jansens danakj@orodu.net
commit

5bf463ea955bd7e27b1f04a1eefb28ec52309cb8

parent

c9be3ee06121bc4d0dec3586918607f18dabdb89

M util/epist/actions.hhutil/epist/actions.hh

@@ -36,17 +36,17 @@ enum ActionType {

noaction = 0, execute, iconify, - raiseWindow, - lowerWindow, - closeWindow, - toggleshade, + raise, + lower, + close, //done + toggleshade, //done moveWindowUp, moveWindowDown, moveWindowLeft, moveWindowRight, - nextWindow, - prevWindow, + nextWindow, //done for now + prevWindow, //done for now nextWindowOnAllWorkspaces, prevWindowOnAllWorkspaces,
M util/epist/epist.ccutil/epist/epist.cc

@@ -88,6 +88,10 @@ _actions.push_back(Action(Action::toggleshade,

XKeysymToKeycode(getXDisplay(), XStringToKeysym("F5")), Mod1Mask)); + _actions.push_back(Action(Action::close, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("F4")), + Mod1Mask)); _actions.push_back(Action(Action::nextWindow, XKeysymToKeycode(getXDisplay(), XStringToKeysym("Tab")),
M util/epist/screen.ccutil/epist/screen.cc

@@ -175,6 +175,10 @@ if (_active != _clients.end()) {

XWindow *window = *_active; switch (it->type()) { + case Action::close: + window->close(); + return; + case Action::toggleshade: window->shade(! window->shaded()); return;
M util/epist/window.ccutil/epist/window.cc

@@ -148,3 +148,9 @@ _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_state,

_window, (sh ? 1 : 0), _xatom->getAtom(XAtom::net_wm_state_shaded)); } + + +void XWindow::close() const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_close_window, + _window); +}
M util/epist/window.hhutil/epist/window.hh

@@ -81,6 +81,7 @@

void processEvent(const XEvent &e); void shade(const bool sh) const; + void close() const; bool operator == (const XWindow &w) const { return w._window == _window; } bool operator == (const Window &w) const { return w == _window; }