diff --git a/SOURCES/0001-Add-man-pages-for-gtk3-demo-and-gtk3-widget-factory.patch b/SOURCES/0001-Add-man-pages-for-gtk3-demo-and-gtk3-widget-factory.patch new file mode 100644 index 0000000..098daad --- /dev/null +++ b/SOURCES/0001-Add-man-pages-for-gtk3-demo-and-gtk3-widget-factory.patch @@ -0,0 +1,181 @@ +From 9af2710d843c9e17459737cb8530abf466a89b9e Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Mon, 19 May 2014 23:20:56 -0400 +Subject: [PATCH] Add man pages for gtk3-demo and gtk3-widget-factory + +We install the applications, so they should also have some docs. +--- + docs/reference/gtk/Makefile.am | 2 + + docs/reference/gtk/gtk-docs.sgml | 2 + + docs/reference/gtk/gtk3-demo.xml | 59 ++++++++++++++++++++++++++++++ + docs/reference/gtk/gtk3-widget-factory.xml | 59 ++++++++++++++++++++++++++++++ + 4 files changed, 122 insertions(+) + create mode 100644 docs/reference/gtk/gtk3-demo.xml + create mode 100644 docs/reference/gtk/gtk3-widget-factory.xml + +diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am +index c488aa0..8f44cc8 100644 +--- a/docs/reference/gtk/Makefile.am ++++ b/docs/reference/gtk/Makefile.am +@@ -151,6 +151,7 @@ content_files = \ + tree_widget.sgml \ + windows.sgml \ + x11.sgml \ ++ gtk3-demo.xml \ + gtk-query-immodules-3.0.xml \ + gtk-update-icon-cache.xml \ + gtk-launch.xml \ +@@ -447,6 +448,7 @@ man_MANS = \ + gtk-query-immodules-3.0.1 \ + gtk-update-icon-cache.1 \ + gtk-launch.1 \ ++ gtk3-demo.1 \ + broadwayd.1 + + if ENABLE_MAN +diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml +index 9353b15..8db7671 100644 +--- a/docs/reference/gtk/gtk-docs.sgml ++++ b/docs/reference/gtk/gtk-docs.sgml +@@ -378,6 +378,8 @@ + + + GTK+ Tools ++ ++ + + + +diff --git a/docs/reference/gtk/gtk3-demo.xml b/docs/reference/gtk/gtk3-demo.xml +new file mode 100644 +index 0000000..47b32f5 +--- /dev/null ++++ b/docs/reference/gtk/gtk3-demo.xml +@@ -0,0 +1,59 @@ ++ ++ ++ ++ ++ ++ gtk3-demo ++ GTK+ ++ ++ ++ Developer ++ Matthias ++ Clasen ++ ++ ++ ++ ++ ++ gtk3-demo ++ 1 ++ User Commands ++ ++ ++ ++ gtk3-demo ++ Demonstrate GTK+ widgets ++ ++ ++ ++ ++gtk3-demo ++--help ++ ++ ++ ++Description ++ ++gtk3-demo is a collection of examples. ++Its purpose is to demonstrate many GTK+ widgets in a form ++that is useful to application developers. ++ ++ ++The application shows the source code for each example, as well as ++other used resources, such as ui files and icons. ++ ++ ++ ++Options ++ The following options are understood: ++ ++ ++ , ++ Show help options ++ ++ ++ ++ ++ +diff --git a/docs/reference/gtk/gtk3-widget-factory.xml b/docs/reference/gtk/gtk3-widget-factory.xml +new file mode 100644 +index 0000000..fa5d21d +--- /dev/null ++++ b/docs/reference/gtk/gtk3-widget-factory.xml +@@ -0,0 +1,59 @@ ++ ++ ++ ++ ++ ++ gtk3-widget-factory ++ GTK+ ++ ++ ++ Developer ++ Matthias ++ Clasen ++ ++ ++ ++ ++ ++ gtk3-widget-factory ++ 1 ++ User Commands ++ ++ ++ ++ gtk3-widget-factory ++ Demonstrate GTK+ widgets ++ ++ ++ ++ ++gtk3-widget-factory ++--help ++ ++ ++ ++Description ++ ++gtk3-widget-factory is a collection of examples. ++Its purpose is to demonstrate many GTK+ widgets in a form ++that is useful to GTK+ theme developers. ++ ++ ++The application shows widgets in different, typical combinations ++and states. ++ ++ ++ ++Options ++ The following options are understood: ++ ++ ++ , ++ Show help options ++ ++ ++ ++ ++ +-- +1.9.3 + diff --git a/SOURCES/0001-GtkExpander-Fix-a-problem-with-resize-toplevel.patch b/SOURCES/0001-GtkExpander-Fix-a-problem-with-resize-toplevel.patch new file mode 100644 index 0000000..51fb18d --- /dev/null +++ b/SOURCES/0001-GtkExpander-Fix-a-problem-with-resize-toplevel.patch @@ -0,0 +1,46 @@ +From 6a214c9bcd78be3814a125d52e4d1eb3ac7d2256 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Thu, 2 Oct 2014 18:02:11 -0400 +Subject: [PATCH] GtkExpander: Fix a problem with resize-toplevel + +The toplevel resizing was not working properly when the +content had non-trivial height-for-width behavior (such +as a wrapping label). +--- + gtk/gtkexpander.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c +index e8bf4b8..030f5a8 100644 +--- a/gtk/gtkexpander.c ++++ b/gtk/gtkexpander.c +@@ -1244,23 +1244,21 @@ gtk_expander_resize_toplevel (GtkExpander *expander) + if (toplevel && gtk_widget_get_realized (toplevel)) + { + GtkAllocation toplevel_allocation; ++ GtkAllocation child_allocation; + + gtk_widget_get_allocation (toplevel, &toplevel_allocation); ++ gtk_widget_get_allocation (child, &child_allocation); + + if (priv->expanded) + { + GtkRequisition child_requisition; + +- gtk_widget_get_preferred_size (child, &child_requisition, NULL); ++ gtk_widget_get_preferred_height_for_width (child, child_allocation.width, &child_requisition.height, NULL); + + toplevel_allocation.height += child_requisition.height; + } + else + { +- GtkAllocation child_allocation; +- +- gtk_widget_get_allocation (child, &child_allocation); +- + toplevel_allocation.height -= child_allocation.height; + } + +-- +1.9.3 + diff --git a/SOURCES/0001-Pull-all-changes-from-gtkcellrenderaccel-c-up-to-3-14-0.patch b/SOURCES/0001-Pull-all-changes-from-gtkcellrenderaccel-c-up-to-3-14-0.patch new file mode 100644 index 0000000..0541825 --- /dev/null +++ b/SOURCES/0001-Pull-all-changes-from-gtkcellrenderaccel-c-up-to-3-14-0.patch @@ -0,0 +1,706 @@ +diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c +index 32f385e..8ea1d86 100644 +--- a/gtk/gtkcellrendereraccel.c ++++ b/gtk/gtkcellrendereraccel.c +@@ -35,16 +35,14 @@ + * @Short_description: Renders a keyboard accelerator in a cell + * @Title: GtkCellRendererAccel + * +- * #GtkCellRendererAccel displays a keyboard accelerator (i.e. a +- * key combination like Controla. +- * If the cell renderer is editable, the accelerator can be changed by +- * simply typing the new combination. ++ * #GtkCellRendererAccel displays a keyboard accelerator (i.e. a key ++ * combination like `Control + a`). If the cell renderer is editable, ++ * the accelerator can be changed by simply typing the new combination. + * + * The #GtkCellRendererAccel cell renderer was added in GTK+ 2.10. + */ + + +- + static void gtk_cell_renderer_accel_get_property (GObject *object, + guint param_id, + GValue *value, +@@ -70,6 +68,9 @@ static gchar *convert_keysym_state_to_string (GtkCellRendererAccel *accel, + guint keysym, + GdkModifierType mask, + guint keycode); ++static GtkWidget *gtk_cell_editable_event_box_new (GtkCellRenderer *cell, ++ GtkCellRendererAccelMode mode, ++ const gchar *path); + + enum { + ACCEL_EDITED, +@@ -78,42 +79,35 @@ enum { + }; + + enum { +- PROP_0, +- PROP_ACCEL_KEY, ++ PROP_ACCEL_KEY = 1, + PROP_ACCEL_MODS, + PROP_KEYCODE, + PROP_ACCEL_MODE + }; + ++static guint signals[LAST_SIGNAL] = { 0 }; ++ + struct _GtkCellRendererAccelPrivate + { +- GtkWidget *edit_widget; +- GtkWidget *grab_widget; + GtkWidget *sizing_label; + +- GdkDevice *grab_keyboard; +- GdkDevice *grab_pointer; +- + GtkCellRendererAccelMode accel_mode; +- + GdkModifierType accel_mods; +- + guint accel_key; + guint keycode; +-}; + +-static guint signals[LAST_SIGNAL] = { 0 }; ++ GdkDevice *grab_keyboard; ++ GdkDevice *grab_pointer; ++}; + + G_DEFINE_TYPE (GtkCellRendererAccel, gtk_cell_renderer_accel, GTK_TYPE_CELL_RENDERER_TEXT) + + static void + gtk_cell_renderer_accel_init (GtkCellRendererAccel *cell_accel) + { + gchar *text; + +- cell_accel->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell_accel, +- GTK_TYPE_CELL_RENDERER_ACCEL, +- GtkCellRendererAccelPrivate); ++ cell_accel->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell_accel, GTK_TYPE_CELL_RENDERER_ACCEL, GtkCellRendererAccelPrivate); + + text = convert_keysym_state_to_string (cell_accel, 0, 0, 0); + g_object_set (cell_accel, "text", text, NULL); +@@ -150,7 +144,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class) + 0, + G_MAXINT, + 0, +- GTK_PARAM_READWRITE)); ++ GTK_PARAM_READWRITE)); + + /** + * GtkCellRendererAccel:accel-mods: +@@ -166,7 +160,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class) + P_("The modifier mask of the accelerator"), + GDK_TYPE_MODIFIER_TYPE, + 0, +- GTK_PARAM_READWRITE)); ++ GTK_PARAM_READWRITE)); + + /** + * GtkCellRendererAccel:keycode: +@@ -185,7 +179,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class) + 0, + G_MAXINT, + 0, +- GTK_PARAM_READWRITE)); ++ GTK_PARAM_READWRITE)); + + /** + * GtkCellRendererAccel:accel-mode: +@@ -204,7 +198,7 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class) + P_("The type of accelerators"), + GTK_TYPE_CELL_RENDERER_ACCEL_MODE, + GTK_CELL_RENDERER_ACCEL_MODE_GTK, +- GTK_PARAM_READWRITE)); ++ GTK_PARAM_READWRITE)); + + /** + * GtkCellRendererAccel::accel-edited: +@@ -307,10 +297,10 @@ convert_keysym_state_to_string (GtkCellRendererAccel *accel, + } + + static void +-gtk_cell_renderer_accel_get_property (GObject *object, +- guint param_id, +- GValue *value, +- GParamSpec *pspec) ++gtk_cell_renderer_accel_get_property (GObject *object, ++ guint param_id, ++ GValue *value, ++ GParamSpec *pspec) + { + GtkCellRendererAccelPrivate *priv = GTK_CELL_RENDERER_ACCEL (object)->priv; + +@@ -338,10 +328,10 @@ gtk_cell_renderer_accel_get_property (GObject *object, + } + + static void +-gtk_cell_renderer_accel_set_property (GObject *object, +- guint param_id, +- const GValue *value, +- GParamSpec *pspec) ++gtk_cell_renderer_accel_set_property (GObject *object, ++ guint param_id, ++ const GValue *value, ++ GParamSpec *pspec) + { + GtkCellRendererAccel *accel = GTK_CELL_RENDERER_ACCEL (object); + GtkCellRendererAccelPrivate *priv = accel->priv; +@@ -357,6 +347,7 @@ gtk_cell_renderer_accel_set_property (GObject *object, + { + priv->accel_key = accel_key; + changed = TRUE; ++ g_object_notify (object, "accel-key"); + } + } + break; +@@ -369,6 +360,7 @@ gtk_cell_renderer_accel_set_property (GObject *object, + { + priv->accel_mods = accel_mods; + changed = TRUE; ++ g_object_notify (object, "accel-mods"); + } + } + break; +@@ -380,12 +372,17 @@ gtk_cell_renderer_accel_set_property (GObject *object, + { + priv->keycode = keycode; + changed = TRUE; ++ g_object_notify (object, "keycode"); + } + } + break; + + case PROP_ACCEL_MODE: +- priv->accel_mode = g_value_get_enum (value); ++ if (priv->accel_mode != g_value_get_enum (value)) ++ { ++ priv->accel_mode = g_value_get_enum (value); ++ g_object_notify (object, "accel-mode"); ++ } + break; + + default: +@@ -403,10 +402,10 @@ gtk_cell_renderer_accel_set_property (GObject *object, + } + + static void +-gtk_cell_renderer_accel_get_preferred_width (GtkCellRenderer *cell, +- GtkWidget *widget, +- gint *minimum_size, +- gint *natural_size) ++gtk_cell_renderer_accel_get_preferred_width (GtkCellRenderer *cell, ++ GtkWidget *widget, ++ gint *minimum_size, ++ gint *natural_size) + + { + GtkCellRendererAccelPrivate *priv = GTK_CELL_RENDERER_ACCEL (cell)->priv; +@@ -427,16 +424,165 @@ gtk_cell_renderer_accel_get_preferred_width (GtkCellRenderer *cell, + *natural_size = MAX (*natural_size, nat_req.width); + } + +-static gboolean +-grab_key_callback (GtkWidget *widget, +- GdkEventKey *event, +- GtkCellRendererAccel *accel) ++static GtkCellEditable * ++gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, ++ GdkEvent *event, ++ GtkWidget *widget, ++ const gchar *path, ++ const GdkRectangle *background_area, ++ const GdkRectangle *cell_area, ++ GtkCellRendererState flags) ++{ ++ GtkCellRendererAccelPrivate *priv; ++ GtkCellRendererText *celltext; ++ GtkCellRendererAccel *accel; ++ GtkStyleContext *context; ++ GdkRGBA color; ++ GtkWidget *label; ++ GtkWidget *eventbox; ++ gboolean editable; ++ GdkDevice *device, *keyboard, *pointer; ++ guint32 timestamp; ++ GdkWindow *window; ++ ++ celltext = GTK_CELL_RENDERER_TEXT (cell); ++ accel = GTK_CELL_RENDERER_ACCEL (cell); ++ priv = accel->priv; ++ ++ /* If the cell isn't editable we return NULL. */ ++ g_object_get (celltext, "editable", &editable, NULL); ++ if (!editable) ++ return NULL; ++ ++ window = gtk_widget_get_window (gtk_widget_get_toplevel (widget)); ++ ++ if (event) ++ device = gdk_event_get_device (event); ++ else ++ device = gtk_get_current_event_device (); ++ ++ if (!device || !window) ++ return NULL; ++ ++ if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) ++ { ++ keyboard = device; ++ pointer = gdk_device_get_associated_device (device); ++ } ++ else ++ { ++ pointer = device; ++ keyboard = gdk_device_get_associated_device (device); ++ } ++ ++ timestamp = gdk_event_get_time (event); ++ ++ if (gdk_device_grab (keyboard, window, ++ GDK_OWNERSHIP_WINDOW, FALSE, ++ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, ++ NULL, timestamp) != GDK_GRAB_SUCCESS) ++ return NULL; ++ ++ if (gdk_device_grab (pointer, window, ++ GDK_OWNERSHIP_WINDOW, FALSE, ++ GDK_BUTTON_PRESS_MASK, ++ NULL, timestamp) != GDK_GRAB_SUCCESS) ++ { ++ gdk_device_ungrab (keyboard, timestamp); ++ return NULL; ++ } ++ ++ priv->grab_keyboard = keyboard; ++ priv->grab_pointer = pointer; ++ ++ eventbox = gtk_cell_editable_event_box_new (cell, priv->accel_mode, path); ++ ++ label = gtk_label_new (NULL); ++ gtk_widget_set_halign (label, GTK_ALIGN_START); ++ gtk_widget_set_valign (label, GTK_ALIGN_CENTER); ++ ++ context = gtk_widget_get_style_context (widget); ++ gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color); ++ gtk_widget_override_background_color (eventbox, 0, &color); ++ ++ gtk_style_context_get_color (context, GTK_STATE_FLAG_SELECTED, &color); ++ gtk_widget_override_color (label, 0, &color); ++ ++ /* This label is displayed in a treeview cell displaying ++ * an accelerator when the cell is clicked to change the ++ * acelerator. ++ */ ++ gtk_label_set_text (GTK_LABEL (label), _("New accelerator…")); ++ ++ gtk_container_add (GTK_CONTAINER (eventbox), label); ++ ++ gtk_widget_show_all (eventbox); ++ gtk_grab_add (eventbox); ++ ++ return GTK_CELL_EDITABLE (eventbox); ++} ++ ++static void ++gtk_cell_renderer_accel_ungrab (GtkCellRendererAccel *accel) + { + GtkCellRendererAccelPrivate *priv = accel->priv; ++ ++ if (priv->grab_keyboard) ++ { ++ gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); ++ gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); ++ priv->grab_keyboard = NULL; ++ priv->grab_pointer = NULL; ++ } ++} ++ ++/* --------------------------------- */ ++ ++typedef struct _GtkCellEditableEventBox GtkCellEditableEventBox; ++typedef GtkEventBoxClass GtkCellEditableEventBoxClass; ++ ++struct _GtkCellEditableEventBox ++{ ++ GtkEventBox box; ++ gboolean editing_canceled; ++ GtkCellRendererAccelMode accel_mode; ++ gchar *path; ++ GtkCellRenderer *cell; ++}; ++ ++enum { ++ PROP_EDITING_CANCELED = 1, ++ PROP_MODE, ++ PROP_PATH ++}; ++ ++G_GNUC_INTERNAL GType gtk_cell_editable_event_box_get_type (void); ++static void gtk_cell_editable_event_box_cell_editable_init (GtkCellEditableIface *iface); ++ ++G_DEFINE_TYPE_WITH_CODE (GtkCellEditableEventBox, gtk_cell_editable_event_box, GTK_TYPE_EVENT_BOX, ++ G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_EDITABLE, gtk_cell_editable_event_box_cell_editable_init)) ++ ++static void ++gtk_cell_editable_event_box_start_editing (GtkCellEditable *cell_editable, ++ GdkEvent *event) ++{ ++ /* do nothing, because we are pointless */ ++} ++ ++static void ++gtk_cell_editable_event_box_cell_editable_init (GtkCellEditableIface *iface) ++{ ++ iface->start_editing = gtk_cell_editable_event_box_start_editing; ++} ++ ++static gboolean ++gtk_cell_editable_event_box_key_press_event (GtkWidget *widget, ++ GdkEventKey *event) ++{ ++ GtkCellEditableEventBox *box = (GtkCellEditableEventBox*)widget; + GdkModifierType accel_mods = 0; + guint accel_key; + guint keyval; +- gchar *path; + gboolean edited; + gboolean cleared; + GdkModifierType consumed_modifiers; +@@ -479,7 +625,7 @@ grab_key_callback (GtkWidget *widget, + + /* Filter consumed modifiers + */ +- if (priv->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK) ++ if (box->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK) + accel_mods &= ~consumed_modifiers; + + /* Put shift back if it changed the case of the key, not otherwise. +@@ -491,105 +637,51 @@ grab_key_callback (GtkWidget *widget, + { + switch (keyval) + { +- case GDK_KEY_Escape: +- goto out; /* cancel */ + case GDK_KEY_BackSpace: +- /* clear the accelerator on Backspace */ + cleared = TRUE; ++ /* fall thru */ ++ case GDK_KEY_Escape: + goto out; + default: + break; + } + } + +- if (priv->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK) ++ if (box->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK && ++ !gtk_accelerator_valid (accel_key, accel_mods)) + { +- if (!gtk_accelerator_valid (accel_key, accel_mods)) +- { +- gtk_widget_error_bell (widget); +- +- return TRUE; +- } ++ gtk_widget_error_bell (widget); ++ return TRUE; + } + + edited = TRUE; + + out: +- gtk_device_grab_remove (priv->grab_widget, priv->grab_pointer); +- gdk_device_ungrab (priv->grab_keyboard, event->time); +- gdk_device_ungrab (priv->grab_pointer, event->time); +- +- path = g_strdup (g_object_get_data (G_OBJECT (priv->edit_widget), "gtk-cell-renderer-text")); +- +- gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (priv->edit_widget)); +- gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (priv->edit_widget)); +- priv->edit_widget = NULL; +- priv->grab_widget = NULL; +- priv->grab_keyboard = NULL; +- priv->grab_pointer = NULL; ++ gtk_grab_remove (widget); ++ gtk_cell_renderer_accel_ungrab (GTK_CELL_RENDERER_ACCEL (box->cell)); ++ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (widget)); ++ gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (widget)); + + if (edited) +- g_signal_emit (accel, signals[ACCEL_EDITED], 0, path, ++ g_signal_emit (box->cell, signals[ACCEL_EDITED], 0, box->path, + accel_key, accel_mods, event->hardware_keycode); + else if (cleared) +- g_signal_emit (accel, signals[ACCEL_CLEARED], 0, path); +- +- g_free (path); ++ g_signal_emit (box->cell, signals[ACCEL_CLEARED], 0, box->path); + + return TRUE; + } + + static void +-ungrab_stuff (GtkWidget *widget, +- GtkCellRendererAccel *accel) +-{ +- GtkCellRendererAccelPrivate *priv = accel->priv; +- +- gtk_device_grab_remove (priv->grab_widget, priv->grab_pointer); +- gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); +- gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); +- +- priv->grab_keyboard = NULL; +- priv->grab_pointer = NULL; +- +- g_signal_handlers_disconnect_by_func (priv->grab_widget, +- G_CALLBACK (grab_key_callback), +- accel); +-} +- +-static void +-_gtk_cell_editable_event_box_start_editing (GtkCellEditable *cell_editable, +- GdkEvent *event) ++gtk_cell_editable_event_box_unrealize (GtkWidget *widget) + { +- /* do nothing, because we are pointless */ +-} ++ GtkCellEditableEventBox *box = (GtkCellEditableEventBox*)widget; + +-static void +-_gtk_cell_editable_event_box_cell_editable_init (GtkCellEditableIface *iface) +-{ +- iface->start_editing = _gtk_cell_editable_event_box_start_editing; ++ gtk_grab_remove (widget); ++ gtk_cell_renderer_accel_ungrab (GTK_CELL_RENDERER_ACCEL (box->cell)); ++ ++ GTK_WIDGET_CLASS (gtk_cell_editable_event_box_parent_class)->unrealize (widget); + } + +-typedef struct _GtkCellEditableEventBox GtkCellEditableEventBox; +-typedef GtkEventBoxClass GtkCellEditableEventBoxClass; +- +-struct _GtkCellEditableEventBox +-{ +- GtkEventBox box; +- gboolean editing_canceled; +-}; +- +-GType _gtk_cell_editable_event_box_get_type (void); +- +-G_DEFINE_TYPE_WITH_CODE (GtkCellEditableEventBox, _gtk_cell_editable_event_box, GTK_TYPE_EVENT_BOX, { \ +- G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_EDITABLE, _gtk_cell_editable_event_box_cell_editable_init) \ +- }) +- +-enum { +- PROP_ZERO, +- PROP_EDITING_CANCELED +-}; +- + static void + gtk_cell_editable_event_box_set_property (GObject *object, + guint prop_id, +@@ -603,6 +695,12 @@ gtk_cell_editable_event_box_set_property (GObject *object, + case PROP_EDITING_CANCELED: + box->editing_canceled = g_value_get_boolean (value); + break; ++ case PROP_MODE: ++ box->accel_mode = g_value_get_enum (value); ++ break; ++ case PROP_PATH: ++ box->path = g_value_dup_string (value); ++ break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; +@@ -622,6 +720,12 @@ gtk_cell_editable_event_box_get_property (GObject *object, + case PROP_EDITING_CANCELED: + g_value_set_boolean (value, box->editing_canceled); + break; ++ case PROP_MODE: ++ g_value_set_enum (value, box->accel_mode); ++ break; ++ case PROP_PATH: ++ g_value_set_string (value, box->path); ++ break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; +@@ -629,134 +733,61 @@ gtk_cell_editable_event_box_get_property (GObject *object, + } + + static void +-_gtk_cell_editable_event_box_class_init (GtkCellEditableEventBoxClass *class) ++gtk_cell_editable_event_box_finalize (GObject *object) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS (class); ++ GtkCellEditableEventBox *box = (GtkCellEditableEventBox*)object; + +- gobject_class->set_property = gtk_cell_editable_event_box_set_property; +- gobject_class->get_property = gtk_cell_editable_event_box_get_property; ++ g_free (box->path); + +- g_object_class_override_property (gobject_class, +- PROP_EDITING_CANCELED, +- "editing-canceled"); ++ G_OBJECT_CLASS (gtk_cell_editable_event_box_parent_class)->finalize (object); + } + + static void +-_gtk_cell_editable_event_box_init (GtkCellEditableEventBox *box) +-{ +-} +- +-static GtkCellEditable * +-gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, +- GdkEvent *event, +- GtkWidget *widget, +- const gchar *path, +- const GdkRectangle *background_area, +- const GdkRectangle *cell_area, +- GtkCellRendererState flags) ++gtk_cell_editable_event_box_class_init (GtkCellEditableEventBoxClass *class) + { +- GtkCellRendererAccelPrivate *priv; +- GtkCellRendererText *celltext; +- GtkCellRendererAccel *accel; +- GtkStyleContext *context; +- GdkRGBA color; +- GtkWidget *label; +- GtkWidget *eventbox; +- GdkDevice *device, *keyb, *pointer; +- GdkWindow *window; +- gboolean editable; +- guint32 time; +- +- celltext = GTK_CELL_RENDERER_TEXT (cell); +- accel = GTK_CELL_RENDERER_ACCEL (cell); +- priv = accel->priv; +- +- /* If the cell isn't editable we return NULL. */ +- g_object_get (celltext, "editable", &editable, NULL); +- if (editable == FALSE) +- return NULL; +- +- window = gtk_widget_get_window (widget); +- context = gtk_widget_get_style_context (widget); +- +- g_return_val_if_fail (window != NULL, NULL); +- +- if (event) +- device = gdk_event_get_device (event); +- else +- device = gtk_get_current_event_device (); +- +- if (!device) +- return NULL; +- +- if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) +- { +- keyb = device; +- pointer = gdk_device_get_associated_device (device); +- } +- else +- { +- pointer = device; +- keyb = gdk_device_get_associated_device (device); +- } +- +- time = gdk_event_get_time (event); +- +- if (gdk_device_grab (keyb, window, +- GDK_OWNERSHIP_WINDOW, FALSE, +- GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, +- NULL, time) != GDK_GRAB_SUCCESS) +- return NULL; +- +- if (gdk_device_grab (pointer, window, +- GDK_OWNERSHIP_WINDOW, FALSE, +- GDK_BUTTON_PRESS_MASK, +- NULL, time) != GDK_GRAB_SUCCESS) +- { +- gdk_device_ungrab (keyb, time); +- return NULL; +- } ++ GObjectClass *object_class = G_OBJECT_CLASS (class); ++ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); + +- priv->grab_keyboard = keyb; +- priv->grab_pointer = pointer; +- priv->grab_widget = widget; ++ object_class->finalize = gtk_cell_editable_event_box_finalize; ++ object_class->set_property = gtk_cell_editable_event_box_set_property; ++ object_class->get_property = gtk_cell_editable_event_box_get_property; + +- g_signal_connect (G_OBJECT (widget), "key-press-event", +- G_CALLBACK (grab_key_callback), +- accel); ++ widget_class->key_press_event = gtk_cell_editable_event_box_key_press_event; ++ widget_class->unrealize = gtk_cell_editable_event_box_unrealize; + +- eventbox = g_object_new (_gtk_cell_editable_event_box_get_type (), NULL); +- priv->edit_widget = eventbox; +- g_object_add_weak_pointer (G_OBJECT (priv->edit_widget), +- (gpointer) &priv->edit_widget); +- +- label = gtk_label_new (NULL); +- gtk_widget_set_halign (label, GTK_ALIGN_START); +- gtk_widget_set_valign (label, GTK_ALIGN_CENTER); ++ g_object_class_override_property (object_class, ++ PROP_EDITING_CANCELED, ++ "editing-canceled"); + +- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color); +- gtk_widget_override_background_color (eventbox, 0, &color); ++ g_object_class_install_property (object_class, PROP_MODE, ++ g_param_spec_enum ("accel-mode", NULL, NULL, ++ GTK_TYPE_CELL_RENDERER_ACCEL_MODE, ++ GTK_CELL_RENDERER_ACCEL_MODE_GTK, ++ GTK_PARAM_READWRITE)); + +- gtk_style_context_get_color (context, GTK_STATE_FLAG_SELECTED, &color); +- gtk_widget_override_color (label, 0, &color); ++ g_object_class_install_property (object_class, PROP_PATH, ++ g_param_spec_string ("path", NULL, NULL, ++ NULL, GTK_PARAM_READWRITE)); ++} + +- /* This label is displayed in a treeview cell displaying +- * an accelerator when the cell is clicked to change the +- * acelerator. +- */ +- gtk_label_set_text (GTK_LABEL (label), _("New accelerator…")); ++static void ++gtk_cell_editable_event_box_init (GtkCellEditableEventBox *box) ++{ ++ gtk_widget_set_can_focus (GTK_WIDGET (box), TRUE); ++} + +- gtk_container_add (GTK_CONTAINER (eventbox), label); +- +- g_object_set_data_full (G_OBJECT (priv->edit_widget), "gtk-cell-renderer-text", +- g_strdup (path), g_free); +- +- gtk_widget_show_all (priv->edit_widget); ++static GtkWidget * ++gtk_cell_editable_event_box_new (GtkCellRenderer *cell, ++ GtkCellRendererAccelMode mode, ++ const gchar *path) ++{ ++ GtkCellEditableEventBox *box; + +- gtk_device_grab_add (priv->grab_widget, pointer, TRUE); ++ box = g_object_new (gtk_cell_editable_event_box_get_type (), ++ "accel-mode", mode, ++ "path", path, ++ NULL); ++ box->cell = cell; + +- g_signal_connect (priv->edit_widget, "unrealize", +- G_CALLBACK (ungrab_stuff), accel); +- +- return GTK_CELL_EDITABLE (priv->edit_widget); ++ return GTK_WIDGET (box); + } diff --git a/SOURCES/0001-menu-Do-a-proper-min-height-request.patch b/SOURCES/0001-menu-Do-a-proper-min-height-request.patch new file mode 100644 index 0000000..38187fa --- /dev/null +++ b/SOURCES/0001-menu-Do-a-proper-min-height-request.patch @@ -0,0 +1,53 @@ +--- a/gtk/gtkmenu.c ++++ b/gtk/gtkmenu.c +@@ -3237,18 +3237,21 @@ + gint *minimum_size, + gint *natural_size) + { +- GtkBorder padding; ++ GtkBorder padding, arrow_border; + GtkMenu *menu = GTK_MENU (widget); + GtkMenuPrivate *priv = menu->priv; ++ GdkScreen *screen; ++ GdkRectangle monitor; + guint *min_heights, *nat_heights; + guint border_width; + gint n_heights, i; +- gint min_height, nat_height; ++ gint min_height, single_height, nat_height; + + border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); + get_menu_padding (widget, &padding); + + min_height = nat_height = (2 * border_width) + padding.top + padding.bottom; ++ single_height = 0; + + n_heights = + calculate_line_heights (menu, for_size, &min_heights, &nat_heights); +@@ -3256,16 +3259,21 @@ + for (i = 0; i < n_heights; i++) + { + min_height += min_heights[i]; ++ single_height = MAX (single_height, min_heights[i]); + nat_height += nat_heights[i]; + } + +- if (priv->have_position) +- { +- GdkScreen *screen = gtk_widget_get_screen (priv->toplevel); +- GdkRectangle monitor; ++ screen = gtk_widget_get_screen (priv->toplevel); ++ gdk_screen_get_monitor_workarea (screen, MAX (priv->monitor_num, 0), &monitor); + +- gdk_screen_get_monitor_workarea (screen, priv->monitor_num, &monitor); ++ get_arrows_border (menu, &arrow_border); ++ single_height += (2 * border_width) ++ + padding.top + padding.bottom ++ + arrow_border.top + arrow_border.bottom; ++ min_height = MIN (min_height, MAX (monitor.height, single_height)); + ++ if (priv->have_position) ++ { + if (priv->position_y + min_height > monitor.y + monitor.height) + min_height = monitor.y + monitor.height - priv->position_y; + \ No newline at end of file diff --git a/SOURCES/0001-treemodelfilter-Fix-using-wrong-path-on-row-deleted.patch b/SOURCES/0001-treemodelfilter-Fix-using-wrong-path-on-row-deleted.patch new file mode 100644 index 0000000..d082fdd --- /dev/null +++ b/SOURCES/0001-treemodelfilter-Fix-using-wrong-path-on-row-deleted.patch @@ -0,0 +1,31 @@ +From 5c019bde1518cfda59797b7c0f74094cd67d96bf Mon Sep 17 00:00:00 2001 +From: Olivier Brunel +Date: Thu, 16 Jan 2014 15:23:20 +0100 +Subject: [PATCH] treemodelfilter: Fix using wrong path on row-deleted + +A "typo" led to using a wrong GtkTreePath when converting the path of the +virtual root to check the ancestors, which would lead to either no checks being +performed, or maybe segfaulting when using an invalid path as result. + +https://bugzilla.gnome.org/show_bug.cgi?id=722058 +Signed-off-by: Olivier Brunel +--- + gtk/gtktreemodelfilter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c +index 7e4a871..8844d9f 100644 +--- a/gtk/gtktreemodelfilter.c ++++ b/gtk/gtktreemodelfilter.c +@@ -2693,7 +2693,7 @@ gtk_tree_model_filter_row_deleted (GtkTreeModel *c_model, + GtkTreePath *real_path; + + real_path = gtk_tree_model_filter_remove_root (c_path, +- filter->priv->root); ++ filter->priv->virtual_root); + if (real_path) + { + gtk_tree_model_filter_check_ancestors (filter, real_path); +-- +2.1.0 + diff --git a/SOURCES/0002-docs-Fix-make-dist.patch b/SOURCES/0002-docs-Fix-make-dist.patch new file mode 100644 index 0000000..af7b422 --- /dev/null +++ b/SOURCES/0002-docs-Fix-make-dist.patch @@ -0,0 +1,32 @@ +From 0c4dc3c15702a8daff58e63211235d91ec19b32e Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz +Date: Tue, 20 May 2014 08:11:44 +0200 +Subject: [PATCH] docs: Fix make dist + +--- + docs/reference/gtk/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am +index 8f44cc8..8206452 100644 +--- a/docs/reference/gtk/Makefile.am ++++ b/docs/reference/gtk/Makefile.am +@@ -152,6 +152,7 @@ content_files = \ + windows.sgml \ + x11.sgml \ + gtk3-demo.xml \ ++ gtk3-widget-factory.xml \ + gtk-query-immodules-3.0.xml \ + gtk-update-icon-cache.xml \ + gtk-launch.xml \ +@@ -449,6 +450,7 @@ man_MANS = \ + gtk-update-icon-cache.1 \ + gtk-launch.1 \ + gtk3-demo.1 \ ++ gtk3-widget-factory.1 \ + broadwayd.1 + + if ENABLE_MAN +-- +1.9.3 + diff --git a/SOURCES/0003-docs-Add-a-man-page-fro-gtk3-demo-application.patch b/SOURCES/0003-docs-Add-a-man-page-fro-gtk3-demo-application.patch new file mode 100644 index 0000000..2405a40 --- /dev/null +++ b/SOURCES/0003-docs-Add-a-man-page-fro-gtk3-demo-application.patch @@ -0,0 +1,98 @@ +From 3cfd54ec6726e61096c6f37430d7fe75323db9e3 Mon Sep 17 00:00:00 2001 +From: Benjamin Otte +Date: Fri, 3 Oct 2014 16:15:10 +0200 +Subject: [PATCH] docs: Add a man page fro gtk3-demo-application + +It is an installed binary, so it needs a man page! +--- + docs/reference/gtk/Makefile.am | 2 ++ + docs/reference/gtk/gtk-docs.sgml | 1 + + docs/reference/gtk/gtk3-demo-application.xml | 44 ++++++++++++++++++++++++++++ + 3 files changed, 47 insertions(+) + create mode 100644 docs/reference/gtk/gtk3-demo-application.xml + +diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am +index 968384c..0e94062 100644 +--- a/docs/reference/gtk/Makefile.am ++++ b/docs/reference/gtk/Makefile.am +@@ -152,6 +152,7 @@ content_files = \ + windows.sgml \ + x11.sgml \ + gtk3-demo.xml \ ++ gtk3-demo-application.xml \ + gtk3-widget-factory.xml \ + gtk-query-immodules-3.0.xml \ + gtk-update-icon-cache.xml \ +@@ -338,6 +339,7 @@ man_MANS = \ + gtk-update-icon-cache.1 \ + gtk-launch.1 \ + gtk3-demo.1 \ ++ gtk3-demo-application.1 \ + gtk3-widget-factory.1 \ + broadwayd.1 + +diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml +index e3956d6..ad448fb 100644 +--- a/docs/reference/gtk/gtk-docs.sgml ++++ b/docs/reference/gtk/gtk-docs.sgml +@@ -395,6 +395,7 @@ + + GTK+ Tools + ++ + + + +diff --git a/docs/reference/gtk/gtk3-demo-application.xml b/docs/reference/gtk/gtk3-demo-application.xml +new file mode 100644 +index 0000000..f7a9694 +--- /dev/null ++++ b/docs/reference/gtk/gtk3-demo-application.xml +@@ -0,0 +1,44 @@ ++ ++ ++ ++ ++ ++ gtk3-demo-application ++ GTK+ ++ ++ ++ Developer ++ Matthias ++ Clasen ++ ++ ++ ++ ++ ++ gtk3-demo-application ++ 1 ++ User Commands ++ ++ ++ ++ gtk3-demo-application ++ Demonstrate GtkApplication ++ ++ ++ ++ ++gtk3-demo-application ++ ++ ++ ++Description ++ ++gtk3-demo-application is an example application ++used by gtk3-demo. There is no need to call it ++manually. ++ ++ ++ ++ +-- +1.9.3 + diff --git a/SPECS/gtk3.spec b/SPECS/gtk3.spec index 266be09..3128dec 100644 --- a/SPECS/gtk3.spec +++ b/SPECS/gtk3.spec @@ -16,7 +16,7 @@ Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X Name: gtk3 Version: 3.8.8 -Release: 5%{?dist} +Release: 10%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -34,6 +34,23 @@ Patch3: translations.patch Patch4: 0001-window-Sanitize-size-hint-computation.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=982295 +Patch5: 0001-GtkExpander-Fix-a-problem-with-resize-toplevel.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=948432 +Patch6: 0001-Add-man-pages-for-gtk3-demo-and-gtk3-widget-factory.patch +Patch7: 0002-docs-Fix-make-dist.patch +Patch8: 0003-docs-Add-a-man-page-fro-gtk3-demo-application.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1090126 +Patch9: 0001-Pull-all-changes-from-gtkcellrenderaccel-c-up-to-3-14-0.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1062938 +Patch10: 0001-menu-Do-a-proper-min-height-request.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1150290 +Patch11: 0001-treemodelfilter-Fix-using-wrong-path-on-row-deleted.patch + BuildRequires: gnome-common autoconf automake intltool gettext BuildRequires: atk-devel >= %{atk_version} BuildRequires: at-spi2-atk-devel @@ -138,6 +155,13 @@ widget toolkit. %patch2 -p1 %patch3 -p2 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 %build @@ -245,6 +269,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache %ghost %{_libdir}/gtk-3.0/%{bin_version}/immodules.cache %{_mandir}/man1/gtk-query-immodules-3.0* %{_mandir}/man1/gtk-launch.1.gz +%{_mandir}/man1/gtk3-demo.1.gz +%{_mandir}/man1/gtk3-demo-application.1.gz +%{_mandir}/man1/gtk3-widget-factory.1.gz %exclude %{_mandir}/man1/gtk-update-icon-cache.1.gz %{_datadir}/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml %{_datadir}/glib-2.0/schemas/org.gtk.Settings.ColorChooser.gschema.xml @@ -285,6 +312,28 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache %{_datadir}/gtk-doc %changelog +* Tue Dec 16 2014 Benjamin Otte - 3.8.8-10 +- Don't accidentally export function +- Resolves: #1168685 + +* Fri Oct 31 2014 Benjamin Otte - 3.8.8-9 +- Don't crash when alt-tabbing in gedit +- Resolves: #1150290 + +* Mon Oct 20 2014 Benjamin Otte - 3.8.8-8 +- Fix breakage introduced by patch +- Resolves: #1090126 + +* Sun Oct 05 2014 Benjamin Otte - 3.8.8-7 +- Fix height request on labels +- Resolves: #1062938 + +* Fri Oct 03 2014 Benjamin Otte - 3.8.8-6 +- Properly resize toplevel when collapsing GtkExpander +- Add missing man pages +- Allow remapping all keys +- Resolves: #982295, #948432, #1090126 + * Fri Jan 24 2014 Daniel Mach - 3.8.8-5 - Mass rebuild 2014-01-24