diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2010-11-06 23:49:27 +0800 |
---|---|---|
committer | Sam Spilsbury <smspillaz@gmail.com> | 2010-11-06 23:49:27 +0800 |
commit | 1b5e1a28ba5239fe7f6aab45f884ffbfaf54c416 (patch) | |
tree | 79709c667ab12930fa7aa944ebd576eb48f5e162 /src | |
parent | 5fa799e1419ab00028ce628875fec9e468edc3ea (diff) | |
download | unity-window-decorator-1b5e1a28ba5239fe7f6aab45f884ffbfaf54c416.tar.gz unity-window-decorator-1b5e1a28ba5239fe7f6aab45f884ffbfaf54c416.tar.bz2 |
Don't increase leave pendingMaps at a non-zero number once the window is mapped.
We used to assume that for every MapRequest event that we got for which we also sent an XMapWindow that we would get a MapNotify. According to the man XMapWindow this doesn't make any sense since trying calling XMapWindow on an already mapped window for which we have SubstructureRedirectMask set results in a NoOp anyways (so we'll only ever get one MapNotify and multiple MapRequests). This fixes a case where no input focus would be set on closing windows with multiple remaining pendingMaps since we don't move the input focus if this is the case
Diffstat (limited to 'src')
-rw-r--r-- | src/window.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/window.cpp b/src/window.cpp index 6f58335..4c6a0ab 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -803,7 +803,7 @@ PrivateWindow::updateFrameWindow () { int x, y, width, height; int bw = serverGeometry.border () * 2; - + x = serverGeometry.x (); y = serverGeometry.y (); width = serverGeometry.width () + bw; @@ -1279,7 +1279,7 @@ CompWindow::map () if (!isViewable ()) { if (priv->pendingMaps > 0) - priv->pendingMaps--; + priv->pendingMaps = 0; priv->mapNum = screen->priv->mapNum++; @@ -2836,7 +2836,7 @@ CompWindow::moveResize (XWindowChanges *xwc, bool placed = false; xwcm &= (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); - + if (xwcm & (CWX | CWY)) if (priv->sizeHints.flags & (USPosition | PPosition)) placed = true; @@ -2882,7 +2882,7 @@ CompWindow::moveResize (XWindowChanges *xwc, min = screen->workArea ().y () + priv->input.top; max = screen->workArea ().bottom (); - + if (priv->state & CompWindowStateStickyMask && (xwc->y < min || xwc->y > max)) { @@ -2893,7 +2893,7 @@ CompWindow::moveResize (XWindowChanges *xwc, min -= screen->vp ().y () * screen->height (); max += (screen->vpSize ().height () - screen->vp ().y () - 1) * screen->height (); - + if (xwc->y < min) xwc->y = min; else if (xwc->y > max) @@ -2907,7 +2907,7 @@ CompWindow::moveResize (XWindowChanges *xwc, min = screen->workArea ().x () + priv->input.left; max = screen->workArea ().right (); - + if (priv->state & CompWindowStateStickyMask && (xwc->x < min || xwc->x > max)) { @@ -3106,7 +3106,7 @@ PrivateScreen::focusTopMostWindow () for (; it != windows.rend (); it++) { CompWindow *w = *it; - + if (w->type () & CompWindowTypeDockMask) continue; @@ -3134,12 +3134,12 @@ CompWindow::lower () { XWindowChanges xwc; int mask; - + mask = priv->addWindowStackChanges (&xwc, PrivateWindow::findLowestSiblingBelow (this)); if (mask) configureXWindow (mask, &xwc); - + /* when lowering a window, focus the topmost window if the click-to-focus option is on */ if ((screen->getOption ("click_to_focus")->value ().b ())) @@ -3698,7 +3698,7 @@ void CompWindow::minimize () { WRAPABLE_HND_FUNC (13, minimize); - + if (!priv->managed) return; @@ -4902,7 +4902,7 @@ PrivateWindow::updateStartupId () { if (strcmp (startupId, oldId) == 0) newId = false; - + free (oldId); } @@ -5439,7 +5439,7 @@ CompWindow::updateFrameRegion () x = priv->geometry.x () - priv->input.left; y = priv->geometry.y () - priv->input.top; - + XShapeCombineRegion (screen->dpy (), priv->frame, ShapeBounding, -x, -y, priv->frameRegion.united (priv->region).handle (), @@ -5492,7 +5492,7 @@ CompWindow::updateFrameRegion (CompRegion& region) bool PrivateWindow::reparent () -{ +{ XSetWindowAttributes attr; XWindowAttributes wa; XWindowChanges xwc; @@ -5589,7 +5589,7 @@ PrivateWindow::reparent () ExposureMask); XUngrabServer (dpy); - + XMoveResizeWindow (dpy, frame, sg.x (), sg.y (), sg.width (), sg.height ()); /* Try to use a relative window as a stacking anchor point */ @@ -5608,7 +5608,7 @@ PrivateWindow::reparent () void PrivateWindow::unreparent () -{ +{ Display *dpy = screen->dpy (); XEvent e; bool alive = true; @@ -5634,13 +5634,13 @@ PrivateWindow::unreparent () XSelectInput (dpy, id, NoEventMask); XSelectInput (dpy, screen->root (), NoEventMask); XReparentWindow (dpy, id, screen->root (), 0, 0); - + xwc.stack_mode = Below; xwc.sibling = frame; XConfigureWindow (dpy, id, CWSibling | CWStackMode, &xwc); XUnmapWindow (dpy, frame); - + XSelectInput (dpy, id, PropertyChangeMask | EnterWindowMask | FocusChangeMask); @@ -5657,9 +5657,9 @@ PrivateWindow::unreparent () ButtonReleaseMask | FocusChangeMask | ExposureMask); - + XUngrabServer (dpy); - + XMoveWindow (dpy, id, serverGeometry.x (), serverGeometry.y ()); } |