]> Dogcows Code - chaz/openbox/commitdiff
add capability to stick a window from input, and make close buttons work.
authorDana Jansens <danakj@orodu.net>
Sun, 30 Jun 2002 03:30:54 +0000 (03:30 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 30 Jun 2002 03:30:54 +0000 (03:30 +0000)
src/Input.cc
src/Input.hh
src/Window.cc
src/blackbox.hh

index 0c243ecce97884ab788a9295ef1879b215627c2e..d091fefb997da737efdb88ec0db05cd523b87ffb 100644 (file)
@@ -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;
index 18f2cb8b39931860c66f99702a691640b1dce406..777da31b6ae34b8c9621ca1191113d635b776c06 100644 (file)
@@ -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
   };
 
index 4bfca5c5f68ea76ae7b7485232d2e25f927ee303..09d4ec60e8e78462fea953af915582b537fa9b7b 100644 (file)
@@ -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) {
index a5bb815787336c15fea243fa36bb9b477d0c17c6..055f7761972a543b5dc239cb2bbe7c301579e812 100644 (file)
@@ -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; }
 
This page took 0.030087 seconds and 4 git commands to generate.