From b94699afc339c469534521c44470aa6d19e5b4cc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 20 Jul 2002 09:20:14 +0000 Subject: [PATCH] add raising and lowering --- util/epist/actions.hh | 4 ++-- util/epist/epist.cc | 8 ++++++++ util/epist/screen.cc | 8 ++++++++ util/epist/window.cc | 10 ++++++++++ util/epist/window.hh | 2 ++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/util/epist/actions.hh b/util/epist/actions.hh index 1c70fc63..710606ba 100644 --- a/util/epist/actions.hh +++ b/util/epist/actions.hh @@ -36,8 +36,8 @@ public: noaction = 0, execute, iconify, - raise, - lower, + raise, //done + lower, //done close, //done toggleshade, //done moveWindowUp, diff --git a/util/epist/epist.cc b/util/epist/epist.cc index feb6cd4c..3654150d 100644 --- a/util/epist/epist.cc +++ b/util/epist/epist.cc @@ -100,6 +100,14 @@ epist::epist(char **argv, char *dpy_name, char *rc_file) XKeysymToKeycode(getXDisplay(), XStringToKeysym("Tab")), Mod1Mask | ShiftMask)); + _actions.push_back(Action(Action::raise, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Up")), + Mod1Mask)); + _actions.push_back(Action(Action::lower, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Down")), + Mod1Mask)); activateGrabs(); } diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 7c4294a0..db812878 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -179,6 +179,14 @@ void screen::handleKeypress(const XEvent &e) { window->close(); return; + case Action::raise: + window->raise(); + return; + + case Action::lower: + window->lower(); + return; + case Action::toggleshade: window->shade(! window->shaded()); return; diff --git a/util/epist/window.cc b/util/epist/window.cc index c956bdfa..592aa73e 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -154,3 +154,13 @@ void XWindow::close() const { _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_close_window, _window); } + + +void XWindow::raise() const { + XRaiseWindow(_epist->getXDisplay(), _window); +} + + +void XWindow::lower() const { + XLowerWindow(_epist->getXDisplay(), _window); +} diff --git a/util/epist/window.hh b/util/epist/window.hh index 5c275d74..3b118375 100644 --- a/util/epist/window.hh +++ b/util/epist/window.hh @@ -82,6 +82,8 @@ public: void shade(const bool sh) const; void close() const; + void raise() const; + void lower() const; bool operator == (const XWindow &w) const { return w._window == _window; } bool operator == (const Window &w) const { return w == _window; } -- 2.39.2