mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 13:54:49 +00:00 
			
		
		
		
	x11: better fix for the previous commit's fullscreen vs maximized issue.
This commit is contained in:
		
							parent
							
								
									a4627c5eda
								
							
						
					
					
						commit
						2436ca200d
					
				| 
						 | 
				
			
			@ -1186,6 +1186,22 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis
 | 
			
		|||
 | 
			
		||||
        X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
 | 
			
		||||
                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
 | 
			
		||||
 | 
			
		||||
        /* Fullscreen windows sometimes end up being marked maximized by
 | 
			
		||||
            window managers. Force it back to how we expect it to be. */
 | 
			
		||||
        if (!fullscreen && ((window->flags & SDL_WINDOW_MAXIMIZED) == 0)) {
 | 
			
		||||
            SDL_zero(e);
 | 
			
		||||
            e.xany.type = ClientMessage;
 | 
			
		||||
            e.xclient.message_type = _NET_WM_STATE;
 | 
			
		||||
            e.xclient.format = 32;
 | 
			
		||||
            e.xclient.window = data->xwindow;
 | 
			
		||||
            e.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
 | 
			
		||||
            e.xclient.data.l[1] = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
 | 
			
		||||
            e.xclient.data.l[2] = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
 | 
			
		||||
            e.xclient.data.l[3] = 0l;
 | 
			
		||||
            X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
 | 
			
		||||
                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        Uint32 flags;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1206,14 +1222,6 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Fullscreen windows sometimes end up being marked maximized by
 | 
			
		||||
        window managers. Force it back to how we expect it to be. */
 | 
			
		||||
    if (X11_IsWindowMapped(_this, window)) {
 | 
			
		||||
        if (!fullscreen && ((window->flags & SDL_WINDOW_MAXIMIZED) == 0)) {
 | 
			
		||||
            SetWindowMaximized(_this, window, SDL_FALSE);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    X11_XFlush(display);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue