summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-20 09:17:23 +0000
committerDana Jansens <danakj@orodu.net>2002-07-20 09:17:23 +0000
commit5bf463ea955bd7e27b1f04a1eefb28ec52309cb8 (patch)
treefb22192458db019ece0791df16ec45ebdab35fc2 /util
parentc9be3ee06121bc4d0dec3586918607f18dabdb89 (diff)
add the ability to close a window
Diffstat (limited to 'util')
-rw-r--r--util/epist/actions.hh12
-rw-r--r--util/epist/epist.cc4
-rw-r--r--util/epist/screen.cc4
-rw-r--r--util/epist/window.cc6
-rw-r--r--util/epist/window.hh1
5 files changed, 21 insertions, 6 deletions
diff --git a/util/epist/actions.hh b/util/epist/actions.hh
index 11c262e0..1c70fc63 100644
--- a/util/epist/actions.hh
+++ b/util/epist/actions.hh
@@ -36,17 +36,17 @@ public:
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,
diff --git a/util/epist/epist.cc b/util/epist/epist.cc
index 3fb06463..feb6cd4c 100644
--- a/util/epist/epist.cc
+++ b/util/epist/epist.cc
@@ -88,6 +88,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
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")),
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 0d97b614..7c4294a0 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -175,6 +175,10 @@ void screen::handleKeypress(const XEvent &e) {
XWindow *window = *_active;
switch (it->type()) {
+ case Action::close:
+ window->close();
+ return;
+
case Action::toggleshade:
window->shade(! window->shaded());
return;
diff --git a/util/epist/window.cc b/util/epist/window.cc
index e650f415..c956bdfa 100644
--- a/util/epist/window.cc
+++ b/util/epist/window.cc
@@ -148,3 +148,9 @@ void XWindow::shade(const bool sh) const {
_window, (sh ? 1 : 0),
_xatom->getAtom(XAtom::net_wm_state_shaded));
}
+
+
+void XWindow::close() const {
+ _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_close_window,
+ _window);
+}
diff --git a/util/epist/window.hh b/util/epist/window.hh
index edd126b0..5c275d74 100644
--- a/util/epist/window.hh
+++ b/util/epist/window.hh
@@ -81,6 +81,7 @@ public:
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; }