277 |
screen = DefaultScreenOfDisplay(display); |
screen = DefaultScreenOfDisplay(display); |
278 |
|
|
279 |
wnd = XCreateWindow(display, RootWindowOfScreen(screen), xpos, |
wnd = XCreateWindow(display, RootWindowOfScreen(screen), xpos, |
280 |
ypos, width, height, 0, CopyFromParent, |
ypos, width, height, 0, CopyFromParent, |
281 |
InputOutput, CopyFromParent, valuemask, &attribs); |
InputOutput, CopyFromParent, valuemask, &attribs); |
282 |
|
|
283 |
|
|
284 |
XStoreName(display, wnd, title); |
XStoreName(display, wnd, title); |
311 |
XMapWindow(display, wnd); |
XMapWindow(display, wnd); |
312 |
|
|
313 |
/* Wait for VisibilityNotify Event */ |
/* Wait for VisibilityNotify Event */ |
314 |
for (;;) { |
for (;;) |
315 |
|
{ |
316 |
XNextEvent(display, &xevent); |
XNextEvent(display, &xevent); |
317 |
if (xevent.type == VisibilityNotify) |
if (xevent.type == VisibilityNotify) |
318 |
break; |
break; |
398 |
|
|
399 |
|
|
400 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
401 |
VisibilityChangeMask | FocusChangeMask; |
VisibilityChangeMask | FocusChangeMask; |
402 |
|
|
403 |
if (grab_keyboard) |
if (grab_keyboard) |
404 |
input_mask |= EnterWindowMask | LeaveWindowMask; |
input_mask |= EnterWindowMask | LeaveWindowMask; |
409 |
input_mask |= ExposureMask; |
input_mask |= ExposureMask; |
410 |
|
|
411 |
if (fullscreen) |
if (fullscreen) |
412 |
ui_create_window_obj(0, 0, width, height, CWBackingStore | CWBackPixel | CWOverrideRedirect); |
ui_create_window_obj(0, 0, width, height, |
413 |
|
CWBackingStore | CWBackPixel | CWOverrideRedirect); |
414 |
else |
else |
415 |
ui_create_window_obj(0, 0, width, height, CWBackingStore | CWBackPixel); |
ui_create_window_obj(0, 0, width, height, CWBackingStore | CWBackPixel); |
416 |
|
|
464 |
XFreePixmap(display, backstore); |
XFreePixmap(display, backstore); |
465 |
XFreeGC(display, gc); |
XFreeGC(display, gc); |
466 |
XDestroyWindow(display, wnd); |
XDestroyWindow(display, wnd); |
467 |
if (fullscreen) { |
if (fullscreen) |
468 |
|
{ |
469 |
attribs.override_redirect = True; |
attribs.override_redirect = True; |
470 |
ui_create_window_obj(0, 0, dpy_width, dpy_height, |
ui_create_window_obj(0, 0, dpy_width, dpy_height, |
471 |
CWBackingStore | CWBackPixel | CWOverrideRedirect); |
CWBackingStore | CWBackPixel | CWOverrideRedirect); |
472 |
} |
} |
473 |
else { |
else |
474 |
|
{ |
475 |
attribs.override_redirect = False; |
attribs.override_redirect = False; |
476 |
ui_create_window_obj(0, 0, width, height, |
ui_create_window_obj(0, 0, width, height, CWBackingStore | CWBackPixel); |
|
CWBackingStore | CWBackPixel); |
|
477 |
} |
} |
478 |
ui_set_cursor(cache_get_cursor(0)); |
ui_set_cursor(cache_get_cursor(0)); |
479 |
ui_move_pointer(width / 2, height / 2); |
ui_move_pointer(width / 2, height / 2); |
543 |
} |
} |
544 |
|
|
545 |
/* FIXME needs alt modifier */ |
/* FIXME needs alt modifier */ |
546 |
if (keysym == XK_Break) /* toggle full screen */ |
if (keysym == XK_Break) /* toggle full screen */ |
547 |
{ |
{ |
548 |
toggle_fullscreen(); |
toggle_fullscreen(); |
549 |
break; |
break; |