in gtkimcontextsimple and gtktreeview, which are the easy places,
but also true bugfixes, because on OSX we can't use the virtual META
here, we needs MOD2 as delivered in key events.
gobject_introspection's G-ir-scanner doesn't like the -xobjective-c
option needed to compile ObjectiveC features in quartz implementations
of certain gtk functions. This rearranges the compiler flag environment
variables in Makefile so that G-ir-scanner doesn't see them.
This fixes bug 653289, in gtk+-2 gtk_tree_view_stop_editing() was previously
responsible for notifying with gtk_cell_editable_editing_done(), this detail
was missed when porting the cell renderer management to GtkCellArea.
This bug is resolved by fixing two things in
gtk_tree_model_filter_row_deleted():
(1) It is possible for an elt to have elt->visible_siter == NULL, when
it is deleted. Only call g_sequence_remove() if this pointer is
non-NULL.
(2) For the case len (level->seq) > 1, free the elt->children level
if non-NULL. Failing to do this means the level will stick around.
If this child level was not referenced, it will still have a zero
ref count on its parent which cannot be removed!
For both bugs unit tests have been added in the preceding commit.
This tests a case where gtk_tree_model_filter_row_changed() is run
for a node with visible_siter != NULL, however its parent has
visible_iter == NULL. For this case, no valid paths can be generated
as the node cannot be accessed (because the parent is invisible).
Thanks to Kean Johnston for pointing this out.
There are a few places in GTK that use "struct stat",
and then g_stat(), rather than using GStatBuf.This breaks things on
Windows. Since the size of struct stat can vary depending on other
flags specified, this has the potential to cause overwrites and is
trivial to fix.
Based on patch submitted by Kean Johnston
Shut up valgrind complaining about uninitialized values
==5330== Conditional jump or move depends on uninitialised value(s)
==5330== at 0x624FF4C: gdk_window_move_resize_internal
(gdkwindow.c:6037)
==5330== by 0x62502C3: gdk_window_move_resize (gdkwindow.c:6274)
==5330== by 0x5E4FBB5: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2169)
==5330== by 0x5E3846B: gtk_tree_view_size_allocate_columns
(gtktreeview.c:2631)
==5330== by 0x5E43D76: gtk_tree_view_size_allocate
(gtktreeview.c:2686)
==5330== by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330== by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330== by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330== by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330== by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330== by 0x5D94ADD: gtk_scrolled_window_allocate_child
(gtkscrolledwindow.c:1506)
==5330== by 0x5D95299: gtk_scrolled_window_size_allocate
(gtkscrolledwindow.c:1704)
==5330== by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330== by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330== by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330== by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330== by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330== by 0x5C62708: gtk_box_size_allocate (gtkbox.c:658)
==5330== by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330== by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330== Uninitialised value was created by a stack allocation
==5330== at 0x5E4FA8D: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2139)
When we use the style context to get information for the tab region,
also add a style class to indicate its position, so that the relevant
information is pulled off from the theme.
https://bugzilla.gnome.org/show_bug.cgi?id=659777
This is useful to e.g. theme notebook tabs differently according to
their position directly from the CSS sheet.
GtkNotebook support in a separate commit.
https://bugzilla.gnome.org/show_bug.cgi?id=659777
The setter for this was deprecated in 2.x and removed in 3.0.
I don't see any reason why we should hardcode 2px for this value;
instead, deprecated the getter and make it always return zero, and stop
using the variables internally.
https://bugzilla.gnome.org/show_bug.cgi?id=659777
The code before was basically adding and removing the same padding value
in two different places during the allocation cycle.
Instead, what we want to do is to offset the inactive tab allocation by
the difference with the active tab padding, to ensure the tab content is
always drawn centered and in the right position.
https://bugzilla.gnome.org/show_bug.cgi?id=659777
We want to enable the use of different padding values between active and
inactive tabs, so that the two are completely separated (but limited by
the active tab size).
This way themes can decide how bigger the active tab is drawn compared
to the normal one just specifying a different padding value from the
CSS, like this:
.notebook tab {
padding: 2;
}
.notebook tab:active {
padding: 4;
}
As a first step, fetch the padding values with the right state flags
from GtkStyleContext.
https://bugzilla.gnome.org/show_bug.cgi?id=659777
Add enum GdkModifierIntent which identifies use cases for modifier masks
and GdkKeyMap::get_modifier_mask(). Add a default implementation which returns
what is currently hardcoded all over GTK+, and an implementation in the
quartz backend. Also add gtk_widget_get_modifier_mask() which simplifies
things by doing widget->display->keymap->get_modifier_mask().
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
Introduce <Primary> in accelerator strings, which resolves to
GDK_CONTROL_MASK on X11/Win23, and to GDK_META_MASK on quartz.
Also serialize CONTROL/META as <Primary> depending on the platform.
Use foreach() instead of forall() to find the child's siblings
because internal children of subclasses have no sibling relation
to the box' children. Also deal with the subclass failing to
implement get_path_for_child(). This caused an infinite widget
path invalidation loop of sorts with GimpMessageBox, which is a
vertical box with a decorative icon to the left.
Fixes#640741 - gtk_tree_view_column_get_cell_position() seems to be broken
It is supposed to return the offset within the column, but returned
the offset within the tree, changed by allocation.x of the column's
button (which I don't really unserstand and was clearly not working).
The handling of the module lists is a bit confusing here. There is
a global list that is populated with initial modules from GTK_MODULES,
and then there is a second list that is suppposed to hold the modules
loaded from the gtk-modules xsetting, which we attach to the GtkSettings
object. The blacklisting caused us to put the wrong modules into the
second list, and mess up the module refcounts, eventually double-freeing
memory when the setting changes repeatedly.
https://bugzilla.gnome.org/show_bug.cgi?id=659966
The following assertion was triggered in model_row_inserted() because
iterate_thru_children() modifies the parameter tree_model before passing it to
traverse_cells().
Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed
The stack with the bug was:
#0 gtk_tree_path_compare at gtktreemodel.c
#1 traverse_cells at gtktreeviewaccessible.c
#2 model_row_inserted at gtktreeviewaccessible.c
This patch calls iterate_thru_children() with a copy of the path so that the
original is not modified.
This way, all rows have the same height. It has 3 advantages:
1) No actual computation is necessary to compute the size of the cell.
This speeds up the list tremendously (filling out the list goes from
25s to 3s).
2) Buggy fonts don't mess up the list anymore with their weird sizes.
Instead, they are clipped / empty space is added.
3) Buggy fonts look more buggy. So their use is hopefully discouraged.
With absolute sizes, Pango is way better at getting the actual sizes of
the fonts to match up. It's a bit harder to compute a proper value for
this, whcih makes the code ugly, but as long as it works better...
This way, we can find fonts way quicker as we only need to create font
descriptions for fonts with matching families. Most importantly, we're
rather quick in the "the font doesn't exist" case.
Name it gtk_font_chooser_widget_load_fonts(). Also, don't take any
arguments, they were the same everywhere and they're member variables of
the font chooser anyway.
Instead of reloading the font list, we now just queue a redraw. This
works, because the preview text is added using a cell data func instead
of a custom column.
... which looks up the font in the list of fonts. This then can be used
to select an actual font upon changes.
Also fixes cases where the get_family() and get_face() functions would
return outdated data when set_font() had been called.
They now go through gtk_font_chooser_widget_take_font_desc(). The end
goal is to make all changes go through this function, so that all
updates that are happening are easy to track.
Another change is that the code now merges the font description instead
of just using the new one. This avoids weird situations when people set
the font "Bold" for example, which has neither a size nor a font family.
... instead of rereading all the fonts every time.
With this change, the liststore now contains every font face known to
GTK, so we can actually walk it for matching fonts.
- Don't do unnecessary casts
- Fix weird variable declaration indenting
- Fix loop indentation
- Use a for loop for iterating over a list, instead of a while loop
- Casefold font name only once, instead of every iteration
- Remove needless true_var = true_var && TRUE assignment
Render GtkIconView cell items with the prelight state flag when they're
being mouse hovered.
This works basically in the same way it's done for GtkTreeView cells,
and e.g. GtkCellRendererPixbuf will need to have its follow-state
property to opt in to prelight rendering.
https://bugzilla.gnome.org/show_bug.cgi?id=615501
The setter for the "font" property returned a boolean that indicated
whether the given font has been found. Instead, fall back to the default
font name when the given font doesn't exist.
GtkFontButton already has a property named "font-name" which may
conflict / be an ABI break when moving GtkFontButton to implement
GtkFontChooser. Also, this is more in line with how other parts in
gtk (e.g. GtkCellRendererText) call a font string property.
Make the GtkFontChooser API similar to the Gtk{File,Recent,App}Chooser
APIs by introducing GtkFontChooser as an interface, that has a default
implementation in GtkFontChooserWidget.
https://bugzilla.gnome.org/show_bug.cgi?id=657627
We simply use the Tracker DBus api here, caching and direct
access that come with libtracker-sparql are probably not needed
here. Based on a patch by Martyn Russell.
https://bugzilla.gnome.org/show_bug.cgi?id=658272
gtk_tree_model_filter_free_level() should always release ref on parent
unless the parent has been removed in the child model. The unit tests
added in the previous commit test this.