351 |
height = HeightOfScreen(screen); |
height = HeightOfScreen(screen); |
352 |
} |
} |
353 |
|
|
354 |
|
/* make sure width is a multiple of 4 */ |
355 |
|
width = (width + 3) & ~3; |
356 |
|
|
357 |
xkeymap_init(); |
xkeymap_init(); |
358 |
return True; |
return True; |
359 |
} |
} |
435 |
display = NULL; |
display = NULL; |
436 |
} |
} |
437 |
|
|
|
static void |
|
|
xwin_reset_keys() |
|
|
{ |
|
|
/* reset keys */ |
|
|
uint32 ev_time; |
|
|
ev_time = time(NULL); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT); |
|
|
} |
|
438 |
|
|
439 |
void |
void |
440 |
xwin_toggle_fullscreen() |
xwin_toggle_fullscreen() |
444 |
int newwidth, newheight; |
int newwidth, newheight; |
445 |
|
|
446 |
fullscreen = !fullscreen; |
fullscreen = !fullscreen; |
447 |
newwidth = fullscreen ? WidthOfScreen(screen) : width; |
newwidth = fullscreen ? WidthOfScreen(screen) : width; |
448 |
newheight = fullscreen ? HeightOfScreen(screen) : height; |
newheight = fullscreen ? HeightOfScreen(screen) : height; |
449 |
|
|
450 |
XUnmapWindow(display, wnd); |
XUnmapWindow(display, wnd); |
451 |
attribs.override_redirect = fullscreen; |
attribs.override_redirect = fullscreen; |
452 |
|
XMoveResizeWindow(display, wnd, 0, 0, newwidth, newheight); |
453 |
XChangeWindowAttributes(display, wnd, CWOverrideRedirect, &attribs); |
XChangeWindowAttributes(display, wnd, CWOverrideRedirect, &attribs); |
|
XResizeWindow(display, wnd, newwidth, newheight); |
|
454 |
xwin_map_window(); |
xwin_map_window(); |
455 |
} |
} |
456 |
|
|
558 |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
559 |
break; |
break; |
560 |
|
|
|
case FocusIn: |
|
|
/* fall through */ |
|
561 |
case EnterNotify: |
case EnterNotify: |
562 |
if (grab_keyboard) |
if (grab_keyboard) |
563 |
XGrabKeyboard(display, wnd, True, |
XGrabKeyboard(display, wnd, True, |
564 |
GrabModeAsync, GrabModeAsync, CurrentTime); |
GrabModeAsync, GrabModeAsync, CurrentTime); |
565 |
break; |
break; |
566 |
|
|
|
case FocusOut: |
|
|
xwin_reset_keys(); |
|
|
/* fall through */ |
|
567 |
case LeaveNotify: |
case LeaveNotify: |
568 |
if (grab_keyboard) |
if (grab_keyboard) |
569 |
XUngrabKeyboard(display, CurrentTime); |
XUngrabKeyboard(display, CurrentTime); |
570 |
break; |
break; |
571 |
|
|
572 |
|
case FocusIn: |
573 |
|
reset_modifier_keys(); |
574 |
|
break; |
575 |
|
|
576 |
case Expose: |
case Expose: |
577 |
XCopyArea(display, backstore, wnd, gc, |
XCopyArea(display, backstore, wnd, gc, |
578 |
xevent.xexpose.x, xevent.xexpose.y, |
xevent.xexpose.x, xevent.xexpose.y, |