Compare commits

...

20 Commits

Author SHA1 Message Date
Matthias Clasen
1ed442180d 3.18.2 2015-10-12 13:42:40 -04:00
Benjamin Otte
8342724022 stylecontext: Make sure style is valid when looking up style properties
Otherwise, the validation may happen vey automatically some time during
the style property and that will most likely cause a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=756338
2015-10-12 13:26:24 -04:00
Felipe Borges
78a59caed9 gtkprintoperation: job names must not exceed 255 chars
According to http://datatracker.ietf.org/doc/rfc2911/, The 'name'
attribute syntax is essentially the same as 'text', including the
REQUIRED support of UTF-8 except that the sequence of characters
is limited so that its encoded form MUST NOT exceed 255 (MAX) octets.

CUPS will not print jobs with names exceeding 255 characters.

https://bugzilla.gnome.org/show_bug.cgi?id=755988
2015-10-12 13:26:06 -04:00
Matthias Clasen
5d70f4bd44 color chooser: Render icons sharp at scale 2
We need to load the icons at the right scale, and render them
to a surface with the right scale too.

https://bugzilla.gnome.org/show_bug.cgi?id=756195
2015-10-12 13:25:22 -04:00
Carlos Soriano
c1b1e41ddb gtkfilesystem: protect against null filesystem type
The filesystem:type attribute could be NULL, then g_strv_contains
will crash if that happens.
Just don't call it if the attribute is not set.
2015-10-12 13:25:07 -04:00
Sébastien Wilmet
a8dc876e02 textiter: fix bug in _gtk_text_btree_get_iter_at_last_toggle()
If the last tag toggle is the end iter, the function returned the wrong
tag toggle.

This resulted in some bugs where the view wasn't relayout/redrawn
correctly.

