summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-06-30 03:30:54 +0000
committerDana Jansens <danakj@orodu.net>2002-06-30 03:30:54 +0000
commit18064df19f670589b9387c194b55345c717473db (patch)
treefed19ea6e5d097b021ed66e611db1fb2186200de /src
parent351a06655bdd7d440780b5bc5b255081c888044b (diff)
add capability to stick a window from input, and make close buttons work.
Diffstat (limited to 'src')
-rw-r--r--src/Input.cc12
-rw-r--r--src/Input.hh16
-rw-r--r--src/Window.cc4
-rw-r--r--src/blackbox.hh1
4 files changed, 26 insertions, 7 deletions
diff --git a/src/Input.cc b/src/Input.cc
index 0c243ecc..d091fefb 100644
--- a/src/Input.cc
+++ b/src/Input.cc
@@ -205,6 +205,18 @@ void BInput::doAction(BlackboxWindow *window, Action action) const {
if (window) window->lower();
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:
if (window && ! window->isShaded()) window->shade();
return;
diff --git a/src/Input.hh b/src/Input.hh
index 18f2cb8b..777da31b 100644
--- a/src/Input.hh
+++ b/src/Input.hh
@@ -64,20 +64,26 @@ public:
Lower,
Shade,
Unshade,
+ Stick,
+ Unstick,
Focus,
Iconify,
- ToggleMaximizeVert,
- ToggleMaximizeHoriz,
- ToggleMaximize,
- ToggleShade,
Close,
+ ShowWindowMenu,
+
BeginMove,
BeginResizeUL,
BeginResizeUR,
BeginResizeLL,
BeginResizeLR,
BeginResizeRelative, // picks a corner based on the mouse cursor's position
- ShowWindowMenu,
+
+ ToggleMaximizeVert,
+ ToggleMaximizeHoriz,
+ ToggleMaximize,
+ ToggleShade,
+ ToggleStick,
+
NUM_ACTIONS
};
diff --git a/src/Window.cc b/src/Window.cc
index 4bfca5c5..09d4ec60 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2750,8 +2750,8 @@ void BlackboxWindow::buttonReleaseEvent(const XButtonEvent *re) {
BInput::IconifyButtonClick))
redrawIconifyButton(False);
} else if (frame.close_button == re->window) {
- if ((re->x < 0 || re->x >= static_cast<signed>(frame.button_w)) ||
- (re->y < 0 || re->y >= 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))))
input->doAction(this, re->button, state, BInput::CloseButtonClick);
redrawCloseButton(False);
} else if (flags.moving) {
diff --git a/src/blackbox.hh b/src/blackbox.hh
index a5bb8157..055f7761 100644
--- a/src/blackbox.hh
+++ b/src/blackbox.hh
@@ -202,6 +202,7 @@ public:
inline XAtom *getXAtom(void) { return xatom; }
inline BInput *getInput(void) { return input; }
+ inline BScreen *getFocusedScreen(void) { return active_screen; }
inline BlackboxWindow *getFocusedWindow(void) { return focused_window; }
inline BlackboxWindow *getChangingWindow(void) { return changing_window; }