Lines Matching defs:sw

200                 seamless_window *sw; \
203 for (sw = g_seamless_windows; sw; sw = sw->next) { \
204 rect.x = g_clip_rectangle.x - sw->xoffset; \
205 rect.y = g_clip_rectangle.y - sw->yoffset; \
237 ON_ALL_SEAMLESS_WINDOWS(XFillRectangle, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy)); \
252 ON_ALL_SEAMLESS_WINDOWS(seamless_XFillPolygon, (sw->wnd, p, np, sw->xoffset, sw->yoffset)); \
261 ON_ALL_SEAMLESS_WINDOWS(XDrawArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \
267 ON_ALL_SEAMLESS_WINDOWS(XFillArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \
308 seamless_window *sw;
309 for (sw = g_seamless_windows; sw; sw = sw->next)
311 if (sw->id == id)
312 return sw;
321 seamless_window *sw;
322 for (sw = g_seamless_windows; sw; sw = sw->next)
324 if (sw->wnd == wnd)
325 return sw;
334 seamless_window *sw, **prevnext = &g_seamless_windows;
335 for (sw = g_seamless_windows; sw; sw = sw->next)
337 if (sw == win)
339 *prevnext = sw->next;
340 sw->group->refcnt--;
341 if (sw->group->refcnt == 0)
343 XDestroyWindow(g_display, sw->group->wnd);
344 xfree(sw->group);
346 xfree(sw->position_timer);
347 xfree(sw);
350 prevnext = &sw->next;
360 seamless_window *sw;
361 for (sw = g_seamless_windows; sw; sw = sw->next)
363 if (sw->wnd == wnd)
365 if (sw->desktop != desktop)
367 ewmh_move_to_desktop(sw->wnd, desktop);
368 sw->desktop = desktop;
376 sw_update_position(seamless_window * sw)
383 XGetWindowAttributes(g_display, sw->wnd, &wa);
384 XTranslateCoordinates(g_display, sw->wnd, wa.root,
387 serial = seamless_send_position(sw->id, x, y, wa.width, wa.height, 0);
389 sw->outstanding_position = True;
390 sw->outpos_serial = serial;
392 sw->outpos_xoffset = x;
393 sw->outpos_yoffset = y;
394 sw->outpos_width = wa.width;
395 sw->outpos_height = wa.height;
403 seamless_window *sw;
407 for (sw = g_seamless_windows; sw; sw = sw->next)
409 if (timerisset(sw->position_timer) && timercmp(sw->position_timer, &now, <))
411 timerclear(sw->position_timer);
412 sw_update_position(sw);
419 sw_restack_window(seamless_window * sw, unsigned long behind)
426 if (sw_above->behind == sw->id)
431 sw_above->behind = sw->behind;
441 sw_above->behind = sw->id;
443 sw->behind = behind;
448 sw_handle_restack(seamless_window * sw)
463 while (children[i] != sw->wnd)
477 if (!sw_below && !sw->behind)
479 if (sw_below && (sw_below->id == sw->behind))
484 seamless_send_zchange(sw->id, sw_below->id, 0);
485 sw_restack_window(sw, sw_below->id);
489 seamless_send_zchange(sw->id, 0, 0);
490 sw_restack_window(sw, 0);
501 seamless_window *sw;
505 for (sw = g_seamless_windows; sw; sw = sw->next)
507 if (sw->group->id == id)
508 return sw->group;
1818 seamless_window *sw;
1822 sw = sw_get_window_by_id(id);
1823 if (!sw)
1827 sts = XFetchName(g_display, sw->wnd, &name);
2332 seamless_window *sw;
2368 sw = sw_get_window_by_wnd(xevent.xclient.window);
2369 if (!sw)
2373 seamless_send_destroy(sw->id);
2473 sw = sw_get_window_by_wnd(xevent.xfocus.window);
2474 if (!sw)
2490 if (sw->id != g_seamless_focused)
2494 seamless_send_focus(sw->id, 0);
2495 g_seamless_focused = sw->id;
2549 sw = sw_get_window_by_wnd(xevent.xexpose.window);
2550 if (!sw)
2554 xevent.xexpose.x + sw->xoffset,
2555 xevent.xexpose.y + sw->yoffset,
2601 sw = sw_get_window_by_wnd(xevent.xproperty.window);
2602 if (!sw)
2608 sw->state = ewmh_get_window_state(sw->wnd);
2609 seamless_send_state(sw->id, sw->state, 0);
2615 sw->desktop = ewmh_get_window_desktop(sw->wnd);
2616 sw_all_to_desktop(sw->wnd, sw->desktop);
2646 sw = sw_get_window_by_wnd(xevent.xconfigure.window);
2647 if (!sw)
2650 gettimeofday(sw->position_timer, NULL);
2651 if (sw->position_timer->tv_usec + SEAMLESSRDP_POSITION_TIMER >=
2654 sw->position_timer->tv_usec +=
2656 sw->position_timer->tv_sec += 1;
2660 sw->position_timer->tv_usec += SEAMLESSRDP_POSITION_TIMER;
2663 sw_handle_restack(sw);
2818 (g_display, g_backstore, sw->wnd, g_gc, x, y, cx, cy,
2819 x - sw->xoffset, y - sw->yoffset));
2825 (g_display, g_wnd, sw->wnd, g_gc, x, y, cx, cy,
2826 x - sw->xoffset, y - sw->yoffset));
3008 ON_ALL_SEAMLESS_WINDOWS(XDefineCursor, (g_display, sw->wnd, g_current_cursor));
3152 ON_ALL_SEAMLESS_WINDOWS(XSetWindowColormap, (g_display, sw->wnd, (Colormap) map));
3282 (g_display, g_ownbackstore ? g_backstore : g_wnd, sw->wnd, g_gc,
3283 x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
3305 sw->wnd, g_gc, x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
3318 (g_display, (Pixmap) src, sw->wnd, g_gc,
3319 srcx, srcy, cx, cy, x - sw->xoffset, y - sw->yoffset));
3366 ON_ALL_SEAMLESS_WINDOWS(XDrawLine, (g_display, sw->wnd, g_gc,
3367 startx - sw->xoffset, starty - sw->yoffset,
3368 endx - sw->xoffset, endy - sw->yoffset));
3495 (sw->wnd, (XPoint *) points, npoints, sw->xoffset, sw->yoffset));
3748 (g_display, g_backstore, sw->wnd, g_gc,
3751 boxx - sw->xoffset, boxy - sw->yoffset));
3758 (g_display, g_backstore, sw->wnd, g_gc,
3760 clipcx, clipcy, clipx - sw->xoffset,
3761 clipy - sw->yoffset));
3811 (g_display, g_backstore, sw->wnd, g_gc,
3812 x, y, cx, cy, x - sw->xoffset, y - sw->yoffset));
3818 (g_display, g_wnd, sw->wnd, g_gc, x, y, cx, cy,
3819 x - sw->xoffset, y - sw->yoffset));
3953 seamless_window *sw, *sw_parent;
3959 sw = sw_get_window_by_id(id);
3960 if (sw)
4034 sw = xmalloc(sizeof(seamless_window));
4036 memset(sw, 0, sizeof(seamless_window));
4038 sw->wnd = wnd;
4039 sw->id = id;
4040 sw->group = sw_find_group(group, False);
4041 sw->group->refcnt++;
4042 sw->state = SEAMLESSRDP_NOTYETMAPPED;
4043 sw->desktop = 0;
4044 sw->position_timer = xmalloc(sizeof(struct timeval));
4045 timerclear(sw->position_timer);
4047 sw->outstanding_position = False;
4048 sw->outpos_serial = 0;
4049 sw->outpos_xoffset = sw->outpos_yoffset = 0;
4050 sw->outpos_width = sw->outpos_height = 0;
4052 sw->next = g_seamless_windows;
4053 g_seamless_windows = sw;
4060 wmhints->window_group = sw->group->wnd;
4061 XSetWMHints(g_display, sw->wnd, wmhints);
4070 seamless_window *sw;
4075 sw = sw_get_window_by_id(id);
4076 if (!sw)
4082 XDestroyWindow(g_display, sw->wnd);
4083 sw_remove_window(sw);
4090 seamless_window *sw, *sw_next;
4095 for (sw = g_seamless_windows; sw; sw = sw_next)
4097 sw_next = sw->next;
4099 if (sw->group->id == id)
4101 XDestroyWindow(g_display, sw->wnd);
4102 sw_remove_window(sw);
4112 seamless_window *sw;
4117 sw = sw_get_window_by_id(id);
4118 if (!sw)
4126 if (sw->icon_size)
4135 sw->icon_size = width * height * 4;
4136 if (sw->icon_size > 32 * 32 * 4)
4138 warning("ui_seamless_seticon: Icon too large (%d bytes)\n", sw->icon_size);
4139 sw->icon_size = 0;
4143 sw->icon_offset = 0;
4147 if (!sw->icon_size)
4151 if (chunk_len > (sw->icon_size - sw->icon_offset))
4154 chunk_len, sw->icon_size - sw->icon_offset);
4155 sw->icon_size = 0;
4159 memcpy(sw->icon_buffer + sw->icon_offset, data, chunk_len);
4160 sw->icon_offset += chunk_len;
4162 if (sw->icon_offset == sw->icon_size)
4164 ewmh_set_icon(sw->wnd, width, height, sw->icon_buffer);
4165 sw->icon_size = 0;
4173 seamless_window *sw;
4178 sw = sw_get_window_by_id(id);
4179 if (!sw)
4191 ewmh_del_icon(sw->wnd, width, height);
4198 seamless_window *sw;
4203 sw = sw_get_window_by_id(id);
4204 if (!sw)
4211 if (sw->outstanding_position)
4220 switch (sw->state)
4224 sw_update_position(sw);
4228 sw->xoffset = x;
4229 sw->yoffset = y;
4230 sw->width = width;
4231 sw->height = height;
4234 XMoveResizeWindow(g_display, sw->wnd, sw->xoffset, sw->yoffset, sw->width, sw->height);
4241 seamless_window *sw;
4249 sw = sw_get_window_by_id(id);
4250 if (!sw)
4273 if (ewmh_is_window_above(sw->wnd))
4301 XReconfigureWMWindow(g_display, sw->wnd, DefaultScreen(g_display), value_mask, &values);
4302 sw_wait_configurenotify(sw->wnd, restack_serial);
4304 sw_restack_window(sw, behind);
4309 ewmh_set_window_above(sw->wnd);
4317 seamless_window *sw;
4322 sw = sw_get_window_by_id(id);
4323 if (!sw)
4330 XStoreName(g_display, sw->wnd, title);
4331 ewmh_set_wm_name(sw->wnd, title);
4338 seamless_window *sw;
4343 sw = sw_get_window_by_id(id);
4344 if (!sw)
4354 ewmh_change_state(sw->wnd, state);
4355 XMapWindow(g_display, sw->wnd);
4363 if (sw->state == SEAMLESSRDP_NOTYETMAPPED)
4366 hints = XGetWMHints(g_display, sw->wnd);
4371 XSetWMHints(g_display, sw->wnd, hints);
4374 XMapWindow(g_display, sw->wnd);
4377 XIconifyWindow(g_display, sw->wnd, DefaultScreen(g_display));
4384 sw->state = state;
4406 seamless_window *sw;
4407 for (sw = g_seamless_windows; sw; sw = sw->next)
4409 if (sw->outstanding_position && (sw->outpos_serial == serial))
4411 sw->xoffset = sw->outpos_xoffset;
4412 sw->yoffset = sw->outpos_yoffset;
4413 sw->width = sw->outpos_width;
4414 sw->height = sw->outpos_height;
4415 sw->outstanding_position = False;
4421 sw->wnd, g_gc,
4422 sw->xoffset, sw->yoffset, sw->width, sw->height, 0, 0);