From: Dana Jansens Date: Sat, 20 Jul 2002 10:11:10 +0000 (+0000) Subject: add 'toggleomnipresent' action X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=5cb52056efcac25dd4b0d3035f860e5b1870bca1;p=chaz%2Fopenbox add 'toggleomnipresent' action --- diff --git a/util/epist/actions.hh b/util/epist/actions.hh index a441fb41..22b11370 100644 --- a/util/epist/actions.hh +++ b/util/epist/actions.hh @@ -40,6 +40,7 @@ public: lower, //done close, //done toggleshade, //done + toggleomnipresent, //done moveWindowUp, moveWindowDown, moveWindowLeft, diff --git a/util/epist/epist.cc b/util/epist/epist.cc index 7ac2daf5..bb33b308 100644 --- a/util/epist/epist.cc +++ b/util/epist/epist.cc @@ -120,6 +120,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file) XKeysymToKeycode(getXDisplay(), XStringToKeysym("I")), Mod1Mask | ControlMask)); + _actions.push_back(Action(Action::toggleomnipresent, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("O")), + Mod1Mask | ControlMask)); activateGrabs(); } diff --git a/util/epist/screen.cc b/util/epist/screen.cc index d6ce9bbb..ec73aa82 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -221,6 +221,13 @@ void screen::handleKeypress(const XEvent &e) { window->lower(); return; + case Action::toggleomnipresent: + if (window->desktop() == 0xffffffff) + window->sendTo(_active_desktop); + else + window->sendTo(0xffffffff); + return; + case Action::toggleshade: window->shade(! window->shaded()); return; diff --git a/util/epist/window.cc b/util/epist/window.cc index 376446a4..cbd60f37 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -177,3 +177,9 @@ void XWindow::focus() const { _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window, _window); } + + +void XWindow::sendTo(unsigned int dest) const { + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_desktop, + _window, dest); +} diff --git a/util/epist/window.hh b/util/epist/window.hh index 44df2135..351ec566 100644 --- a/util/epist/window.hh +++ b/util/epist/window.hh @@ -86,6 +86,7 @@ public: void lower() const; void iconify() const; void focus() const; + void sendTo(unsigned int dest) const; bool operator == (const XWindow &w) const { return w._window == _window; } bool operator == (const Window &w) const { return w == _window; }