MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / handleXCBEvent

Function handleXCBEvent

server/faker-xcb.cpp:426–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424// delete events from the window manager.
425
426static void handleXCBEvent(xcb_connection_t *conn, xcb_generic_event_t *ev)
427{
428 faker::VirtualWin *vw = NULL;
429 faker::EGLXVirtualWin *eglxvw;
430
431 if(!ev || faker::deadYet || !fconfig.fakeXCB || faker::getFakerLevel() > 0)
432 return;
433
434 switch(ev->response_type & ~0x80)
435 {
436 case XCB_CONFIGURE_NOTIFY:
437 {
438 xcb_configure_notify_event_t *cne = (xcb_configure_notify_event_t *)ev;
439 Display *dpy = XCBCONNHASH.getX11Display(conn);
440
441 if(!dpy || faker::isDisplayExcluded(dpy)) break;
442
443 if((vw = WINHASH.find(dpy, cne->window)) != NULL)
444 {
445 ///////////////////////////////////////////////////////////////////////
446 OPENTRACE(handleXCBEvent); PRARGX(cne->window); PRARGI(cne->width);
447 PRARGI(cne->height); STARTTRACE();
448 ///////////////////////////////////////////////////////////////////////
449
450 vw->resize(cne->width, cne->height);
451
452 ///////////////////////////////////////////////////////////////////////
453 STOPTRACE(); CLOSETRACE();
454 ///////////////////////////////////////////////////////////////////////
455 }
456 if((eglxvw = EGLXWINHASH.find(dpy, cne->window)) != NULL)
457 {
458 ///////////////////////////////////////////////////////////////////////
459 OPENTRACE(handleXCBEvent); PRARGX(cne->window); PRARGI(cne->width);
460 PRARGI(cne->height); STARTTRACE();
461 ///////////////////////////////////////////////////////////////////////
462
463 eglxvw->resize(cne->width, cne->height);
464
465 ///////////////////////////////////////////////////////////////////////
466 STOPTRACE(); CLOSETRACE();
467 ///////////////////////////////////////////////////////////////////////
468 }
469 break;
470 }
471 case XCB_KEY_PRESS:
472 {
473 xcb_key_press_event_t *kpe = (xcb_key_press_event_t *)ev;
474 Display *dpy = XCBCONNHASH.getX11Display(conn);
475
476 if(!dpy || !fconfig.gui || faker::isDisplayExcluded(dpy)) break;
477
478 xcb_key_symbols_t *keysyms = _xcb_key_symbols_alloc(conn);
479 if(!keysyms) break;
480
481 xcb_keysym_t keysym =
482 _xcb_key_symbols_get_keysym(keysyms, kpe->detail, 0);
483 unsigned int state2;

Callers 3

xcb_poll_for_eventFunction · 0.85
xcb_wait_for_eventFunction · 0.85

Calls 8

isDisplayExcludedFunction · 0.85
fconfig_getshmidFunction · 0.85
getProtoAtomMethod · 0.80
getDeleteAtomMethod · 0.80
wmDeletedMethod · 0.80
getX11DisplayMethod · 0.45
findMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected