]> Dogcows Code - chaz/openbox/commitdiff
add the ability to close a window
authorDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 09:17:23 +0000 (09:17 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 09:17:23 +0000 (09:17 +0000)
util/epist/actions.hh
util/epist/epist.cc
util/epist/screen.cc
util/epist/window.cc
util/epist/window.hh

index 11c262e0adc84b5ef5ef8555a380899710306d2e..1c70fc63a3d11be39bbdac1711196e5e6d4f2749 100644 (file)
@@ -36,17 +36,17 @@ public:
     noaction = 0,
     execute,
     iconify,
-    raiseWindow,
-    lowerWindow,
-    closeWindow,
-    toggleshade,
+    raise,
+    lower,
+    close, //done
+    toggleshade, //done
     moveWindowUp,
     moveWindowDown,
     moveWindowLeft,
     moveWindowRight,
 
-    nextWindow,
-    prevWindow,
+    nextWindow, //done for now
+    prevWindow, //done for now
     nextWindowOnAllWorkspaces,
     prevWindowOnAllWorkspaces,
 
index 3fb064631d3ade4bd04f78e33577fff548a8ab3a..feb6cd4cc33b918bcec9833bcb4964ea0ad51b34 100644 (file)
@@ -88,6 +88,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
                             XKeysymToKeycode(getXDisplay(),
                                              XStringToKeysym("F5")),
                             Mod1Mask));
+  _actions.push_back(Action(Action::close,
+                            XKeysymToKeycode(getXDisplay(),
+                                             XStringToKeysym("F4")),
+                            Mod1Mask));
   _actions.push_back(Action(Action::nextWindow,
                             XKeysymToKeycode(getXDisplay(),
                                              XStringToKeysym("Tab")),
index 0d97b6143a301c661370c96a6ba4bb65e3c44cd4..7c4294a07607fc07d751d0e4df77ee30eedb485f 100644 (file)
@@ -175,6 +175,10 @@ void screen::handleKeypress(const XEvent &e) {
         XWindow *window = *_active;
 
         switch (it->type()) {
+        case Action::close:
+          window->close();
+          return;
+
         case Action::toggleshade:
           window->shade(! window->shaded());
           return;
index e650f4156937e3aab8cc4c8e0783a04c2d0a0b25..c956bdfa875b6c5b0435d0ec353a638609889923 100644 (file)
@@ -148,3 +148,9 @@ void XWindow::shade(const bool sh) const {
                             _window, (sh ? 1 : 0),
                             _xatom->getAtom(XAtom::net_wm_state_shaded));
 }
+
+
+void XWindow::close() const {
+  _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_close_window,
+                            _window);
+}
index edd126b05064aa710d5a5433d6543a42e1a3c5cd..5c275d741baf67abfd2f1c381389ca11c69f826a 100644 (file)
@@ -81,6 +81,7 @@ public:
   void processEvent(const XEvent &e);
 
   void shade(const bool sh) const;
+  void close() const;
 
   bool operator == (const XWindow &w) const { return w._window == _window; }
   bool operator == (const Window &w) const { return w == _window; }
This page took 0.026011 seconds and 4 git commands to generate.