Skip to content

Commit

Permalink
Implement Fullscreen mode
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Lima (Etrunko) <[email protected]>
  • Loading branch information
Eduardo Lima (Etrunko) committed Nov 18, 2013
1 parent 16d5b3d commit e47c306
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion impl/ozone_display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ void OzoneDisplay::OnWidgetStateChanged(gfx::AcceleratedWidget w,
case Create:
CreateWidget(w);
case FullScreen:
NOTIMPLEMENTED();
{
WaylandWindow* widget = GetWidget(w);
widget->ToggleFullscreen();
break;
}
case Maximized:
{
WaylandWindow* widget = GetWidget(w);
Expand Down
4 changes: 4 additions & 0 deletions wayland/shell_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ 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::MENU:
case WaylandWindow::CUSTOM:
Expand Down
11 changes: 7 additions & 4 deletions wayland/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void WaylandWindow::SetShellType(ShellType type)
type_ = type;
switch (type_) {
case TOPLEVEL:
shell_surface_->UpdateShellSurface(TOPLEVEL);
break;
case FULLSCREEN:
shell_surface_->UpdateShellSurface(type_);
break;
case TRANSIENT:
case MENU:
case CUSTOM:
Expand Down Expand Up @@ -76,9 +76,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_; }
void RealizeAcceleratedWidget();
Expand Down

0 comments on commit e47c306

Please sign in to comment.