The function also always returned TRUE, probably because the return
value is used nowhere. But for consistency with
_gtk_text_btree_get_iter_at_first_toggle(), it's better to keep the
return value, and also because otherwise the function would be wrong (it
doesn't always return a tag toggle, if there is none).

https://bugzilla.gnome.org/show_bug.cgi?id=755413
2015-10-12 13:24:35 -04:00
Timm Bäder
7394270efa GtkPopover: Don't apply shape on wayland
Popovers are subsurfaces on wayland so we don't need that, and the shape
messed up hidpi popovers there.
2015-10-12 13:24:20 -04:00
Jonas Ådahl
cbc8d4a88a wayland: Don't ignore wl_keyboard.leave if surface is gone
keyboard_handle_leave() might be called with a NULL surface resource
(for example if the surface was destroyed after the event was sent). If
so, we should still deal with the keyboard focus lost event, otherwise
we will both leak (the keyboard_focus GdkWindow reference) and miss
stopping the key repeat timer.

https://bugzilla.gnome.org/show_bug.cgi?id=755927
2015-10-12 13:23:31 -04:00
Christoph Reiter
da2f672c11 Fix accessibility not getting initialized in gtk_init() if a default display is already set
_gtk_accessibility_init() only gets called if the default
display changes, but in case gdk_init() is called before gtk_init()
the default display is already set and no property notification occurs.

This can happen quite easily in pygobject where
"from gi.repository import Gdk, Gtk"
will call gdk_init() followed by gtk_init() in the Python overrides.

This fixes it by checking for a default display in all cases.
2015-10-12 13:23:11 -04:00
Rafal Luzynski
ca9440c21e flowbox: correct the behavior with "can-focus"==FALSE
In fact there were two issues:

1. GtkFlowBoxChild with "can-focus"==FALSE should pass the focus
to its child immediately.
2. GtkFlowBox with "can-focus"==FALSE should cease its custom keynav
implementation and fall back to the default GtkContainer behavior
which is more natural.

Thanks to these changes the flow box can act as a better replacement
for GtkGrid and similar containers.

https://bugzilla.gnome.org/show_bug.cgi?id=753371
2015-10-12 13:22:09 -04:00
Chun-wei Fan
bd46d285d3 MSVC builds: Fix "install"
Use $(GlibEtcInstallRoot) when invoking glib-compile-schemas, as CopyDir
is not GlibInstallRoot for GTK+ (due to quoting issues), meaning that the
glib-compile-schemas tool may not be found in certain cases.

Issue pointed out by Ignacio Casal Quinteiro.
2015-10-12 23:24:33 +08:00
Ignacio Casal Quinteiro
3b0056ae1a win32: use the same parameter name as the implementation 2015-10-12 12:23:31 +02:00
Jiri Grönroos
d19b3d2c74 Updated Finnish translation 2015-10-05 17:07:38 +00:00
Jiri Grönroos
47cee3521a Updated Finnish translation 2015-10-05 17:04:41 +00:00
Matthias Clasen
b06cb4b9d1 assistant: Deal with spontaneous page disappearance
Removing pages from the assistant with gtk_widget_destroy() used
to work. It broke with the recent interposition of a box between
each page and the notebook. Fix this by cleaning up when the box
child is removed.

https://bugzilla.gnome.org/show_bug.cgi?id=756042
2015-10-05 08:22:40 -04:00
Wolfgang Stöggl
f561bdb3eb Updated German translation 2015-10-04 11:37:40 +00:00
Christian Kirbach
d4e644ec52 Updated German translation 2015-10-04 09:13:09 +00:00
Matthias Clasen
ee856fd30d Add a test for gtk_style_context_list_classes
This test failed before the previous commit.
2015-10-03 20:42:57 -04:00
Matthias Clasen
b9d4591949 Fix gtk_style_context_list_classes
The function was always returning NULL.
2015-10-03 20:42:42 -04:00
Matthias Clasen
e1ec1497a8 switch: Unclip the slider shadow
This commit arranges things so the shadow of the slider can
extend outside the widget, even if the switch itself has no
shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=755791
2015-10-03 20:42:31 -04:00
21 changed files with 2233 additions and 2011 deletions

17
NEWS
View File

@@ -1,3 +1,20 @@
Overview of Changes in GTK+ 3.18.2
==================================
* Bug fixes:
753371 Bad focus order in GtkFlowBox
755413 Bug in _gtk_text_btree_get_iter_at_last_toggle()
755791 GtkSwitch: unclip css box-shadow on the slider
755927 Occasional "stuck key" after closing window using keyboard shortcut...
755988 gtk printer dialog won't print jobs with names exceeding 255 charac...
756042 GtkAssistant: Segfault after g_object_run_dispose(page)
756195 GtkColorChooser: Plus/checkmark icons are blurry in hidpi
756338 applications segfaults on 3.18.1 when using external themes
* Translation updates:
Finnish
German
Overview of Changes in GTK+ 3.18.1
==================================

View File

@@ -109,7 +109,7 @@ copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\gli
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas
echo "Compiling gsettings XML Files..."
$(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
</GtkDoInstall>
<GtkDoInstallBroadwayHeaders>
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk

View File

@@ -112,7 +112,7 @@ copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\s
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
echo &quot;Compiling gsettings XML Files...&quot;&#x0D;&#x0A;
$(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
"
/>
<UserMacro

View File

@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [18])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [1])
m4_define([gtk_micro_version], [2])
m4_define([gtk_interface_age], [2])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],

View File

