noaction
};
+ ActionType bool_types[] = {
+ sendToNextWorkspace,
+ sendToPrevWorkspace,
+ noaction
+ };
+
for (int i = 0; str_types[i] != noaction; ++i) {
if (type == str_types[i]) {
_stringParam = str;
return;
}
}
+
+ for (int i = 0; bool_types[i] != noaction; ++i) {
+ if (type == bool_types[i]) {
+ const char *tmp = str.c_str();
+
+
+ if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1") == 0 ||
+ strcasecmp(tmp, "on") == 0)
+ _numberParam = 1;
+ else
+ _numberParam = 0;
+ return;
+ }
+ }
_numberParam = atoi( str.c_str() );
toggleMaximizeHorizontal, //done
sendToWorkspace, //done
+ sendToNextWorkspace,
+ sendToPrevWorkspace,
nextWindow, //done for now
prevWindow, //done for now
Sends the currently focused window to another workspace. This takes a single
numberical parameter, which is the workspace to send the window to. Workspace
numbers begin at 1.
+.SS sendToNextWorkspace
+.SS sendToPrevWorkspace
+Sends the currently focused window to the next/previous workspace. Takes
+boolean parameter that when true switches to that workspace as well.
.SS nextWindow
.SS prevWindow
Cycles focus to the next/previous window on the workspace. This can take a
{ "togglemaximizevertical", Action::toggleMaximizeVertical },
{ "togglemaximizehorizontal", Action::toggleMaximizeHorizontal },
{ "sendtoworkspace", Action::sendToWorkspace },
+ { "sendtonextworkspace", Action::sendToNextWorkspace },
+ { "sendtoprevworkspace", Action::sendToPrevWorkspace },
{ "nextwindow", Action::nextWindow },
{ "prevwindow", Action::prevWindow },
{ "nextwindowonallworkspaces", Action::nextWindowOnAllWorkspaces },
case Action::sendToWorkspace:
window->sendTo(it->number());
return;
+
+ case Action::sendToNextWorkspace:
+ sendToNextWorkspace(*window, true, (it->number() != 0));
+ return;
+ case Action::sendToPrevWorkspace:
+ sendToNextWorkspace(*window, false, (it->number() != 0));
+ return;
+
case Action::toggleOmnipresent:
if (window->desktop() == 0xffffffff)
window->sendTo(_active_desktop);
changeWorkspace(destination);
}
-
void screen::changeWorkspace(const int num) const {
assert(_managed);
changeWorkspace(wnum);
}
+ void screen::sendToNextWorkspace(const XWindow &window, bool forward,
+ bool follow) const {
+ assert(_managed);
+ int dest = (signed) _active_desktop + (forward ? 1 : -1 );
+
+ if (dest >= (signed)_num_desktops)
+ dest = 0;
+ else if ( dest < 0)
+ dest = _num_desktops - 1;
+
+ window.sendTo(dest);
+ if (follow)
+ changeWorkspace(dest);
+ }
+
void screen::grabKey(const KeyCode keyCode, const int modifierMask) const {
Display *display = _epist->getXDisplay();
void changeWorkspaceVert(const int num) const;
void changeWorkspaceHorz(const int num) const;
+ void sendToNextWorkspace(const XWindow& win, bool forward,
+ bool follow) const;
void toggleShaded(const Window win) const;
void execCommand(const std::string &cmd) const;
_window, dest);
}
-
void XWindow::move(int x, int y) const {
// get the window's decoration sizes (margins)
Strut margins;