hide and show min/max buttons based on GdmWMDecorations value

This commit is contained in:
Cody Russell
2009-07-05 23:26:27 +01:00
committed by Cody Russell
parent ea7b05024e
commit fe8ad4d746

View File

@@ -1505,6 +1505,36 @@ close_button_clicked (GtkWidget *widget, gpointer data)
gdk_event_free (event);
}
static void
update_window_buttons (GtkWindow *window)
{
GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
if (is_client_side_decorated (window))
{
// XXX: should this be using GdkWMFunction instead?
if (priv->client_side_decorations & GDK_DECOR_MINIMIZE)
{
gtk_widget_show_all (priv->min_button);
}
else
{
gtk_widget_hide (priv->min_button);
}
if (priv->client_side_decorations & GDK_DECOR_MAXIMIZE)
{
gtk_widget_show_all (priv->max_button);
}
else
{
gtk_widget_hide (priv->max_button);
}
// close?
}
}
static void
ensure_title_box (GtkWindow *window)
{
@@ -1552,6 +1582,8 @@ ensure_title_box (GtkWindow *window)
priv->button_box = hbox;
gtk_widget_show_all (priv->button_box);
update_window_buttons (window);
}
}
@@ -3250,6 +3282,8 @@ gtk_window_set_client_side_decorations (GtkWindow *window,
}
}
}
update_window_buttons (window);
}
GdkWMDecoration