Skip to content

Commit

Permalink
Fix for fullscreen state handling by maintaining a local flag
Browse files Browse the repository at this point in the history
in order to avoid a state inconsistency caused by aynchronous
X property updates.
    
BUG=286278
TEST=Manually test using Fullscreen API toggling.
R=erg@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23670008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222404 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dominik.rottsches@intel.com committed Sep 10, 2013
1 parent c212982 commit 7f1c7ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ David Futcher <david.mike.futcher@gmail.com>
Devlin Cronin <rdevlin.cronin@gmail.com>
Dillon Sellars <dill.sellars@gmail.com>
Dominic Jodoin <dominic.jodoin@gmail.com>
Dominik Röttsches <dominik.rottsches@intel.com>
Don Woodward <woodward@adobe.com>
Dongseong Hwang <dongseong.hwang@intel.com>
Edward Crossman <tedoc2000@gmail.com>
Expand Down
6 changes: 5 additions & 1 deletion ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ DesktopRootWindowHostX11::DesktopRootWindowHostX11(
atom_cache_(xdisplay_, kAtomsToCache),
window_mapped_(false),
focus_when_shown_(false),
is_fullscreen_(false),
current_cursor_(ui::kCursorNull),
native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura) {
Expand Down Expand Up @@ -472,13 +473,14 @@ NonClientFrameView* DesktopRootWindowHostX11::CreateNonClientFrameView() {
}

void DesktopRootWindowHostX11::SetFullscreen(bool fullscreen) {
is_fullscreen_ = fullscreen;
SetWMSpecState(fullscreen,
atom_cache_.GetAtom("_NET_WM_STATE_FULLSCREEN"),
None);
}

bool DesktopRootWindowHostX11::IsFullscreen() const {
return HasWMSpecProperty("_NET_WM_STATE_FULLSCREEN");
return is_fullscreen_;
}

void DesktopRootWindowHostX11::SetOpacity(unsigned char opacity) {
Expand Down Expand Up @@ -1308,6 +1310,8 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) {
restored_bounds_ = previous_bounds_;
}

is_fullscreen_ = HasWMSpecProperty("_NET_WM_STATE_FULLSCREEN");

// Now that we have different window properties, we may need to
// relayout the window. (The windows code doesn't need this because
// their window change is synchronous.)
Expand Down
4 changes: 4 additions & 0 deletions ui/views/widget/desktop_aura/desktop_root_window_host_x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ class VIEWS_EXPORT DesktopRootWindowHostX11 :
// The window manager state bits.
std::set< ::Atom> window_properties_;

// Local flag for fullscreen state to avoid a state mismatch between
// server and local window_properties_ during app-initiated fullscreen.
bool is_fullscreen_;

// We are owned by the RootWindow, but we have to have a back pointer to it.
aura::RootWindow* root_window_;

Expand Down

0 comments on commit 7f1c7ed

Please sign in to comment.