make cycling by window class work properly, was using the app name instead of class
also, make the code gcc 2.95 friendly
This commit is contained in:
parent
ffd7021d22
commit
7d67f8557b
2 changed files with 18 additions and 3 deletions
|
@ -25,6 +25,10 @@
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef HAVE_STDIO_H
|
||||||
|
# include <stdio.h>
|
||||||
|
#endif // HAVE_STDIO_H
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
@ -204,6 +208,9 @@ void screen::handleKeypress(const XEvent &e) {
|
||||||
case Action::execute:
|
case Action::execute:
|
||||||
execCommand(it->string());
|
execCommand(it->string());
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// these actions require an active window
|
// these actions require an active window
|
||||||
|
@ -241,6 +248,10 @@ void screen::handleKeypress(const XEvent &e) {
|
||||||
case Action::toggleshade:
|
case Action::toggleshade:
|
||||||
window->shade(! window->shaded());
|
window->shade(! window->shaded());
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
assert(false); // unhandled action type!
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,6 +400,10 @@ void screen::cycleWindow(const bool forward, const bool alldesktops,
|
||||||
|
|
||||||
WindowList::const_iterator target = _active;
|
WindowList::const_iterator target = _active;
|
||||||
|
|
||||||
|
string classname;
|
||||||
|
if (sameclass && target != _clients.end())
|
||||||
|
classname = (*target)->appClass();
|
||||||
|
|
||||||
if (target == _clients.end())
|
if (target == _clients.end())
|
||||||
target = _clients.begin();
|
target = _clients.begin();
|
||||||
|
|
||||||
|
@ -405,8 +420,8 @@ void screen::cycleWindow(const bool forward, const bool alldesktops,
|
||||||
} while (target == _clients.end() ||
|
} while (target == _clients.end() ||
|
||||||
(*target)->iconic() ||
|
(*target)->iconic() ||
|
||||||
(! alldesktops && (*target)->desktop() != _active_desktop) ||
|
(! alldesktops && (*target)->desktop() != _active_desktop) ||
|
||||||
(sameclass && _active != _clients.end() &&
|
(sameclass && ! classname.empty() &&
|
||||||
(*target)->appClass() != (*_active)->appClass()));
|
(*target)->appClass() != classname));
|
||||||
|
|
||||||
if (target != _clients.end())
|
if (target != _clients.end())
|
||||||
(*target)->focus();
|
(*target)->focus();
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
inline unsigned int desktop() const { return _desktop; }
|
inline unsigned int desktop() const { return _desktop; }
|
||||||
inline const std::string &title() const { return _title; }
|
inline const std::string &title() const { return _title; }
|
||||||
inline const std::string &appName() const { return _app_name; }
|
inline const std::string &appName() const { return _app_name; }
|
||||||
inline const std::string &appClass() const { return _app_name; }
|
inline const std::string &appClass() const { return _app_class; }
|
||||||
|
|
||||||
inline bool shaded() const { return _shaded; }
|
inline bool shaded() const { return _shaded; }
|
||||||
inline bool iconic() const { return _iconic; }
|
inline bool iconic() const { return _iconic; }
|
||||||
|
|
Loading…
Reference in a new issue