Permalink
Browse files

Implement Fullscreen mode

  • Loading branch information...
1 parent bf1dc26 commit 1ee5ade7591e4f8a0537d506e1b1b0b0a28250b8 @etrunko etrunko committed with kalyankondapally Nov 12, 2013
Showing with 15 additions and 4 deletions.
  1. +4 −1 impl/ozone_display.cc
  2. +5 −0 wayland/shell_surface.cc
  3. +5 −2 wayland/window.cc
  4. +1 −1 wayland/window.h
View
@@ -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);
View
@@ -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.";
View
@@ -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()
View
@@ -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_; }

0 comments on commit 1ee5ade

Please sign in to comment.