Do not block in Get_input() when Quit_is_required is set
This commit is contained in:
		
							parent
							
								
									48b9213da3
								
							
						
					
					
						commit
						f8bfad2f34
					
				
							
								
								
									
										13
									
								
								src/input.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/input.c
									
									
									
									
									
								
							@ -1212,6 +1212,10 @@ int Get_input(int sleep_time)
 | 
			
		||||
    // This is done in this function because it's called after reading 
 | 
			
		||||
    // some user input.
 | 
			
		||||
    Flush_update();
 | 
			
		||||
 | 
			
		||||
    if (Quit_is_required)
 | 
			
		||||
      return 1;
 | 
			
		||||
 | 
			
		||||
    Key_ANSI = 0;
 | 
			
		||||
    Key_UNICODE = 0;
 | 
			
		||||
    Key = 0;
 | 
			
		||||
@ -1601,7 +1605,11 @@ int Get_input(int sleep_time)
 | 
			
		||||
    // some user input.
 | 
			
		||||
    Flush_update();
 | 
			
		||||
 | 
			
		||||
	  while (!user_feedback_required && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
 | 
			
		||||
    if (Quit_is_required)
 | 
			
		||||
      return 1;
 | 
			
		||||
 | 
			
		||||
    while (!user_feedback_required && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
 | 
			
		||||
    {
 | 
			
		||||
      TranslateMessage(&msg);
 | 
			
		||||
      DispatchMessage(&msg);
 | 
			
		||||
    }
 | 
			
		||||
@ -1617,7 +1625,8 @@ int Get_input(int sleep_time)
 | 
			
		||||
    if (user_feedback_required)
 | 
			
		||||
    {
 | 
			
		||||
      // Process the WM_CHAR event that follow WM_KEYDOWN
 | 
			
		||||
      if(PeekMessage(&msg, NULL, WM_CHAR, WM_CHAR, PM_REMOVE)) {
 | 
			
		||||
      if(PeekMessage(&msg, NULL, WM_CHAR, WM_CHAR, PM_REMOVE))
 | 
			
		||||
      {
 | 
			
		||||
        TranslateMessage(&msg);
 | 
			
		||||
        DispatchMessage(&msg);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user