add capability to stick a window from input, and make close buttons work.
This commit is contained in:
parent
351a06655b
commit
18064df19f
4 changed files with 26 additions and 7 deletions
12
src/Input.cc
12
src/Input.cc
|
@ -205,6 +205,18 @@ void BInput::doAction(BlackboxWindow *window, Action action) const {
|
||||||
if (window) window->lower();
|
if (window) window->lower();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case Stick:
|
||||||
|
if (window && ! window->isStuck()) window->stick();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case Unstick:
|
||||||
|
if (window && window->isStuck()) window->stick();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case ToggleStick:
|
||||||
|
if (window) window->stick();
|
||||||
|
return;
|
||||||
|
|
||||||
case Shade:
|
case Shade:
|
||||||
if (window && ! window->isShaded()) window->shade();
|
if (window && ! window->isShaded()) window->shade();
|
||||||
return;
|
return;
|
||||||
|
|
16
src/Input.hh
16
src/Input.hh
|
@ -64,20 +64,26 @@ public:
|
||||||
Lower,
|
Lower,
|
||||||
Shade,
|
Shade,
|
||||||
Unshade,
|
Unshade,
|
||||||
|
Stick,
|
||||||
|
Unstick,
|
||||||
Focus,
|
Focus,
|
||||||
Iconify,
|
Iconify,
|
||||||
ToggleMaximizeVert,
|
|
||||||
ToggleMaximizeHoriz,
|
|
||||||
ToggleMaximize,
|
|
||||||
ToggleShade,
|
|
||||||
Close,
|
Close,
|
||||||
|
ShowWindowMenu,
|
||||||
|
|
||||||
BeginMove,
|
BeginMove,
|
||||||
BeginResizeUL,
|
BeginResizeUL,
|
||||||
BeginResizeUR,
|
BeginResizeUR,
|
||||||
BeginResizeLL,
|
BeginResizeLL,
|
||||||
BeginResizeLR,
|
BeginResizeLR,
|
||||||
BeginResizeRelative, // picks a corner based on the mouse cursor's position
|
BeginResizeRelative, // picks a corner based on the mouse cursor's position
|
||||||
ShowWindowMenu,
|
|
||||||
|
ToggleMaximizeVert,
|
||||||
|
ToggleMaximizeHoriz,
|
||||||
|
ToggleMaximize,
|
||||||
|
ToggleShade,
|
||||||
|
ToggleStick,
|
||||||
|
|
||||||
NUM_ACTIONS
|
NUM_ACTIONS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2750,8 +2750,8 @@ void BlackboxWindow::buttonReleaseEvent(const XButtonEvent *re) {
|
||||||
BInput::IconifyButtonClick))
|
BInput::IconifyButtonClick))
|
||||||
redrawIconifyButton(False);
|
redrawIconifyButton(False);
|
||||||
} else if (frame.close_button == re->window) {
|
} else if (frame.close_button == re->window) {
|
||||||
if ((re->x < 0 || re->x >= static_cast<signed>(frame.button_w)) ||
|
if (! ((re->x < 0 || re->x >= static_cast<signed>(frame.button_w)) ||
|
||||||
(re->y < 0 || re->y >= static_cast<signed>(frame.button_w)))
|
(re->y < 0 || re->y >= static_cast<signed>(frame.button_w))))
|
||||||
input->doAction(this, re->button, state, BInput::CloseButtonClick);
|
input->doAction(this, re->button, state, BInput::CloseButtonClick);
|
||||||
redrawCloseButton(False);
|
redrawCloseButton(False);
|
||||||
} else if (flags.moving) {
|
} else if (flags.moving) {
|
||||||
|
|
|
@ -202,6 +202,7 @@ public:
|
||||||
inline XAtom *getXAtom(void) { return xatom; }
|
inline XAtom *getXAtom(void) { return xatom; }
|
||||||
inline BInput *getInput(void) { return input; }
|
inline BInput *getInput(void) { return input; }
|
||||||
|
|
||||||
|
inline BScreen *getFocusedScreen(void) { return active_screen; }
|
||||||
inline BlackboxWindow *getFocusedWindow(void) { return focused_window; }
|
inline BlackboxWindow *getFocusedWindow(void) { return focused_window; }
|
||||||
inline BlackboxWindow *getChangingWindow(void) { return changing_window; }
|
inline BlackboxWindow *getChangingWindow(void) { return changing_window; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue