static Bool zoomTerminatePan(CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int nOption) { CompScreen *s; Window xid; xid = getIntOptionNamed(option, nOption, "root", 0); for (s = d->screens; s; s = s->next) { ZOOM_SCREEN(s); if (xid && s->root != xid) continue; if (zs->panGrabIndex) { removeScreenGrab(s, zs->panGrabIndex, NULL); zs->panGrabIndex = 0; zoomInEvent(s); } return TRUE; } action->state &= ~(CompActionStateTermKey | CompActionStateTermButton); return FALSE; }
static void tileDonePaintScreen (CompScreen *s) { TILE_SCREEN (s); if (ts->grabIndex) { if (ts->msResizing > tileGetAnimationDuration (s->display)) { CompWindow *w; for (w = s->windows; w; w = w->next) { TILE_WINDOW (w); tw->animationType = NoAnimation; } ts->msResizing = 0; removeScreenGrab (s, ts->grabIndex, NULL); ts->grabIndex = 0; } damageScreen (s); } UNWRAP (ts, s, donePaintScreen); (*s->donePaintScreen) (s); WRAP (ts, s, donePaintScreen, tileDonePaintScreen); }
static Bool moveTerminate(CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int nOption) { MOVE_DISPLAY (d); if (md->w) { MOVE_SCREEN (md->w->screen); (md->w->screen->windowUngrabNotify)(md->w); if (ms->grabIndex) { removeScreenGrab (md->w->screen, ms->grabIndex, NULL); ms->grabIndex = 0; } if (md->moveOpacity != OPAQUE) /* let the window fade in */ addWindowDamage (md->w); else md->w = 0; } return FALSE; }
static Bool ringTerminate (CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int nOption) { CompScreen *s; Window xid; xid = getIntOptionNamed (option, nOption, "root", 0); for (s = d->screens; s; s = s->next) { RING_SCREEN (s); if (xid && s->root != xid) continue; if (rs->grabIndex) { removeScreenGrab (s, rs->grabIndex, 0); rs->grabIndex = 0; } if (rs->state != RingStateNone) { CompWindow *w; for (w = s->windows; w; w = w->next) { RING_WINDOW (w); if (rw->slot) { free (rw->slot); rw->slot = NULL; rw->adjust = TRUE; } } rs->moreAdjust = TRUE; rs->state = RingStateIn; damageScreen (s); if (!(state & CompActionStateCancel) && rs->selectedWindow && !rs->selectedWindow->destroyed) { sendWindowActivationRequest (s, rs->selectedWindow->id); } } } if (action) action->state &= ~(CompActionStateTermKey | CompActionStateTermButton | CompActionStateTermEdge); return FALSE; }
static Bool cloneTerminate(CompDisplay * d, CompAction * action, CompActionState state, CompOption * option, int nOption) { CompScreen *s; Window xid; xid = getIntOptionNamed(option, nOption, "root", 0); for (s = d->screens; s; s = s->next) { CLONE_SCREEN(s); if (xid && s->root != xid) continue; if (cs->grabIndex) { int x, y; removeScreenGrab(s, cs->grabIndex, NULL); cs->grabIndex = 0; x = getIntOptionNamed(option, nOption, "x", 0); y = getIntOptionNamed(option, nOption, "y", 0); cs->dst = outputDeviceForPoint(s, x, y); damageScreen(s); } } action->state &= ~(CompActionStateTermKey | CompActionStateTermButton); return FALSE; }
static Bool shotTerminate (BananaArgument *arg, int nArg) { CompScreen *s; Window xid; BananaValue *root = getArgNamed ("root", arg, nArg); if (root != NULL) xid = root->i; else xid = 0; for (s = display.screens; s; s = s->next) { SHOT_SCREEN (s); if (xid && s->root != xid) continue; if (ss->grabIndex) { removeScreenGrab (s, ss->grabIndex, NULL); ss->grabIndex = 0; BananaValue *cancel = getArgNamed ("cancel", arg, nArg); if (cancel != NULL && cancel->b) ss->grab = FALSE; if (ss->x1 != ss->x2 && ss->y1 != ss->y2) { REGION reg; reg.rects = ®.extents; reg.numRects = 1; reg.extents.x1 = MIN (ss->x1, ss->x2) - 1; reg.extents.y1 = MIN (ss->y1, ss->y2) - 1; reg.extents.x2 = MAX (ss->x1, ss->x2) + 1; reg.extents.y2 = MAX (ss->y1, ss->y2) + 1; damageScreenRegion (s, ®); } } } return FALSE; }
static Bool zoomOut(CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int nOption) { CompScreen *s; Window xid; xid = getIntOptionNamed(option, nOption, "root", 0); s = findScreenAtDisplay(d, xid); if (s) { int output; ZOOM_SCREEN(s); output = outputDeviceForPoint(s, pointerX, pointerY); zoomGetCurrentZoom(s, output, &zs->last[output]); zs->current[output].x1 = s->outputDev[output].region.extents.x1; zs->current[output].y1 = s->outputDev[output].region.extents.y1; zs->current[output].x2 = s->outputDev[output].region.extents.x2; zs->current[output].y2 = s->outputDev[output].region.extents.y2; zs->zoomOutput = output; zs->scale = 0.0f; zs->adjust = TRUE; zs->grab = FALSE; if (zs->grabIndex) { removeScreenGrab(s, zs->grabIndex, NULL); zs->grabIndex = 0; } damageScreen(s); return TRUE; } return FALSE; }
static Bool waterTerminate(CompDisplay * d, CompAction * action, CompActionState state, CompOption * option, int nOption) { CompScreen *s; for (s = d->screens; s; s = s->next) { WATER_SCREEN(s); if (ws->grabIndex) { removeScreenGrab(s, ws->grabIndex, 0); ws->grabIndex = 0; } } return FALSE; }
static void FWHandleButtonReleaseEvent (CompWindow *w) { FREEWINS_WINDOW (w); FREEWINS_SCREEN (w->screen); FREEWINS_DISPLAY (w->screen->display); if (fww->grab == grabMove || fww->grab == grabResize) { removeScreenGrab (w->screen, fws->grabIndex, NULL); (w->screen->windowUngrabNotify) (w); moveInputFocusToWindow (w); FWAdjustIPW (w); fws->grabIndex = 0; fwd->grabWindow = NULL; fww->grab = grabNone; } }
/* * After painting clean up */ static void smartputDonePaintScreen (CompScreen *s) { CompWindow *w = NULL; SMARTPUT_SCREEN (s); if(sps->lastWindow != None) { w = findWindowAtScreen (s,sps->lastWindow); } if (sps->animation && sps->grabIndex) damageScreen (s); else { if(w) { SMARTPUT_WINDOW (w); if(spw->mask && spw->xwc) { if (w->mapNum && (spw->mask & (CWWidth | CWHeight))) { sendSyncRequest (w); configureXWindow (w, spw->mask, spw->xwc); } spw->mask = 0; free(spw->xwc); spw->xwc = NULL; } } if (sps->grabIndex) { /* release the screen grab */ removeScreenGrab (s, sps->grabIndex, NULL); sps->grabIndex = 0; } } UNWRAP (sps, s, donePaintScreen); (*s->donePaintScreen) (s); WRAP (sps, s, donePaintScreen, smartputDonePaintScreen); }
/* * groupGrabScreen * */ void groupGrabScreen (CompScreen *s, GroupScreenGrabState newState) { GROUP_SCREEN (s); if ((gs->grabState != newState) && gs->grabIndex) { removeScreenGrab (s, gs->grabIndex, NULL); gs->grabIndex = 0; } if (newState == ScreenGrabSelect) { gs->grabIndex = pushScreenGrab (s, None, "group"); } else if (newState == ScreenGrabTabDrag) { gs->grabIndex = pushScreenGrab (s, None, "group-drag"); } gs->grabState = newState; }
/* * Buggy */ static Bool smartputAllTrigger (CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int nOption) { Window xid; CompWindow *w; CompScreen *s; int grabIndex = 0; xid = getIntOptionNamed (option, nOption, "window", 0); w = findWindowAtDisplay (d, xid); if (w) { s = w->screen; if(otherScreenGrabExist (s, "smartput", 0)) return FALSE; /* * Grab the screen */ grabIndex = pushScreenGrab (s, s->invisibleCursor, "smartput"); if(!grabIndex) return FALSE; CompWindow *window; for (window = s->windows; window; window = window->next) { if(!smartputSameViewport (window,w) ) continue; int width, height; unsigned int mask; XWindowChanges xwc; mask = smartputComputeResize (window, &xwc); if (mask) { if (constrainNewWindowSize (window, xwc.width, xwc.height, &width, &height)) { mask |= CWWidth | CWHeight; xwc.width = width; xwc.height = height; } if (window->mapNum && (mask & (CWWidth | CWHeight))) sendSyncRequest (window); configureXWindow (window, mask, &xwc); } } } if(grabIndex) removeScreenGrab (s,grabIndex, NULL); return TRUE; }