Commit 60ea9cad authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Add a new property, role, corresponding to gtk_window_[gs]et_role().

2003-03-31  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkwindow.c: Add a new property, role, corresponding to
	gtk_window_[gs]et_role().  (#93904)
parent 6db39098
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
......
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
......
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
......
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
......
2003-03-31 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c: Add a new property, role, corresponding to
gtk_window_[gs]et_role(). (#93904)
Sun Mar 30 03:57:42 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
......
......@@ -59,6 +59,7 @@ enum {
/* Normal Props */
PROP_TITLE,
PROP_ROLE,
PROP_ALLOW_SHRINK,
PROP_ALLOW_GROW,
PROP_RESIZABLE,
......@@ -468,6 +469,14 @@ gtk_window_class_init (GtkWindowClass *klass)
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ROLE,
g_param_spec_string ("role",
_("Window Role"),
_("Unique identifier for the window to be used when restoring a session"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ALLOW_SHRINK,
g_param_spec_boolean ("allow_shrink",
......@@ -759,6 +768,9 @@ gtk_window_set_property (GObject *object,
case PROP_TITLE:
gtk_window_set_title (window, g_value_get_string (value));
break;
case PROP_ROLE:
gtk_window_set_role (window, g_value_get_string (value));
break;
case PROP_ALLOW_SHRINK:
window->allow_shrink = g_value_get_boolean (value);
gtk_widget_queue_resize (GTK_WIDGET (window));
......@@ -833,6 +845,9 @@ gtk_window_get_property (GObject *object,
case PROP_TYPE:
g_value_set_enum (value, window->type);
break;
case PROP_ROLE:
g_value_set_string (value, window->wm_role);
break;
case PROP_TITLE:
g_value_set_string (value, window->title);
break;
......@@ -1044,12 +1059,14 @@ gtk_window_set_role (GtkWindow *window,
if (role == window->wm_role)
return;
g_free (window->wm_role);
window->wm_role = g_strdup (role);
if (GTK_WIDGET_REALIZED (window))
g_warning ("gtk_window_set_role(): shouldn't set role after window is realized!\n");
gdk_window_set_role (GTK_WIDGET (window)->window, window->wm_role);
g_object_notify (G_OBJECT (window), "role");
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment