Lines Matching refs:tmp_win
45 static IconEntry *FindIconEntry(TwmWindow *tmp_win, IconRegion **irp);
109 PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y)
117 w = roundUp(iconWidth(tmp_win), ir->stepx);
118 h = roundUp(iconHeight(tmp_win), ir->stepy);
131 ie->twm_win = tmp_win;
132 *final_x = ie->x + (ie->w - iconWidth(tmp_win)) / 2;
133 *final_y = ie->y + (ie->h - iconHeight(tmp_win)) / 2;
143 FindIconEntry(TwmWindow *tmp_win, IconRegion **irp)
150 if (ie->twm_win == tmp_win) {
160 IconUp(TwmWindow *tmp_win)
173 if (tmp_win->wmhints && (tmp_win->wmhints->flags & IconPositionHint))
176 if (tmp_win->icon_moved) {
180 if (!XGetGeometry(dpy, tmp_win->icon_w, &wdummy, &defx, &defy,
198 PlaceIcon(tmp_win, defx, defy, &x, &y);
200 XMoveWindow(dpy, tmp_win->icon_w, x, y);
201 tmp_win->icon_moved = FALSE; /* since we've restored it */
236 IconDown(TwmWindow *tmp_win)
241 ie = FindIconEntry(tmp_win, &ir);
316 CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
327 FB(tmp_win->iconc.fore, tmp_win->iconc.back);
329 tmp_win->forced = FALSE;
330 tmp_win->icon_not_ours = FALSE;
340 icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
342 icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
343 &tmp_win->xclass);
357 (unsigned int *) &tmp_win->icon_width,
358 (unsigned int *) &tmp_win->icon_height, &udummy,
361 pm = XCreatePixmap(dpy, Scr->Root, (unsigned) tmp_win->icon_width,
362 (unsigned) tmp_win->icon_height,
367 0, 0, (unsigned) tmp_win->icon_width,
368 (unsigned) tmp_win->icon_height, 0, 0, 1);
370 tmp_win->forced = TRUE;
378 if (pm == None && tmp_win->wmhints &&
379 tmp_win->wmhints->flags & IconPixmapHint) {
381 XGetGeometry(dpy, tmp_win->wmhints->icon_pixmap,
383 (unsigned int *) &tmp_win->icon_width,
384 (unsigned int *) &tmp_win->icon_height, &udummy,
388 (unsigned) tmp_win->icon_width,
389 (unsigned) tmp_win->icon_height,
392 XCopyPlane(dpy, tmp_win->wmhints->icon_pixmap, pm, Scr->NormalGC,
393 0, 0, (unsigned) tmp_win->icon_width,
394 (unsigned) tmp_win->icon_height, 0, 0, 1);
404 icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
406 icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
407 &tmp_win->xclass);
421 (unsigned int *) &tmp_win->icon_width,
422 (unsigned int *) &tmp_win->icon_height, &udummy,
425 pm = XCreatePixmap(dpy, Scr->Root, (unsigned) tmp_win->icon_width,
426 (unsigned) tmp_win->icon_height,
431 0, 0, (unsigned) tmp_win->icon_width,
432 (unsigned) tmp_win->icon_height, 0, 0, 1);
439 tmp_win->icon_width = Scr->UnknownWidth;
440 tmp_win->icon_height = Scr->UnknownHeight;
442 pm = XCreatePixmap(dpy, Scr->Root, (unsigned) tmp_win->icon_width,
443 (unsigned) tmp_win->icon_height,
448 0, 0, (unsigned) tmp_win->icon_width,
449 (unsigned) tmp_win->icon_height, 0, 0, 1);
453 tmp_win->icon_height = 0;
454 tmp_win->icon_width = 0;
462 tmp_win->icon_w_width = MyFont_TextWidth(&Scr->IconFont,
463 tmp_win->icon_name,
464 (int) strlen(tmp_win->icon_name));
466 tmp_win->icon_w_width += 6;
467 if (tmp_win->icon_w_width < tmp_win->icon_width) {
468 tmp_win->icon_x = (tmp_win->icon_width - tmp_win->icon_w_width) / 2;
469 tmp_win->icon_x += 3;
470 tmp_win->icon_w_width = tmp_win->icon_width;
473 tmp_win->icon_x = 3;
475 tmp_win->icon_y = tmp_win->icon_height + Scr->IconFont.height;
476 tmp_win->icon_w_height = tmp_win->icon_height + Scr->IconFont.height + 4;
479 if (tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint) {
480 tmp_win->icon_w = tmp_win->wmhints->icon_window;
481 if (tmp_win->forced ||
482 XGetGeometry(dpy, tmp_win->icon_w, &wdummy, &dummy, &dummy,
483 (unsigned int *) &tmp_win->icon_w_width,
484 (unsigned int *) &tmp_win->icon_w_height, &udummy,
486 tmp_win->icon_w = None;
487 tmp_win->wmhints->flags &= ~IconWindowHint;
490 tmp_win->icon_not_ours = TRUE;
495 tmp_win->icon_w = None;
498 if (tmp_win->icon_w == None) {
499 tmp_win->icon_w = XCreateSimpleWindow(dpy, Scr->Root,
501 (unsigned) tmp_win->icon_w_width,
502 (unsigned) tmp_win->icon_w_height,
504 tmp_win->icon_border,
505 tmp_win->iconc.back);
509 XSelectInput(dpy, tmp_win->icon_w,
513 tmp_win->icon_bm_w = None;
515 (!(tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint))) {
520 if (tmp_wintmp_win->icon_width)
523 x = (tmp_win->icon_w_width - tmp_win->icon_width) / 2;
525 tmp_win->icon_bm_w = XCreateWindow(dpy, tmp_win->icon_w, x, y,
526 (unsigned int) tmp_win->icon_width,
527 (unsigned int) tmp_win->icon_height,
537 if (tmp_win->wmhints && tmp_win->wmhints->flags & IconPositionHint) {
538 final_x = tmp_win->wmhints->icon_x;
539 final_y = tmp_win->wmhints->icon_y;
542 PlaceIcon(tmp_win, def_x, def_y, &final_x, &final_y);
546 final_x = Scr->MyDisplayWidth - tmp_win->icon_w_width -
550 final_y = Scr->MyDisplayHeight - tmp_win->icon_height -
553 XMoveWindow(dpy, tmp_win->icon_w, final_x, final_y);
554 tmp_win->iconified = TRUE;
556 XMapSubwindows(dpy, tmp_win->icon_w);
557 XSaveContext(dpy, tmp_win->icon_w, TwmContext, (XPointer) tmp_win);
558 XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (XPointer) Scr);
559 XDefineCursor(dpy, tmp_win->icon_w, Scr->IconCursor);