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

Function handleEvent

server/faker-x11.cpp:697–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695// delete events from the window manager.
696
697static void handleEvent(Display *dpy, XEvent *xe)
698{
699 faker::VirtualWin *vw;
700 faker::EGLXVirtualWin *eglxvw;
701
702 if(IS_EXCLUDED(dpy))
703 return;
704
705 if(xe && xe->type == ConfigureNotify)
706 {
707 if((vw = WINHASH.find(dpy, xe->xconfigure.window)) != NULL)
708 {
709 /////////////////////////////////////////////////////////////////////////
710 OPENTRACE(handleEvent); PRARGI(xe->xconfigure.width);
711 PRARGI(xe->xconfigure.height); PRARGX(xe->xconfigure.window);
712 STARTTRACE();
713 /////////////////////////////////////////////////////////////////////////
714
715 vw->resize(xe->xconfigure.width, xe->xconfigure.height);
716
717 /////////////////////////////////////////////////////////////////////////
718 STOPTRACE(); CLOSETRACE();
719 /////////////////////////////////////////////////////////////////////////
720 }
721 if((eglxvw = EGLXWINHASH.find(dpy, xe->xconfigure.window)) != NULL)
722 {
723 /////////////////////////////////////////////////////////////////////////
724 OPENTRACE(handleEvent); PRARGI(xe->xconfigure.width);
725 PRARGI(xe->xconfigure.height); PRARGX(xe->xconfigure.window);
726 STARTTRACE();
727 /////////////////////////////////////////////////////////////////////////
728
729 eglxvw->resize(xe->xconfigure.width, xe->xconfigure.height);
730
731 /////////////////////////////////////////////////////////////////////////
732 STOPTRACE(); CLOSETRACE();
733 /////////////////////////////////////////////////////////////////////////
734 }
735 }
736 else if(xe && xe->type == KeyPress)
737 {
738 unsigned int state =
739 xe->xkey.state & (ShiftMask | ControlMask | Mod1Mask);
740 if(fconfig.gui
741 && KeycodeToKeysym(dpy, xe->xkey.keycode, 0) == fconfig.guikey
742 && state == fconfig.guimod && fconfig_getshmid() != -1)
743 VGLPOPUP(dpy, fconfig_getshmid());
744 }
745 else if(xe && xe->type == ClientMessage)
746 {
747 XClientMessageEvent *cme = (XClientMessageEvent *)xe;
748 Atom protoAtom = XInternAtom(dpy, "WM_PROTOCOLS", True);
749 Atom deleteAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", True);
750 if(protoAtom && deleteAtom && cme->message_type == protoAtom
751 && cme->data.l[0] == (long)deleteAtom)
752 {
753 if((vw = WINHASH.find(dpy, cme->window)) != NULL)
754 vw->wmDeleted();

Callers 7

XCheckMaskEventFunction · 0.85
XCheckTypedEventFunction · 0.85
XCheckTypedWindowEventFunction · 0.85
XCheckWindowEventFunction · 0.85
XMaskEventFunction · 0.85
XNextEventFunction · 0.85
XWindowEventFunction · 0.85

Calls 5

KeycodeToKeysymFunction · 0.85
fconfig_getshmidFunction · 0.85
wmDeletedMethod · 0.80
findMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected