summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-20 09:28:01 +0000
committerDana Jansens <danakj@orodu.net>2002-07-20 09:28:01 +0000
commitc6234a4de0263828e89e3b8812cbb93e72d13ffc (patch)
tree19f9d117eeb7891b32c72990ef652bc69fe63ce6 /util
parentb94699afc339c469534521c44470aa6d19e5b4cc (diff)
add iconifying
Diffstat (limited to 'util')
-rw-r--r--util/epist/actions.hh2
-rw-r--r--util/epist/epist.cc4
-rw-r--r--util/epist/screen.cc4
-rw-r--r--util/epist/screen.hh1
-rw-r--r--util/epist/window.cc6
-rw-r--r--util/epist/window.hh1
6 files changed, 17 insertions, 1 deletions
diff --git a/util/epist/actions.hh b/util/epist/actions.hh
index 710606ba..6506f0e7 100644
--- a/util/epist/actions.hh
+++ b/util/epist/actions.hh
@@ -35,7 +35,7 @@ public:
enum ActionType {
noaction = 0,
execute,
- iconify,
+ iconify, //done
raise, //done
lower, //done
close, //done
diff --git a/util/epist/epist.cc b/util/epist/epist.cc
index 3654150d..7b2b432d 100644
--- a/util/epist/epist.cc
+++ b/util/epist/epist.cc
@@ -108,6 +108,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
XKeysymToKeycode(getXDisplay(),
XStringToKeysym("Down")),
Mod1Mask));
+ _actions.push_back(Action(Action::iconify,
+ XKeysymToKeycode(getXDisplay(),
+ XStringToKeysym("I")),
+ Mod1Mask | ControlMask));
activateGrabs();
}
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index db812878..d8d8edca 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::iconify:
+ window->iconify();
+ return;
+
case Action::close:
window->close();
return;
diff --git a/util/epist/screen.hh b/util/epist/screen.hh
index 55b0babd..7b500d03 100644
--- a/util/epist/screen.hh
+++ b/util/epist/screen.hh
@@ -60,6 +60,7 @@ public:
inline Window rootWindow() const { return _root; }
inline bool managed() const { return _managed; }
+ inline int number() const { return _number; }
void processEvent(const XEvent &e);
diff --git a/util/epist/window.cc b/util/epist/window.cc
index 592aa73e..c2dff72a 100644
--- a/util/epist/window.cc
+++ b/util/epist/window.cc
@@ -164,3 +164,9 @@ void XWindow::raise() const {
void XWindow::lower() const {
XLowerWindow(_epist->getXDisplay(), _window);
}
+
+
+void XWindow::iconify() const {
+ _xatom->sendClientMessage(_screen->rootWindow(), XAtom::wm_change_state,
+ _window, IconicState);
+}
diff --git a/util/epist/window.hh b/util/epist/window.hh
index 3b118375..29e2d6ff 100644
--- a/util/epist/window.hh
+++ b/util/epist/window.hh
@@ -84,6 +84,7 @@ public:
void close() const;
void raise() const;
void lower() const;
+ void iconify() const;
bool operator == (const XWindow &w) const { return w._window == _window; }
bool operator == (const Window &w) const { return w == _window; }