eab554ee6ac34e925a07a2731959cc80346d1226
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index ab8b4f1..5f442b8 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -106,7 +106,8 @@ enum {
   PROP_ENABLE_POPUP,
   PROP_GROUP_ID,
   PROP_GROUP,
-  PROP_HOMOGENEOUS
+  PROP_HOMOGENEOUS,
+  PROP_FULLSCREEN_MODE
 };
 
 enum {
@@ -183,9 +184,10 @@ struct _GtkNotebookPrivate
 
   guint32 timestamp;
 
-  guint during_reorder : 1;
-  guint during_detach  : 1;
-  guint has_scrolled   : 1;
+  guint during_reorder  : 1;
+  guint during_detach   : 1;
+  guint has_scrolled    : 1;
+  guint fullscreen_mode : 1;
 };
 
 static const GtkTargetEntry notebook_targets [] = {
@@ -663,6 +665,21 @@ gtk_notebook_class_init (GtkNotebookClass *class)
 							 P_("Group for tabs drag and drop"),
 							 GTK_PARAM_READWRITE));
 
+  /**
+   * GtkNotebook::fullscreen-mode:
+   *
+   * Whether the notebook is in fullscreen mode or not.
+   *
+   * Since: 2.16
+   */
+  g_object_class_install_property (gobject_class,
+				   PROP_FULLSCREEN_MODE,
+				   g_param_spec_boolean ("fullscreen-mode",
+							 P_("Fullscreen mode"),
+							 P_("Whether the notebook is in fullscreen mode"),
+							 FALSE,
+							 GTK_PARAM_READWRITE));
+
   gtk_container_class_install_child_property (container_class,
 					      CHILD_PROP_TAB_LABEL,
 					      g_param_spec_string ("tab-label", 
@@ -1527,6 +1544,9 @@ gtk_notebook_set_property (GObject         *object,
     case PROP_GROUP:
       gtk_notebook_set_group (notebook, g_value_get_pointer (value));
       break;
+    case PROP_FULLSCREEN_MODE:
+      gtk_notebook_set_fullscreen_mode (notebook, g_value_get_boolean (value));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1580,6 +1600,9 @@ gtk_notebook_get_property (GObject         *object,
     case PROP_GROUP:
       g_value_set_pointer (value, priv->group);
       break;
+    case PROP_FULLSCREEN_MODE:
+      g_value_set_boolean (value, priv->fullscreen_mode);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1787,6 +1810,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
 			   GtkRequisition *requisition)
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+  GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
   GtkNotebookPage *page;
   GList *children;
   GtkRequisition child_requisition;
@@ -1842,8 +1866,11 @@ gtk_notebook_size_request (GtkWidget      *widget,
 
   if (notebook->show_border || notebook->show_tabs)
     {
-      widget->requisition.width += widget->style->xthickness * 2;
-      widget->requisition.height += widget->style->ythickness * 2;
+      if (!priv->fullscreen_mode)
+	{
+	  widget->requisition.width += widget->style->xthickness * 2;
+	  widget->requisition.height += widget->style->ythickness * 2;
+	}
 
       if (notebook->show_tabs)
 	{
@@ -1851,6 +1878,18 @@ gtk_notebook_size_request (GtkWidget      *widget,
 	  gint tab_height = 0;
 	  gint tab_max = 0;
 	  gint padding;
+
+	  if (priv->fullscreen_mode)
+	    {
+	      /* we need separation between
+	       * the tabs and the content
+	       */
+	      if (notebook->tab_pos == GTK_POS_TOP ||
+		  notebook->tab_pos == GTK_POS_BOTTOM)
+		widget->requisition.height += widget->style->xthickness;
+	      else
+		widget->requisition.width += widget->style->ythickness;
+	    }
 	  
 	  for (children = notebook->children; children;
 	       children = children->next)
@@ -2052,6 +2091,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
 			    GtkAllocation *allocation)
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+  GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
   gint tab_pos = get_effective_tab_pos (notebook);
 
   widget->allocation = *allocation;
@@ -2085,12 +2125,33 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
 
       if (notebook->show_tabs || notebook->show_border)
 	{
-	  child_allocation.x += widget->style->xthickness;
-	  child_allocation.y += widget->style->ythickness;
-	  child_allocation.width = MAX (1, child_allocation.width -
-					widget->style->xthickness * 2);
-	  child_allocation.height = MAX (1, child_allocation.height -
-					 widget->style->ythickness * 2);
+	  if (! priv->fullscreen_mode)
+	    {
+	      child_allocation.x += widget->style->xthickness;
+	      child_allocation.y += widget->style->ythickness;
+	      child_allocation.width = MAX (1, child_allocation.width -
+					    widget->style->xthickness * 2);
+	      child_allocation.height = MAX (1, child_allocation.height -
+					     widget->style->ythickness * 2);
+	    }
+	  else
+	    {
+	      switch (tab_pos)
+		{
+		case GTK_POS_TOP:
+		  child_allocation.y += widget->style->ythickness;
+		case GTK_POS_BOTTOM:
+		  child_allocation.height = MAX (1, child_allocation.height -
+						 widget->style->ythickness);
+		  break;
+		case GTK_POS_LEFT:
+		  child_allocation.x += widget->style->xthickness;
+		case GTK_POS_RIGHT:
+		  child_allocation.width = MAX (1, child_allocation.width -
+						widget->style->xthickness);
+		  break;
+		}
+	    }
 
 	  if (notebook->show_tabs && notebook->children && notebook->cur_page)
 	    {
@@ -7574,5 +7635,58 @@ gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
     }
 }
 
+/**
+ * gtk_notebook_get_fullscreen_mode:
+ * @notebook: A #GtkNotebook
+ *
+ * Returns whether @notebook is in fullscreen mode. see gtk_notebook_set_fullscreen_mode().
+ *
+ * Returns: #TRUE if the notebook is in fullscreen mode.
+ *
+ * Since: 2.16
+ **/
+gboolean
+gtk_notebook_get_fullscreen_mode (GtkNotebook *notebook)
+{
+  GtkNotebookPrivate *priv;
+
+  g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
+
+  priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
+  return priv->fullscreen_mode;
+}
+
+/**
+ * gtk_notebook_set_fullscreen_mode:
+ * @notebook: A #GtkNotebook
+ * @fullscreen_mode: whether the notebook is in fullscreen mode or not.
+ *
+ * Sets whether the notebook is in fullscreen mode or not. In fullscreen
+ * mode, the notebook will not add any xthickness/ythickness to the
+ * borders that do not contain the tabs, so child widgets can benefit
+ * of fitts's law in borders if the notebook is in a maximized or
+ * fullscreen window.
+ *
+ * Since: 2.16
+ **/
+void
+gtk_notebook_set_fullscreen_mode (GtkNotebook *notebook,
+				  gboolean     fullscreen_mode)
+{
+  GtkNotebookPrivate *priv;
+
+  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+  priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
+  fullscreen_mode = (fullscreen_mode != FALSE);
+
+  if (priv->fullscreen_mode != fullscreen_mode)
+    return;
+
+  priv->fullscreen_mode = fullscreen_mode;
+  gtk_widget_queue_resize (GTK_WIDGET (notebook));
+  g_object_notify (G_OBJECT (notebook), "fullscreen-mode");
+}
+
 #define __GTK_NOTEBOOK_C__
 #include "gtkaliasdef.c"
diff --git a/gtk/gtknotebook.h b/gtk/gtknotebook.h
index 887704a..0788dbe 100644
--- a/gtk/gtknotebook.h
+++ b/gtk/gtknotebook.h
@@ -280,6 +280,11 @@ gboolean gtk_notebook_get_tab_detachable  (GtkNotebook *notebook,
 void gtk_notebook_set_tab_detachable      (GtkNotebook *notebook,
 					   GtkWidget   *child,
 					   gboolean     detachable);
+gboolean gtk_notebook_get_fullscreen_mode (GtkNotebook *notebook);
+void     gtk_notebook_set_fullscreen_mode (GtkNotebook *notebook,
+					   gboolean     fullscreen_mode);
+
+
 
 #ifndef GTK_DISABLE_DEPRECATED
 #define	gtk_notebook_current_page               gtk_notebook_get_current_page
