]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.cc
added ClickMouse window placement policy
[chaz/openbox] / src / openbox.cc
index 70d1d920f30f08f7a96f88117ed62627cb5af534..99d623e5c99f4c3f4c556b0078a9a5540c87c356 100644 (file)
@@ -479,9 +479,19 @@ void Openbox::process_event(XEvent *e) {
     if (! win)
       win = new OpenboxWindow(*this, e->xmaprequest.window);
 
-    if ((win = searchWindow(e->xmaprequest.window)))
+    if ((win = searchWindow(e->xmaprequest.window))) {
       win->mapRequestEvent(&e->xmaprequest);
-
+      // if we're using the click to place placement type, then immediately
+      // after the window is mapped, we need to start interactively moving it
+      if (win->getScreen()->placementPolicy() == BScreen::ClickMousePlacement) {
+        int x, y, rx, ry;
+        Window c, r;
+        unsigned int m;
+        XQueryPointer(getXDisplay(), win->getScreen()->getRootWindow(),
+                      &r, &c, &rx, &ry, &x, &y, &m);
+        win->startMove(rx, ry);
+      }
+    }
     break;
   }
 
@@ -995,7 +1005,9 @@ void Openbox::save() {
   for (BScreen *s = it.current(); s != NULL; it++, s = it.current()) {
     s->save();
     s->getToolbar()->save();
+#ifdef    SLIT
     s->getSlit()->save();
+#endif // SLIT
   }
 
   config.setAutoSave(true);
This page took 0.020558 seconds and 4 git commands to generate.