• Maksim Sisov's avatar
    X11: Fix leaving fullscreen regression. · 8b85759b
    Maksim Sisov authored
    For Metacity, we have a workaround which fixes unfullscreening
    issue. That is, we restore and maximize the window if the previous
    state before the fullscreen state was maximized. By that, we force
    metacity to leave the fullscreen. If we don't do it, it may end
    up in a fullscreen again.
    
    However, during our previous refactorings, a regression was introduced.
    Even though, we followed the same approach, the X11Window::Maximize
    method didn't directly call XWindow::SetFullScreen, but rather
    called X11Window::ToggleFullscreen, which resulted in recursive
    calls to the X11Window::ToggleFullscreen and crashes on X11 level.
    
    Also, this CL forces to use previous state when fullscreen is left
    as long as X server might not send a configure event and change our
    state. Thus, if it was maximized, set it to maximized. Otherwise,
    set it to normal as opposed to Unknown state set before.
    
    Also, we forgot to move the code that deals with restored bounds
    when a state change was triggered by X server. This CL restores
    that behaviour.
    
    PS: In a follow-up CL, I will make all state changes to be
    synchronous as we are doing now in Wayland.
    
    TBR=sky
    
    Bug: 1034791
    Change-Id: I0725625148acf6602e7818823cb96b1d82ef9b38
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978637Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
    Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#727224}
    8b85759b
x11_window.cc 22.6 KB