MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_ProcessEvents

Function Window_ProcessEvents

src/Window_X11.c:770–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770void Window_ProcessEvents(float delta) {
771 Window win = Window_Main.Handle.val;
772 XEvent e;
773 Window focus;
774 int focusRevert;
775
776 while (Window_Main.Exists) {
777 if (!XCheckIfEvent(win_display, &e, FilterEvent, (XPointer)win)) break;
778 if (XFilterEvent(&e, None) == True) continue;
779
780 switch (e.type) {
781 case GenericEvent:
782 HandleGenericEvent(&e); break;
783 case ClientMessage:
784 HandleClientMessage(&e); break;
785
786 case DestroyNotify:
787 Platform_LogConst("Window destroyed");
788 Window_Main.Exists = false;
789 break;
790
791 case ConfigureNotify:
792 RefreshWindowBounds(e.xconfigure.width, e.xconfigure.height);
793 break;
794
795 case Expose:
796 if (e.xexpose.count == 0) Event_RaiseVoid(&WindowEvents.RedrawNeeded);
797 break;
798
799 case LeaveNotify:
800 XGetInputFocus(win_display, &focus, &focusRevert);
801 if (focus == PointerRoot) {
802 Window_Main.Focused = false; Event_RaiseVoid(&WindowEvents.FocusChanged);
803 }
804 break;
805
806 case EnterNotify:
807 XGetInputFocus(win_display, &focus, &focusRevert);
808 if (focus == PointerRoot) {
809 Window_Main.Focused = true; Event_RaiseVoid(&WindowEvents.FocusChanged);
810 }
811 break;
812
813 case KeyPress:
814 HandleKeyPress(&e); break;
815 case KeyRelease:
816 HandleKeyRelease(&e); break;
817 case ButtonPress:
818 HandleButtonPress(&e); break;
819 case ButtonRelease:
820 HandleButtonRelease(&e); break;
821
822 case MotionNotify:
823 Pointer_SetPosition(0, e.xmotion.x, e.xmotion.y);
824 break;
825
826 case FocusIn:
827 case FocusOut:

Callers 3

Clipboard_GetTextFunction · 0.70
ToggleFullscreenFunction · 0.70
Window_SetSizeFunction · 0.70

Calls 14

HandleGenericEventFunction · 0.85
HandleClientMessageFunction · 0.85
Platform_LogConstFunction · 0.85
Event_RaiseVoidFunction · 0.85
HandleKeyPressFunction · 0.85
HandleKeyReleaseFunction · 0.85
HandleButtonPressFunction · 0.85
HandleButtonReleaseFunction · 0.85
Pointer_SetPositionFunction · 0.85
Input_ClearFunction · 0.85
HandleMappingNotifyFunction · 0.85
HandleSelectionNotifyFunction · 0.85

Tested by

no test coverage detected