Make sure gui_key_modifier_pressed is cleared correctly.
Use correct event fields for SDL_ACTIVEEVENT. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1780 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									38ca0f6dee
								
							
						
					
					
						commit
						5b31187812
					
				
							
								
								
									
										6
									
								
								sdl.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								sdl.c
									
									
									
									
									
								
							@ -404,6 +404,7 @@ static void sdl_refresh(DisplayState *ds)
 | 
				
			|||||||
                mod_state = (ev->key.keysym.mod & gui_grab_code);
 | 
					                mod_state = (ev->key.keysym.mod & gui_grab_code);
 | 
				
			||||||
                if (!mod_state) {
 | 
					                if (!mod_state) {
 | 
				
			||||||
                    if (gui_key_modifier_pressed) {
 | 
					                    if (gui_key_modifier_pressed) {
 | 
				
			||||||
 | 
					                        gui_key_modifier_pressed = 0;
 | 
				
			||||||
                        if (gui_keysym == 0) {
 | 
					                        if (gui_keysym == 0) {
 | 
				
			||||||
                            /* exit/enter grab if pressing Ctrl-Alt */
 | 
					                            /* exit/enter grab if pressing Ctrl-Alt */
 | 
				
			||||||
                            if (!gui_grab)
 | 
					                            if (!gui_grab)
 | 
				
			||||||
@ -415,7 +416,6 @@ static void sdl_refresh(DisplayState *ds)
 | 
				
			|||||||
                            reset_keys();
 | 
					                            reset_keys();
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        gui_key_modifier_pressed = 0;
 | 
					 | 
				
			||||||
                        gui_keysym = 0;
 | 
					                        gui_keysym = 0;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@ -456,8 +456,8 @@ static void sdl_refresh(DisplayState *ds)
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case SDL_ACTIVEEVENT:
 | 
					        case SDL_ACTIVEEVENT:
 | 
				
			||||||
            if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
 | 
					            if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
 | 
				
			||||||
                !gui_fullscreen_initial_grab) {
 | 
					                !ev->active.gain && !gui_fullscreen_initial_grab) {
 | 
				
			||||||
                sdl_grab_end();
 | 
					                sdl_grab_end();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user