Showing with 45 additions and 11 deletions.
  1. +2 −0 doc/asciidoc/fluxbox-keys.txt
  2. +6 −0 doc/asciidoc/fluxbox.txt
  3. +2 −0 src/IconbarTool.cc
  4. +13 −2 src/Screen.cc
  5. +1 −0 src/Screen.hh
  6. +3 −0 src/Toolbar.cc
  7. +14 −3 src/Window.cc
  8. +4 −6 src/WorkspaceCmd.cc
@@ -359,6 +359,8 @@ called).
offset value 'n', which defaults to *1* and refers to the number of
workspaces to move at one time. {Next,Prev}Workspace wrap around when
going past the last workspace, whereas {Right,Left}Workspace do not.
The special offset "0" will toggle the former workspace for Next- and
PrevWorkspace

*Workspace* 'number'::
Jumps to the given workspace 'number'. The first workspace is *1*.
@@ -994,6 +994,12 @@ Default: *10*
*session.screen0.iconbar.alignment*: 'position'::
This value should be changed in the Iconbar Mode menu.
+

*session.screen0.iconbar.iconifiedPattern*: 'string'::
Allows to decorate the title of iconified (minimized) windows.
The title is represented by "%t".
+
Default: *( %t )*
--
Available options:;;
- *Left*: Fixed width, aligned left
@@ -194,6 +194,7 @@ class ShowMenu: public FbTk::Command<void> {
public:
explicit ShowMenu(FluxboxWindow &win):m_win(win) { }
void execute() {
FbTk::Menu::hideShownMenu();
// get last button pos
const XEvent &e = Fluxbox::instance()->lastEvent();
m_win.popupMenu(e.xbutton.x_root, e.xbutton.y_root);
@@ -206,6 +207,7 @@ class FocusCommand: public FbTk::Command<void> {
public:
explicit FocusCommand(Focusable &win): m_win(win) { }
void execute() {
FbTk::Menu::hideShownMenu();
// this needs to be a local variable, as this object could be destroyed
// if the workspace is changed.
FluxboxWindow *fbwin = m_win.fbwindow();
@@ -194,6 +194,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
m_layermanager(num_layers),
root_colormap_installed(false),
m_current_workspace(0),
m_former_workspace(0),
m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")),
// the order of windowtheme and winbutton theme is important
@@ -919,6 +920,8 @@ int BScreen::removeLastWorkspace() {

if (m_current_workspace->workspaceID() == wkspc->workspaceID())
changeWorkspaceID(m_current_workspace->workspaceID() - 1);
if (m_former_workspace && m_former_workspace->workspaceID() == wkspc->workspaceID())
m_former_workspace = 0;

wkspc->removeAll(wkspc->workspaceID()-1);

@@ -950,6 +953,8 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
id == m_current_workspace->workspaceID())
return;

m_former_workspace = m_current_workspace;

/* Ignore all EnterNotify events until the pointer actually moves */
this->focusControl().ignoreAtPointer();

@@ -1524,14 +1529,20 @@ void BScreen::setLayer(FbTk::LayerItem &item, int layernum) {
Goes to the workspace "right" of the current
*/
void BScreen::nextWorkspace(int delta) {
changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces());
if (delta)
changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces());
else if (m_former_workspace)
changeWorkspaceID(m_former_workspace->workspaceID());
}

/**
Goes to the workspace "left" of the current
*/
void BScreen::prevWorkspace(int delta) {
changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces());
if (delta)
changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces());
else if (m_former_workspace)
changeWorkspaceID(m_former_workspace->workspaceID());
}

/**
@@ -502,6 +502,7 @@ private:
std::unique_ptr<ToolButtonMap> m_toolButtonMap;

Workspace *m_current_workspace;
Workspace *m_former_workspace;

WorkspaceNames m_workspace_names;
Workspaces m_workspaces_list;
@@ -514,6 +514,9 @@ void Toolbar::reconfigure() {

void Toolbar::buttonPressEvent(XButtonEvent &be) {
Display *dpy = Fluxbox::instance()->display();

FbTk::Menu::hideShownMenu();

if (be.subwindow) {
// Do not intercept mouse events that are meant for the tray icon
if (SystemTray::doesControl(be.subwindow)) {
@@ -2415,6 +2415,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
m_last_button_y = be.y_root;
m_last_pressed_button = be.button;

FbTk::Menu::hideShownMenu();

Keys *k = Fluxbox::instance()->keys();
int context = 0;
context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root);
@@ -2448,7 +2450,7 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth();
m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();
}
FbTk::Menu::hideShownMenu();

if (!m_focused && acceptsFocus() && m_click_focus)
focus();

@@ -2462,6 +2464,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {

}

const unsigned int DEADZONE = 4;

void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {

if (m_last_pressed_button == static_cast<int>(re.button)) {
@@ -2474,7 +2478,7 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
stopResizing();
else if (m_attaching_tab)
attachTo(re.x_root, re.y_root);
else if (m_last_button_x == re.x_root && m_last_button_y == re.y_root) {
else if (std::abs(m_last_button_x - re.x_root) + std::abs(m_last_button_y - re.y_root) < DEADZONE) {
int context = 0;
context = frame().getContext(re.subwindow ? re.subwindow : re.window,
re.x_root, re.y_root);
@@ -2505,7 +2509,14 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {

// in case someone put MoveX :StartMoving etc into keys, we have
// to activate it before doing the actual motionNotify code
Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time);
if (std::abs(m_last_button_x - me.x_root) + std::abs(m_last_button_y - me.y_root) >= DEADZONE) {
XEvent &e = const_cast<XEvent&>(Fluxbox::instance()->lastEvent()); // is copy of "me"
e.xmotion.x_root = m_last_button_x;
e.xmotion.y_root = m_last_button_y;
Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time);
e.xmotion.x = me.x_root;
e.xmotion.y = me.y_root;
}

if (moving) {

@@ -357,15 +357,13 @@ REGISTER_COMMAND_PARSER(workspace, parseIntCmd, void);
} // end anonymous namespace

void NextWorkspaceCmd::execute() {
BScreen *screen = Fluxbox::instance()->mouseScreen();
if (screen != 0)
screen->nextWorkspace(m_option == 0 ? 1 : m_option);
if (BScreen *screen = Fluxbox::instance()->mouseScreen())
screen->nextWorkspace(m_option);
}

void PrevWorkspaceCmd::execute() {
BScreen *screen = Fluxbox::instance()->mouseScreen();
if (screen != 0)
screen->prevWorkspace(m_option == 0 ? 1 : m_option);
if (BScreen *screen = Fluxbox::instance()->mouseScreen())
screen->prevWorkspace(m_option);
}

void LeftWorkspaceCmd::execute() {