From: Dana Jansens Date: Sat, 20 Jul 2002 09:58:49 +0000 (+0000) Subject: add next/prev window on all workspaces X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=a9dfa0439bd8d4f525d5b41a22a3eb14b94d1200;p=chaz%2Fopenbox add next/prev window on all workspaces --- diff --git a/util/epist/actions.hh b/util/epist/actions.hh index 6506f0e7..0588692d 100644 --- a/util/epist/actions.hh +++ b/util/epist/actions.hh @@ -47,8 +47,8 @@ public: nextWindow, //done for now prevWindow, //done for now - nextWindowOnAllWorkspaces, - prevWindowOnAllWorkspaces, + nextWindowOnAllWorkspaces, //done + prevWindowOnAllWorkspaces, //done nextWindowOfClass, prevWindowOfClass, diff --git a/util/epist/epist.cc b/util/epist/epist.cc index 7b2b432d..7ac2daf5 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::nextWindowOnAllWorkspaces, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask | ControlMask)); + _actions.push_back(Action(Action::prevWindowOnAllWorkspaces, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask | ShiftMask | ControlMask)); _actions.push_back(Action(Action::raise, XKeysymToKeycode(getXDisplay(), XStringToKeysym("Up")), diff --git a/util/epist/screen.cc b/util/epist/screen.cc index c7c2a42d..72ee3435 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -356,16 +356,8 @@ void screen::cycleWindow(const bool forward, const bool alldesktops) const { (*target)->iconic() || (! alldesktops && (*target)->desktop() != _active_desktop)); - if (target != _clients.end()) { - if ((*target)->desktop() != _active_desktop) - changeWorkspace((*target)->desktop()); - - // we dont send an ACTIVE_WINDOW client message because that would also - // unshade the window if it was shaded - XSetInputFocus(_epist->getXDisplay(), (*target)->window(), RevertToNone, - CurrentTime); - XRaiseWindow(_epist->getXDisplay(), (*target)->window()); - } + if (target != _clients.end()) + (*target)->focus(); } diff --git a/util/epist/window.cc b/util/epist/window.cc index c2dff72a..376446a4 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -170,3 +170,10 @@ void XWindow::iconify() const { _xatom->sendClientMessage(_screen->rootWindow(), XAtom::wm_change_state, _window, IconicState); } + + +void XWindow::focus() const { + // this will also unshade the window.. + _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window, + _window); +} diff --git a/util/epist/window.hh b/util/epist/window.hh index 29e2d6ff..44df2135 100644 --- a/util/epist/window.hh +++ b/util/epist/window.hh @@ -85,6 +85,7 @@ public: void raise() const; void lower() const; void iconify() const; + void focus() const; bool operator == (const XWindow &w) const { return w._window == _window; } bool operator == (const Window &w) const { return w == _window; }