summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Nita <marius@cs.pdx.edu>2002-08-22 10:13:02 +0000
committerMarius Nita <marius@cs.pdx.edu>2002-08-22 10:13:02 +0000
commit22e8615f6125cc117af9e01124b9bcc2b19c59ab (patch)
tree81b0d752baccacdcc26a2519ed09529cf29b1e99
parent78a8ca9e533e410444cd328f68e8006d03b9b145 (diff)
modified focus() to accept a no-raise parameter
-rw-r--r--util/epist/window.cc15
-rw-r--r--util/epist/window.hh2
2 files changed, 10 insertions, 7 deletions
diff --git a/util/epist/window.cc b/util/epist/window.cc
index 85429719..5d1690f0 100644
--- a/util/epist/window.cc
+++ b/util/epist/window.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
// window.cc for Epistrophy - a key handler for NETWM/EWMH window managers.
// Copyright (c) 2002 - 2002 Ben Jansens <ben at orodu.net>
//
@@ -261,12 +261,15 @@ void XWindow::iconify() const {
}
-void XWindow::focus() const {
+void XWindow::focus(bool raise) const {
// this will cause the window to be uniconified also
- _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window,
- _window);
-
- //XSetInputFocus(_epist->getXDisplay(), _window, None, CurrentTime);
+
+ if (raise) {
+ _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window,
+ _window);
+ } else {
+ XSetInputFocus(_epist->getXDisplay(), _window, None, CurrentTime);
+ }
}
diff --git a/util/epist/window.hh b/util/epist/window.hh
index ad00739f..d14ec06f 100644
--- a/util/epist/window.hh
+++ b/util/epist/window.hh
@@ -117,7 +117,7 @@ public:
void raise() const;
void lower() const;
void iconify() const;
- void focus() const;
+ void focus(bool raise = true) const;
void decorate(bool d) const;
void sendTo(unsigned int dest) const;
void move(int x, int y) const;