Lines Matching refs:vs

42 static void CreateWorkSpaceManagerWindow(VirtualScreen *vs);
43 static void ResizeWorkSpaceManager(VirtualScreen *vs, TwmWindow *win);
44 static void PaintWorkSpaceManagerBorder(VirtualScreen *vs);
84 * vs about which workspace is active, if available (from restarting
111 // Setup each vs
112 for(VirtualScreen *vs = scr->vScreenList; vs != NULL; vs = vs->next) {
125 // If we have a current ws for this vs, assign it in, and
126 // loop onward to the ws for the next vs. For any we don't
140 vs->wsw = wsw;
179 for(VirtualScreen *vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
180 CreateWorkSpaceManagerWindow(vs);
196 for(VirtualScreen *vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
197 WorkSpaceWindow *wsw = vs->wsw; // Our WSW
216 XSetWindowBackground(dpy, vs->window, ws2->backcp.back);
219 XSetWindowBackgroundPixmap(dpy, vs->window, ws2->image->pixmap);
221 XClearWindow(dpy, vs->window);
254 CreateWorkSpaceManagerWindow(VirtualScreen *vs)
347 y += vs->h - height;
357 x += vs->w - width;
365 x = (vs->w - width) / 2;
376 x = (vs->w - width) / 2;
377 y = vs->h - height;
383 vs->wsw->width = 1;
384 vs->wsw->height = 1;
387 vs->wsw->bswl = calloc(count, sizeof(ButtonSubwindow *));
388 vs->wsw->mswl = calloc(count, sizeof(MapSubwindow *));
391 vs->wsw->w = XCreateSimpleWindow(dpy, Scr->Root, x, y, width, height, 0,
408 vs->wsw->bswl[ws->number] = bsw
410 vs->wsw->mswl[ws->number] = msw = calloc(1, sizeof(MapSubwindow));
416 bsw->w = XCreateSimpleWindow(dpy, vs->wsw->w,
420 msw->w = XCreateSimpleWindow(dpy, vs->wsw->w,
425 if(vs->wsw->state == WMS_buttons) {
485 XmbSetWMProperties(dpy, vs->wsw->w, name, icon_name, NULL, 0,
491 tmp_win = AddWindow(vs->wsw->w, AWT_WORKSPACE_MANAGER,
492 Scr->iconmgr, vs);
500 vs->wsw->twm_win = tmp_win;
504 ResizeWorkSpaceManager(vs, tmp_win);
516 XChangeWindowAttributes(dpy, vs->wsw->w, attrmask, &attr);
518 XGetWindowAttributes(dpy, vs->wsw->w, &wattr);
521 XSelectInput(dpy, vs->wsw->w, attrmask);
545 Window buttonw = vs->wsw->bswl[ws->number]->w;
546 Window mapsubw = vs->wsw->mswl[ws->number]->w;
578 * Don't have to PaintWorkSpaceManager(vs) here, because
589 ResizeWorkSpaceManager(VirtualScreen *vs, TwmWindow *win)
604 const float wf = (float)(wwidth - 2) / (float) vs->w;
605 const float hf = (float)(wheight - 2) / (float) vs->h;
608 if(neww == vs->wsw->width && newh == vs->wsw->height) {
613 vs->wsw->bwidth = bwidth;
614 vs->wsw->bheight = bheight;
615 vs->wsw->width = neww;
616 vs->wsw->height = newh;
617 vs->wsw->wwidth = wwidth;
618 vs->wsw->wheight = wheight;
624 MapSubwindow *msw = vs->wsw->mswl[ws->number];
625 ButtonSubwindow *bsw = vs->wsw->bswl[ws->number];
661 PaintWorkSpaceManager(vs);
678 PaintWorkSpaceManager(VirtualScreen *vs)
685 PaintWorkSpaceManagerBorder(vs);
688 Window buttonw = vs->wsw->bswl[ws->number]->w;
689 ButtonState bs = (ws == vs->wsw->currentwspc) ? on : off;
691 PaintWsButton(WSPCWINDOW, vs, buttonw, ws->label, ws->cp, bs);
700 PaintWorkSpaceManagerBorder(VirtualScreen *vs)
704 width = vs->wsw->width;
705 height = vs->wsw->height;
706 Draw3DBorder(vs->wsw->w, 0, 0, width, height, 2, Scr->workSpaceMgr.cp, off,
716 WMgrHandleExposeEvent(VirtualScreen *vs, XEvent *event)
718 if(vs->wsw->state == WMS_buttons) {
724 buttonw = vs->wsw->bswl[ws->number]->w;
732 PaintWorkSpaceManagerBorder(vs);
735 ButtonState bs = (ws == vs->wsw->currentwspc) ? on : off;
736 PaintWsButton(WSPCWINDOW, vs, buttonw, ws->label, ws->cp, bs);
752 WMapRedrawName(vs, wl);
763 WMgrToggleState(VirtualScreen *vs)
765 if(vs->wsw->state == WMS_buttons) {
766 WMgrSetMapState(vs);
769 WMgrSetButtonsState(vs);
774 WMgrSetMapState(VirtualScreen *vs)
778 if(vs->wsw->state == WMS_map) {
782 XUnmapWindow(dpy, vs->wsw->bswl [ws->number]->w);
783 XMapWindow(dpy, vs->wsw->mswl [ws->number]->w);
785 vs->wsw->state = WMS_map;
790 WMgrSetButtonsState(VirtualScreen *vs)
794 if(vs->wsw->state == WMS_buttons) {
798 XUnmapWindow(dpy, vs->wsw->mswl [ws->number]->w);
799 XMapWindow(dpy, vs->wsw->bswl [ws->number]->w);
801 vs->wsw->state = WMS_buttons;
822 WMgrHandleKeyReleaseEvent(VirtualScreen *vs, XEvent *event)
833 WMgrToggleState(vs);
840 WMgrHandleKeyPressEvent(VirtualScreen *vs, XEvent *event)
853 WMgrToggleState(vs);
860 if(vs->wsw->state == WMS_map) {
869 if(vs->wsw->bswl[ws->number]->w == event->xkey.subwindow) {
932 ButtonState bs = (ws == vs->wsw->currentwspc) ? on : off;
934 PaintWsButton(WSPCWINDOW, vs, vs->wsw->bswl[ws->number]->w, ws->label,
949 WMgrHandleButtonEvent(VirtualScreen *vs, XEvent *event)
959 const WorkSpaceWindow *mw = vs->wsw;
970 if(vs->wsw->state == WMS_buttons) {
973 if(vs->wsw->bswl[ws->number]->w == parent) {
974 GotoWorkSpace(vs, ws);
991 if(vs->wsw->mswl[oldws->number]->w == parent) {
1005 GotoWorkSpace(vs, oldws);
1052 const unsigned long scrsz = vs->w * vs->h;
1111 XTranslateCoordinates(dpy, vs->wsw->mswl[oldws->number]->w,
1139 DisplayWin(vs, win);
1179 const float wf = (float)(mw->wwidth - 1) / (float) vs->w;
1180 const float hf = (float)(mw->wheight - 1) / (float) vs->h;
1268 bool startincurrent = (oldws == vs->wsw->currentwspc);
1274 msw = vs->wsw->mswl [cws->number];
1297 msw = vs->wsw->mswl[cws->number];
1329 newX = msw->x + XW + Scr->BorderLeft * mw->wwidth / vs->w;
1331 if(((winX + width) > vs->w - Scr->BorderRight) &&
1333 ((winX + width) < vs->w - Scr->BorderRight + Scr->MoveOffResistance))) {
1334 winX = vs->w - Scr->BorderRight - width;
1336 (1 - Scr->BorderRight / (double) vs->w) - wl->width + XW - 2;
1341 newY = msw->y + YW + Scr->BorderTop * mw->height / vs->h;
1343 if(((winY + height) > vs->h - Scr->BorderBottom) &&
1345 ((winY + height) < vs->h - Scr->BorderBottom + Scr->MoveOffResistance))) {
1346 winY = vs->h - Scr->BorderBottom - height;
1348 * (1 - Scr->BorderBottom / (double) vs->h)
1375 if(cws == vs->wsw->currentwspc) {
1382 DisplayWin(vs, win);
1420 if(!OCCUPY(win, vs->wsw->currentwspc) ||
1423 Vanish(vs, win);
1472 if(Scr->OpaqueMove && !OCCUPY(win, vs->wsw->currentwspc)) {
1473 Vanish(vs, win);
1477 WMapRedrawName(vs, wl);
1518 GotoWorkSpace(vs, oldws);
1563 WMgrToggleState(vs);
1572 MapSubwindow *msw = vs->wsw->mswl[newws->number];
1601 if(newws == vs->wsw->currentwspc) {
1626 if(newws == vs->wsw->currentwspc) {
1665 VirtualScreen *vs;
1669 for(vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
1671 for(wl = vs->wsw->mswl[ws->number]->wl; wl != NULL; wl = wl->next) {
1686 WMapRedrawName(vs, wl);
1721 if(!win->vs) {
1737 VirtualScreen *vs;
1741 if(!win->vs) {
1745 for(vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
1747 for(wl = vs->wsw->mswl[ws->number]->wl; wl != NULL; wl = wl->next) {
1764 VirtualScreen *vs;
1767 if(win->isiconmgr || !win->vs) {
1776 ResizeWorkSpaceManager(win->vs, win);
1791 for(vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
1792 WorkSpaceWindow *wsw = vs->wsw;
1796 float wf = (float)(wsw->wwidth - 2) / (float) vs->w;
1797 float hf = (float)(wsw->wheight - 2) / (float) vs->h;
1903 for(VirtualScreen *vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
1905 const MapSubwindow *msw = vs->wsw->mswl[ws->number];
1975 VirtualScreen *vs;
1979 for(vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
1981 for(wl = vs->wsw->mswl[ws->number]->wl; wl != NULL; wl = wl->next) {
1983 WMapRedrawName(vs, wl);
1997 WMapRedrawName(VirtualScreen *vs, WinList *wl)
2001 if(Scr->ReverseCurrentWorkspace && wl->wlist == vs->wsw->currentwspc) {
2143 for(VirtualScreen *vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
2146 const float wf = (float)(vs->wsw->wwidth - 2) / (float) vs->w;
2147 const float hf = (float)(vs->wsw->wheight - 2) / (float) vs->h;
2148 MapSubwindow *msw = vs->wsw->mswl[ws->number];
2197 XSaveContext(dpy, wl->w, TwmContext, (XPointer) vs->wsw->twm_win);
2261 VirtualScreen *vs;
2263 for(vs = Scr->vScreenList; vs != NULL; vs = vs->next) {
2264 WinList **prev = &vs->wsw->mswl[ws->number]->wl;