Exemple #1
0
static void
wl_shell_surface_set_state (MetaWaylandSurface     *surface,
                            MetaWlShellSurfaceState state)
{
  MetaWaylandWlShellSurface *wl_shell_surface =
    META_WAYLAND_WL_SHELL_SURFACE (surface->role);
  MetaWlShellSurfaceState old_state = wl_shell_surface->state;

  wl_shell_surface->state = state;

  if (surface->window && old_state != state)
    {
      if (old_state == META_WL_SHELL_SURFACE_STATE_POPUP &&
          wl_shell_surface->popup)
        {
          meta_wayland_popup_dismiss (wl_shell_surface->popup);
          wl_shell_surface->popup = NULL;
        }

      if (state == META_WL_SHELL_SURFACE_STATE_FULLSCREEN)
        meta_window_make_fullscreen (surface->window);
      else
        meta_window_unmake_fullscreen (surface->window);

      if (state == META_WL_SHELL_SURFACE_STATE_MAXIMIZED)
        meta_window_maximize (surface->window, META_MAXIMIZE_BOTH);
      else
        meta_window_unmaximize (surface->window, META_MAXIMIZE_BOTH);
    }
}
static gboolean
mnb_notification_gtk_click_cb (GtkWidget      *widget,
                               GdkEventButton *event,
                               gpointer        data)
{
  MutterPlugin *plugin  = dawati_netbook_get_plugin_singleton ();
  MetaScreen   *screen  = mutter_plugin_get_screen (plugin);
  MetaDisplay  *display = meta_screen_get_display (screen);
  MetaWindow   *mw = NULL;
  gboolean      fullscreen = FALSE;

  g_debug ("Got click on widget %s", G_OBJECT_TYPE_NAME (widget));

  g_object_get (display, "focus-window", &mw, NULL);

  if (!mw)
    {
      g_warning (G_STRLOC " Could not obtain currently focused window!");
      return TRUE;
    }

  g_object_get (mw, "fullscreen", &fullscreen, NULL);

  if (!fullscreen)
    {
      g_warning (G_STRLOC " Currently focused window is not fullscreen!");
      return TRUE;
    }

  meta_window_unmake_fullscreen (mw);

  return TRUE;
}
static void
xdg_surface_unset_fullscreen (struct wl_client   *client,
                              struct wl_resource *resource)
{
  MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);

  meta_window_unmake_fullscreen (surface->window);
}