]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
Safari_Al's patch which fixes inconsistent capitalization in some actions.
[chaz/openbox] / src / Window.cc
index 98696a5671b9910538db7035bb09a72a8561f432..ea6b68cb0487f8fa76f9bef4634f3dc09992753f 100644 (file)
@@ -590,8 +590,8 @@ void BlackboxWindow::decorate(void) {
   }
 
   if (decorations & Decor_Border) {
-    frame.fborder_pixel = screen->getWindowStyle()->f_focus.pixel();
-    frame.uborder_pixel = screen->getWindowStyle()->f_unfocus.pixel();
+    frame.fborder_pixel = screen->getWindowStyle()->f_focus.color().pixel();
+    frame.uborder_pixel = screen->getWindowStyle()->f_unfocus.color().pixel();
   }
 
   if (decorations & Decor_Handle) {
@@ -2710,7 +2710,7 @@ void BlackboxWindow::reparentNotifyEvent(const XReparentEvent *re) {
 
 
 void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
-  if (pe->state == PropertyDelete)
+  if (pe->state == PropertyDelete || ! validateClient())
     return;
 
 #if 0
@@ -3072,6 +3072,9 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
   doWindowSnapping(dx, dy);
 
   if (screen->doOpaqueMove()) {
+    if (screen->doWorkspaceWarping())
+      doWorkspaceWarping(x_root, y_root, dx);
+
     configure(dx, dy, frame.rect.width(), frame.rect.height());
   } else {
     XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(),
@@ -3081,6 +3084,9 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
                    frame.changing.width() - 1,
                    frame.changing.height() - 1);
 
+    if (screen->doWorkspaceWarping())
+      doWorkspaceWarping(x_root, y_root, dx);
+
     frame.changing.setPos(dx, dy);
 
     XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(),
@@ -3091,15 +3097,11 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
                    frame.changing.height() - 1);
   }
 
-  if (screen->doWorkspaceWarping())
-    doWorkspaceWarping(x_root, y_root, dx, dy);
-
   screen->showPosition(dx, dy);
 }
 
 
-void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
-                                        int &dx, int dy) {
+void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root, int &dx) {
   // workspace warping
   bool warp = False;
   unsigned int dest = screen->getCurrentWorkspaceID();
@@ -3118,8 +3120,6 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
   if (! warp)
     return;
 
-  endMove();
-
   bool focus = flags.focused; // had focus while moving?
 
   int dest_x = x_root;
@@ -3131,28 +3131,28 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
     dx -= screen->getRect().width() - 1;
   }
 
-  /*
-     We grab the X server here so that we dont end up magically grabbing
-     a different window dring the warp.
-  */
-  XGrabServer(blackbox->getXDisplay());
-
   if (! flags.stuck)
     screen->reassociateWindow(this, dest, False);
   screen->changeWorkspaceID(dest);
 
-  configure(dx, dy, frame.rect.width(), frame.rect.height());
+  if (screen->doOpaqueMove())
+    XGrabServer(blackbox->getXDisplay());
 
+  XUngrabPointer(blackbox->getXDisplay(), CurrentTime);
   XWarpPointer(blackbox->getXDisplay(), None, 
                screen->getRootWindow(), 0, 0, 0, 0,
                dest_x, y_root);
+  XGrabPointer(blackbox->getXDisplay(), frame.window, False,
+               PointerMotionMask | ButtonReleaseMask,
+               GrabModeAsync, GrabModeAsync,
+               None, blackbox->getMoveCursor(), CurrentTime);
 
-  XUngrabServer(blackbox->getXDisplay());
+  if (screen->doOpaqueMove())
+    XUngrabServer(blackbox->getXDisplay());
 
   if (focus)
     setInputFocus();
 
-  beginMove(dest_x, y_root);
 }
 
 
@@ -3688,14 +3688,16 @@ void BlackboxWindow::enterNotifyEvent(const XCrossingEvent* ce) {
     }
   }
 
-  if ((! leave || inferior) && ! isFocused()) {
-    bool success = setInputFocus();
-    if (success)    // if focus succeeded install the colormap
-      installColormap(True); // XXX: shouldnt we honour no install?
-  }
+  if (! leave || inferior) {
+    if (! isFocused()) {
+      bool success = setInputFocus();
+      if (success)    // if focus succeeded install the colormap
+        installColormap(True); // XXX: shouldnt we honour no install?
+    }
 
-  if (screen->doAutoRaise())
-    timer->start();
+    if (screen->doAutoRaise())
+      timer->start();
+  }
 }
 
 
This page took 0.030322 seconds and 4 git commands to generate.