Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
Implement Fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Lima (Etrunko) authored and kalyankondapally committed Nov 27, 2013
1 parent bf1dc26 commit 1ee5ade
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion impl/ozone_display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ void OzoneDisplay::OnWidgetStateChanged(gfx::AcceleratedWidget w,
break;
}
case FullScreen:
NOTIMPLEMENTED();
{
WaylandWindow* widget = GetWidget(w);
widget->ToggleFullscreen();
break;
}
case Maximized:
{
WaylandWindow* widget = GetWidget(w);
Expand Down
5 changes: 5 additions & 0 deletions wayland/shell_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ void WaylandShellSurface::UpdateShellSurface(WaylandWindow::ShellType type) cons
wl_shell_surface_set_toplevel(shell_surface_);
break;
case WaylandWindow::FULLSCREEN:
wl_shell_surface_set_fullscreen(shell_surface_,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0,
NULL);
break;
case WaylandWindow::TRANSIENT:
case WaylandWindow::CUSTOM:
NOTREACHED() << "UnSupported Shell Type.";
Expand Down
7 changes: 5 additions & 2 deletions wayland/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ void WaylandWindow::Restore()
NOTIMPLEMENTED();
}

void WaylandWindow::SetFullscreen()
void WaylandWindow::ToggleFullscreen()
{
NOTIMPLEMENTED();
if (type_ == FULLSCREEN)
SetShellType(TOPLEVEL);
else
SetShellType(FULLSCREEN);
}

void WaylandWindow::RealizeAcceleratedWidget()
Expand Down
2 changes: 1 addition & 1 deletion wayland/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WaylandWindow {
void Maximize();
void Minimize();
void Restore();
void SetFullscreen();
void ToggleFullscreen();

ShellType Type() const { return type_; }
unsigned Handle() const { return handle_; }
Expand Down

0 comments on commit 1ee5ade

Please sign in to comment.