]> Dogcows Code - chaz/openbox/commitdiff
properly handle placing a window while another window is still placing.
authorDana Jansens <danakj@orodu.net>
Sun, 28 Apr 2002 19:09:25 +0000 (19:09 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 28 Apr 2002 19:09:25 +0000 (19:09 +0000)
src/Window.cc
src/openbox.cc

index 7ce182dcb409e8a04b1da86916d66ddbadb4516f..8df9ddfe733af2da1c99ded8fa80de0da9ef7e1a 100644 (file)
@@ -1465,6 +1465,24 @@ void OpenboxWindow::deiconify(Bool reassoc, Bool raise) {
   XMapSubwindows(display, frame.window);
   XMapWindow(display, frame.window);
 
+  // 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 (!(flags.iconic || reassoc) &&
+      screen->placementPolicy() == BScreen::ClickMousePlacement) {
+    // if the last window wasn't placed yet, or we're just moving a window
+    // already, finish off that move cleanly
+    OpenboxWindow *w = openbox.getFocusedWindow();
+    if (w != (OpenboxWindow *) 0 && w->flags.moving)
+      w->endMove();
+
+    int x, y, rx, ry;
+    Window c, r;
+    unsigned int m;
+    XQueryPointer(openbox.getXDisplay(), screen->getRootWindow(),
+                  &r, &c, &rx, &ry, &x, &y, &m);
+    startMove(rx, ry);
+  }
+  
   if (flags.iconic && screen->focusNew()) setInputFocus();
 
   flags.visible = True;
@@ -1725,6 +1743,7 @@ void OpenboxWindow::setFocusFlag(Bool focus) {
 
   if (screen->sloppyFocus() && screen->autoRaise() && timer->isTiming())
     timer->stop();
+
 }
 
 
index 99d623e5c99f4c3f4c556b0078a9a5540c87c356..cfdb6e9bc3db9fbd9aae5bfb498af8ed4198d573 100644 (file)
@@ -479,19 +479,9 @@ 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;
   }
 
This page took 0.027495 seconds and 4 git commands to generate.