@@ -1191,15 +1191,14 @@ keyboard_handle_leave (void *data,
GdkEvent *event;
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
if (!device->keyboard_focus)
return;
/* gdk_window_is_destroyed() might already return TRUE for
* device->keyboard_focus here, which would happen if we destroyed the
* window before loosing keyboard focus.
*/
stop_key_repeat (device);
_gdk_wayland_display_update_serial (display, serial);

View File

@@ -29,7 +29,7 @@
/**
* gdk_win32_display_set_cursor_theme:
* @display: (type GdkWin32Display): a #GdkDisplay
* @theme: (allow-none) the name of the cursor theme to use, or %NULL to unset
* @name: (allow-none) the name of the cursor theme to use, or %NULL to unset
* a previously set value
* @size: the cursor size to use, or 0 to keep the previous size
*

View File

@@ -52,7 +52,7 @@ GType gdk_win32_display_get_type (void);
GDK_AVAILABLE_IN_3_18
void gdk_win32_display_set_cursor_theme (GdkDisplay *display,
const gchar *theme,
const gchar *name,
gint size);
G_END_DECLS

View File

@@ -88,6 +88,7 @@ struct _GtkAssistantPage
gchar *title;
GtkWidget *box;
GtkWidget *page;
GtkWidget *regular_title;
GtkWidget *current_title;
@@ -184,7 +185,7 @@ static void on_assistant_cancel (GtkWidget *wid
GtkAssistant *assistant);
static void on_assistant_last (GtkWidget *widget,
GtkAssistant *assistant);
static void assistant_remove_page_cb (GtkNotebook *notebook,
static void assistant_remove_page_cb (GtkContainer *container,
GtkWidget *page,
GtkAssistant *assistant);
@@ -1113,7 +1114,7 @@ on_page_notify_visibility (GtkWidget *widget,
}
static void
assistant_remove_page_cb (GtkNotebook *notebook,
assistant_remove_page_cb (GtkContainer *container,
GtkWidget *page,
GtkAssistant *assistant)
{
@@ -1122,15 +1123,6 @@ assistant_remove_page_cb (GtkNotebook *notebook,
GList *page_node;
GList *element;
if (GTK_IS_BOX (page))
{
GList *children;
children = gtk_container_get_children (GTK_CONTAINER (page));
page = GTK_WIDGET (children->data);
g_list_free (children);
}
element = find_page (assistant, page);
if (!element)
return;
@@ -1367,7 +1359,7 @@ find_page (GtkAssistant *assistant,
while (child)
{
GtkAssistantPage *page_info = child->data;
if (page_info->page == page)
if (page_info->page == page || page_info->box == page)
return child;
child = child->next;
@@ -1816,9 +1808,12 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
gtk_widget_show (box);
gtk_box_pack_start (GTK_BOX (box), page, TRUE, TRUE, 0);
g_object_set (box, "margin", 12, NULL);
g_signal_connect (box, "remove", G_CALLBACK (assistant_remove_page_cb), assistant);
gtk_notebook_insert_page (GTK_NOTEBOOK (priv->content), box, NULL, position);
page_info->box = box;
if (gtk_widget_get_mapped (GTK_WIDGET (assistant)))
{
update_buttons_state (assistant);
@@ -2415,7 +2410,7 @@ gtk_assistant_set_page_has_padding (GtkAssistant *assistant,
{
page_info->has_padding = has_padding;
g_object_set (gtk_widget_get_parent (page),
g_object_set (page_info->box,
"margin", has_padding ? 12 : 0,
NULL);

View File

@@ -118,6 +118,7 @@ swatch_draw (GtkWidget *widget,
GtkBorder border, padding;
GdkRectangle rect;
GtkIconInfo *icon_info = NULL;
gint scale;
theme = gtk_icon_theme_get_default ();
context = gtk_widget_get_style_context (widget);
@@ -168,11 +169,13 @@ swatch_draw (GtkWidget *widget,
gtk_render_frame (context, cr, 0, 0, width, height);
scale = gtk_widget_get_scale_factor (widget);
if (swatch->priv->icon)
{
icon_info = gtk_icon_theme_lookup_icon (theme, swatch->priv->icon, PIXBUF_SIZE,
GTK_ICON_LOOKUP_GENERIC_FALLBACK
| GTK_ICON_LOOKUP_USE_BUILTIN);
icon_info = gtk_icon_theme_lookup_icon_for_scale (theme, swatch->priv->icon, PIXBUF_SIZE,
scale,
GTK_ICON_LOOKUP_GENERIC_FALLBACK
| GTK_ICON_LOOKUP_USE_BUILTIN);
}
else if ((state & GTK_STATE_FLAG_SELECTED) != 0)
{
@@ -182,9 +185,10 @@ swatch_draw (GtkWidget *widget,
/* fallback for themes that don't have object-select-symbolic */
g_themed_icon_append_name (G_THEMED_ICON (gicon), "gtk-apply");
icon_info = gtk_icon_theme_lookup_by_gicon (theme, gicon, PIXBUF_SIZE,
GTK_ICON_LOOKUP_GENERIC_FALLBACK
| GTK_ICON_LOOKUP_USE_BUILTIN);
icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, gicon, PIXBUF_SIZE,
scale,
GTK_ICON_LOOKUP_GENERIC_FALLBACK
| GTK_ICON_LOOKUP_USE_BUILTIN);
g_object_unref (gicon);
}
@@ -206,14 +210,16 @@ swatch_draw (GtkWidget *widget,
{
GdkPixbuf *pixbuf;
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info, context,
NULL, NULL);
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info, context, NULL, NULL);
if (pixbuf != NULL)
{
gtk_render_icon (context, cr, pixbuf,
rect.x + (rect.width - gdk_pixbuf_get_width (pixbuf)) / 2,
rect.y + (rect.height - gdk_pixbuf_get_height (pixbuf)) / 2);
cairo_surface_t *surface;
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, gtk_widget_get_window (widget));
gtk_render_icon_surface (context, cr, surface,
rect.x + (rect.width - (gdk_pixbuf_get_width (pixbuf) / scale)) / 2,
rect.y + (rect.height - (gdk_pixbuf_get_height (pixbuf) / scale)) / 2);
cairo_surface_destroy (surface);
g_object_unref (pixbuf);
}

