]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
don't let windows snap to themself
[chaz/openbox] / src / Window.cc
index 46bd644ddf64145652730399ee95828b58ba4404..fae990b63cb0e92435ac7cfd701788bce0526af9 100644 (file)
@@ -1420,7 +1420,8 @@ void BlackboxWindow::getTransientInfo(void) {
   // Check for a circular transient state: this can lock up Blackbox
   // when it tries to find the non-transient window for a transient.
   BlackboxWindow *w = this;
-  while(w->client.transient_for) {
+  while(w->client.transient_for &&
+        w->client.transient_for != (BlackboxWindow *) ~0ul) {
     if(w->client.transient_for == this) {
       client.transient_for = (BlackboxWindow*) 0;
       break;
@@ -1428,7 +1429,8 @@ void BlackboxWindow::getTransientInfo(void) {
     w = w->client.transient_for;
   }
 
-  if (client.transient_for) {
+  if (client.transient_for &&
+      client.transient_for != (BlackboxWindow *) ~0ul) {
     // register ourselves with our new transient_for
     client.transient_for->client.transientList.push_back(this);
     flags.stuck = client.transient_for->flags.stuck;
@@ -3151,7 +3153,8 @@ void BlackboxWindow::doWindowSnapping(int &dx, int &dy) {
     const BlackboxWindowList& stack_list = w->getStackingList();
     BlackboxWindowList::const_iterator st_it, st_end = stack_list.end();
     for (st_it = stack_list.begin(); st_it != st_end; ++st_it)
-      rectlist.push_back( (*st_it)->frameRect() );
+      if (*st_it != this) // don't snap to ourself
+        rectlist.push_back( (*st_it)->frameRect() );
 
     // add the toolbar and the slit to the rect list.
     // (only if they are not hidden)
This page took 0.026234 seconds and 4 git commands to generate.