]> Dogcows Code - chaz/openbox/commitdiff
add 'toggleomnipresent' action
authorDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 10:11:10 +0000 (10:11 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 10:11:10 +0000 (10:11 +0000)
util/epist/actions.hh
util/epist/epist.cc
util/epist/screen.cc
util/epist/window.cc
util/epist/window.hh

index a441fb41a4d4c924e8d8160e9105932a0135376c..22b11370ef66e237281fe818e71db99482e5ed51 100644 (file)
@@ -40,6 +40,7 @@ public:
     lower, //done
     close, //done
     toggleshade, //done
+    toggleomnipresent, //done
     moveWindowUp,
     moveWindowDown,
     moveWindowLeft,
index 7ac2daf564b2d15c389a5bfe0482c455d56dc870..bb33b30829b5c19bf1eab0e3cc71f2c3c75ef7e3 100644 (file)
@@ -120,6 +120,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
                            XKeysymToKeycode(getXDisplay(),
                                              XStringToKeysym("I")),
                            Mod1Mask | ControlMask));
+  _actions.push_back(Action(Action::toggleomnipresent,
+                           XKeysymToKeycode(getXDisplay(),
+                                             XStringToKeysym("O")),
+                           Mod1Mask | ControlMask));
   activateGrabs();
 }
 
index d6ce9bbbd0591cde2ccf3367a8f303e4537d0c80..ec73aa82e5aa857bc39a583904eba958caee0561 100644 (file)
@@ -221,6 +221,13 @@ void screen::handleKeypress(const XEvent &e) {
           window->lower();
           return;
 
+        case Action::toggleomnipresent:
+          if (window->desktop() == 0xffffffff)
+            window->sendTo(_active_desktop);
+          else
+            window->sendTo(0xffffffff);
+          return;
+
         case Action::toggleshade:
           window->shade(! window->shaded());
           return;
index 376446a465666250ccc53a14bd96c8f5d6ce5c1c..cbd60f3733831f34274c788dc0ce83a9c98e4f35 100644 (file)
@@ -177,3 +177,9 @@ void XWindow::focus() const {
   _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window,
                             _window);
 }
+
+
+void XWindow::sendTo(unsigned int dest) const {
+  _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_desktop,
+                            _window, dest);
+}
index 44df2135e7437eb434522ca0de40f8911f60796f..351ec566844d6342a66c1e477f677423c168f00f 100644 (file)
@@ -86,6 +86,7 @@ public:
   void lower() const;
   void iconify() const;
   void focus() const;
+  void sendTo(unsigned int dest) const;
 
   bool operator == (const XWindow &w) const { return w._window == _window; }
   bool operator == (const Window &w) const { return w == _window; }
This page took 0.027168 seconds and 4 git commands to generate.