View File

@@ -947,7 +947,10 @@ _gtk_file_consider_as_remote (GFile *file)
const gchar *type;
type = g_file_info_get_attribute_string (info, "filesystem::type");
is_remote = g_strv_contains (remote_types, type);
if (type != NULL)
is_remote = g_strv_contains (remote_types, type);
else
is_remote = FALSE;
g_object_unref (info);
}

View File

@@ -292,6 +292,23 @@ gtk_flow_box_child_focus (GtkWidget *widget,
child = gtk_bin_get_child (GTK_BIN (widget));
/* Without "can-focus" flag try to pass the focus to the child immediately */
if (!gtk_widget_get_can_focus (widget))
{
if (child)
{
if (gtk_widget_child_focus (child, direction))
{
GtkFlowBox *box;
box = gtk_flow_box_child_get_box (GTK_FLOW_BOX_CHILD (widget));
if (box)
gtk_flow_box_update_cursor (box, GTK_FLOW_BOX_CHILD (widget));
return TRUE;
}
}
return FALSE;
}
g_object_get (widget, "has-focus", &had_focus, NULL);
if (had_focus)
{
@@ -3193,6 +3210,12 @@ gtk_flow_box_focus (GtkWidget *widget,
GSequenceIter *iter;
GtkFlowBoxChild *next_focus_child;
/* Without "can-focus" flag fall back to the default behavior immediately */
if (!gtk_widget_get_can_focus (widget))
{
return GTK_WIDGET_CLASS (gtk_flow_box_parent_class)->focus (widget, direction);
}
focus_child = gtk_container_get_focus_child (GTK_CONTAINER (box));
next_focus_child = NULL;
@@ -3313,7 +3336,7 @@ gtk_flow_box_toggle_cursor_child (GtkFlowBox *box)
gtk_flow_box_select_and_activate (box, priv->cursor_child);
}
static void
static gboolean
gtk_flow_box_move_cursor (GtkFlowBox *box,
GtkMovementStep step,
gint count)
@@ -3331,6 +3354,10 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
GtkAdjustment *adjustment;
gboolean vertical;
/* Without "can-focus" flag fall back to the default behavior immediately */
if (!gtk_widget_get_can_focus (GTK_WIDGET (box)))
return FALSE;
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
if (vertical)
@@ -3479,17 +3506,25 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
if (!gtk_widget_keynav_failed (GTK_WIDGET (box), direction))
{
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
if (toplevel)
gtk_widget_child_focus (toplevel,
direction == GTK_DIR_UP ?
GTK_DIR_TAB_BACKWARD :
GTK_DIR_TAB_FORWARD);
return FALSE;
}
return;
return TRUE;
}
/* If the child has its "can-focus" property set to FALSE then it will
* not grab the focus. We must pass the focus to its child directly.
*/
if (!gtk_widget_get_can_focus (GTK_WIDGET (child)))
{
GtkWidget *subchild;
subchild = gtk_bin_get_child (GTK_BIN (child));
if (subchild)
{
GtkDirectionType direction = count < 0 ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD;
gtk_widget_child_focus (subchild, direction);
}
}
get_current_selection_modifiers (GTK_WIDGET (box), &modify, &extend);
@@ -3497,6 +3532,7 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
gtk_flow_box_update_cursor (box, child);
if (!modify)
gtk_flow_box_update_selection (box, child, FALSE, extend);
return TRUE;
}
/* Selection {{{2 */
@@ -3845,8 +3881,6 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
* The ::move-cursor signal is a
* [keybinding signal][GtkBindingSignal]
* which gets emitted when the user initiates a cursor movement.
* If the cursor is not visible in @text_view, this signal causes
* the viewport to be moved instead.
*
* Applications should not connect to it, but may emit it with
* g_signal_emit_by_name() if they need to control the cursor
@@ -3859,14 +3893,17 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
* - Arrow keys move by individual children
* - Home/End keys move to the ends of the box
* - PageUp/PageDown keys move vertically by pages
*
* Returns: %TRUE to stop other handlers from being invoked for the event.
* %FALSE to propagate the event further.
*/
signals[MOVE_CURSOR] = g_signal_new (I_("move-cursor"),
GTK_TYPE_FLOW_BOX,
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkFlowBoxClass, move_cursor),
NULL, NULL,
_gtk_marshal_VOID__ENUM_INT,
G_TYPE_NONE, 2,
_gtk_marshal_BOOLEAN__ENUM_INT,
G_TYPE_BOOLEAN, 2,
GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT);
/**
* GtkFlowBox::select-all:

View File

@@ -61,7 +61,7 @@ struct _GtkFlowBoxClass
void (*selected_children_changed) (GtkFlowBox *box);
void (*activate_cursor_child) (GtkFlowBox *box);
void (*toggle_cursor_child) (GtkFlowBox *box);
void (*move_cursor) (GtkFlowBox *box,
gboolean (*move_cursor) (GtkFlowBox *box,
GtkMovementStep step,
gint count);
void (*select_all) (GtkFlowBox *box);

View File

@@ -698,6 +698,8 @@ static void
do_post_parse_initialization (int *argc,
char ***argv)
{
GdkDisplayManager *display_manager;
if (gtk_initialized)
return;
@@ -737,7 +739,11 @@ do_post_parse_initialization (int *argc,
_gtk_modules_init (argc, argv, NULL);
}
g_signal_connect (gdk_display_manager_get (), "notify::default-display",
display_manager = gdk_display_manager_get ();
if (gdk_display_manager_get_default_display (display_manager) != NULL)
_gtk_accessibility_init ();
g_signal_connect (display_manager, "notify::default-display",
G_CALLBACK (default_display_notify_cb),
NULL);
}

View File

@@ -871,6 +871,11 @@ gtk_popover_update_shape (GtkPopover *popover)
GdkWindow *win;
cairo_t *cr;
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
return;
#endif
win = gtk_widget_get_window (widget);
surface =
gdk_window_create_similar_surface (win,

View File

@@ -1606,6 +1606,7 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
const gchar *job_name)
{
GtkPrintOperationPrivate *priv;
gchar *end;
g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
g_return_if_fail (job_name != NULL);
@@ -1613,7 +1614,25 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
priv = op->priv;
g_free (priv->job_name);
priv->job_name = g_strdup (job_name);
/*
* according to http://datatracker.ietf.org/doc/rfc2911/,
* job names MUST NOT exceed 255 (MAX) octets.
*
* CUPS will not print jobs with names exceeding 255 chars.
*/
if (strlen (job_name) > 255)
{
end = g_utf8_find_prev_char (job_name, job_name + 255);
priv->job_name = g_utf8_substring (job_name,
0,
g_utf8_pointer_to_offset (job_name,
end));
}
else
{
priv->job_name = g_strdup (job_name);
}
g_object_notify (G_OBJECT (op), "job-name");
}

