60 |
int state; /* normal/minimized/maximized. */ |
int state; /* normal/minimized/maximized. */ |
61 |
unsigned int desktop; |
unsigned int desktop; |
62 |
struct timeval *position_timer; |
struct timeval *position_timer; |
63 |
|
|
64 |
|
BOOL outstanding_position; |
65 |
|
unsigned int outpos_serial; |
66 |
|
int outpos_xoffset, outpos_yoffset; |
67 |
|
int outpos_width, outpos_height; |
68 |
|
|
69 |
struct _seamless_window *next; |
struct _seamless_window *next; |
70 |
} seamless_window; |
} seamless_window; |
71 |
static seamless_window *g_seamless_windows = NULL; |
static seamless_window *g_seamless_windows = NULL; |
338 |
XWindowAttributes wa; |
XWindowAttributes wa; |
339 |
int x, y; |
int x, y; |
340 |
Window child_return; |
Window child_return; |
341 |
|
unsigned int serial; |
342 |
|
|
343 |
XGetWindowAttributes(g_display, sw->wnd, &wa); |
XGetWindowAttributes(g_display, sw->wnd, &wa); |
344 |
XTranslateCoordinates(g_display, sw->wnd, wa.root, |
XTranslateCoordinates(g_display, sw->wnd, wa.root, |
345 |
-wa.border_width, -wa.border_width, &x, &y, &child_return); |
-wa.border_width, -wa.border_width, &x, &y, &child_return); |
346 |
|
|
347 |
seamless_send_position(sw->id, x, y, wa.width, wa.height, 0); |
serial = seamless_send_position(sw->id, x, y, wa.width, wa.height, 0); |
348 |
sw->xoffset = x; |
|
349 |
sw->yoffset = y; |
sw->outstanding_position = True; |
350 |
sw->width = wa.width; |
sw->outpos_serial = serial; |
351 |
sw->height = wa.height; |
|
352 |
|
sw->outpos_xoffset = x; |
353 |
|
sw->outpos_yoffset = y; |
354 |
|
sw->outpos_width = wa.width; |
355 |
|
sw->outpos_height = wa.height; |
356 |
} |
} |
357 |
|
|
358 |
|
|
3304 |
sw->desktop = 0; |
sw->desktop = 0; |
3305 |
sw->position_timer = xmalloc(sizeof(struct timeval)); |
sw->position_timer = xmalloc(sizeof(struct timeval)); |
3306 |
timerclear(sw->position_timer); |
timerclear(sw->position_timer); |
3307 |
|
sw->outstanding_position = False; |
3308 |
sw->next = g_seamless_windows; |
sw->next = g_seamless_windows; |
3309 |
g_seamless_windows = sw; |
g_seamless_windows = sw; |
3310 |
} |
} |
3345 |
return; |
return; |
3346 |
} |
} |
3347 |
|
|
3348 |
|
/* We ignore server updates until it has handled our request. */ |
3349 |
|
if (sw->outstanding_position) |
3350 |
|
return; |
3351 |
|
|
3352 |
if (!width || !height) |
if (!width || !height) |
3353 |
/* X11 windows must be at least 1x1 */ |
/* X11 windows must be at least 1x1 */ |
3354 |
return; |
return; |
3500 |
void |
void |
3501 |
ui_seamless_ack(unsigned int serial) |
ui_seamless_ack(unsigned int serial) |
3502 |
{ |
{ |
3503 |
|
seamless_window *sw; |
3504 |
|
for (sw = g_seamless_windows; sw; sw = sw->next) |
3505 |
|
{ |
3506 |
|
if (sw->outpos_serial == serial) |
3507 |
|
{ |
3508 |
|
sw->xoffset = sw->outpos_xoffset; |
3509 |
|
sw->yoffset = sw->outpos_yoffset; |
3510 |
|
sw->width = sw->outpos_width; |
3511 |
|
sw->height = sw->outpos_height; |
3512 |
|
|
3513 |
|
sw->outstanding_position = False; |
3514 |
|
|
3515 |
|
break; |
3516 |
|
} |
3517 |
|
} |
3518 |
|
|
3519 |
|
return; |
3520 |
} |
} |