add 'toggleomnipresent' action

This commit is contained in:
Dana Jansens 2002-07-20 10:11:10 +00:00
parent e01cab39e5
commit 5cb52056ef
5 changed files with 19 additions and 0 deletions

View file

@ -40,6 +40,7 @@ public:
lower, //done
close, //done
toggleshade, //done
toggleomnipresent, //done
moveWindowUp,
moveWindowDown,
moveWindowLeft,

View file

@ -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();
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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; }