View File

@@ -1402,9 +1402,9 @@ gtk_style_context_list_classes (GtkStyleContext *context)
classes = gtk_css_node_list_classes (priv->cssnode, &n_classes);
for (i = n_classes; i-- > n_classes;)
for (i = n_classes; i > 0; i--)
{
quark_str = g_quark_to_string (classes[i]);
quark_str = g_quark_to_string (classes[i - 1]);
classes_list = g_list_prepend (classes_list, (gchar *) quark_str);
}
@@ -1621,6 +1621,9 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context,
priv = context->priv;
/* ensure the style cache is valid by forcing a validation */
gtk_style_context_lookup_style (context);
key.widget_type = widget_type;
key.pspec = pspec;

View File

@@ -52,6 +52,8 @@
#include "a11y/gtkswitchaccessible.h"
#include "gtkactionhelper.h"
#include "gtkwidgetprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkstylecontextprivate.h"
#include "fallback-c89.c"
@@ -447,6 +449,9 @@ gtk_switch_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkStyleContext *context;
GtkBorder extents;
GtkAllocation clip;
gtk_widget_set_allocation (widget, allocation);
@@ -457,7 +462,26 @@ gtk_switch_size_allocate (GtkWidget *widget,
allocation->width,
allocation->height);
_gtk_widget_set_simple_clip (widget, NULL);
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
_gtk_css_shadows_value_get_extents (_gtk_style_context_peek_property (context,
GTK_CSS_PROPERTY_BOX_SHADOW),
&extents);
gtk_style_context_restore (context);
clip = *allocation;
clip.x -= extents.left;
clip.y -= extents.top;
clip.width += extents.left + extents.right;
clip.height += extents.top + extents.bottom;
_gtk_widget_set_simple_clip (widget, &clip);
}
static void

