| 695 | // delete events from the window manager. |
| 696 | |
| 697 | static 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(); |
no test coverage detected