View File

@@ -5648,14 +5648,21 @@ _gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree,
GtkTextIter *iter,
GtkTextTag *tag)
{
gboolean found;
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (tree != NULL, FALSE);
_gtk_text_btree_get_end_iter (tree, iter);
gtk_text_iter_backward_to_tag_toggle (iter, tag);
if (gtk_text_iter_toggles_tag (iter, tag))
found = TRUE;
else
found = gtk_text_iter_backward_to_tag_toggle (iter, tag);
check_invariants (iter);
return TRUE;
return found;
}
gboolean

File diff suppressed because it is too large Load Diff

601
po/fi.po

File diff suppressed because it is too large Load Diff

View File

@@ -366,6 +366,46 @@ test_widget_path_parent (void)
g_object_unref (context);
}
static void
test_style_classes (void)
{
GtkStyleContext *context;
GList *classes;
context = gtk_style_context_new ();
classes = gtk_style_context_list_classes (context);
g_assert_null (classes);
gtk_style_context_add_class (context, "A");
classes = gtk_style_context_list_classes (context);
g_assert (classes);
g_assert_null (classes->next);
g_assert_cmpstr (classes->data, ==, "A");
g_list_free (classes);
gtk_style_context_add_class (context, "B");
classes = gtk_style_context_list_classes (context);
g_assert (classes);
g_assert_cmpstr (classes->data, ==, "A");
g_assert (classes->next);
g_assert_cmpstr (classes->next->data, ==, "B");
g_assert_null (classes->next->next);
g_list_free (classes);
gtk_style_context_remove_class (context, "A");
classes = gtk_style_context_list_classes (context);
g_assert (classes);
g_assert_null (classes->next);
g_assert_cmpstr (classes->data, ==, "B");
g_list_free (classes);
g_object_unref (context);
}
int
main (int argc, char *argv[])
{
@@ -379,6 +419,7 @@ main (int argc, char *argv[])
g_test_add_func ("/style/invalidate-saved", test_invalidate_saved);
g_test_add_func ("/style/set-widget-path-saved", test_set_widget_path_saved);
g_test_add_func ("/style/widget-path-parent", test_widget_path_parent);
g_test_add_func ("/style/classes", test_style_classes);
return g_test_run ();
}