If you set GTK_INSPECTOR_RENDERER to the same type of
values that GSK_RENDERER takes this can change the renderer
used for the inspector. This is useful if you're debugging
one renderer and don't want to affect the inspector.
We can e.g. get the entry dispose()d and a focus_out event after that
(because the toplevel unsets the focus which previously was the entry).
We then later use priv->current_pos in a call to pango API which makes
sure the given index is valid for the given layout. Since we lazily
create a GtkEntryBuffer in get_buffer() and a PangoLayout lazily in
gtk_entry_create_layout, these 2 are always valid but don't match
priv->current_pos in this situation.
Fix this by resetting priv->current-pos in dispose().
Since margin-left and margin-right are gone, we don't have to care
about the difference between them and start/end anymore and we can just
save start as left and end as right.
Instead of mentioning the old _get_preferred_xxx functions, mention
measure() and print the for_size value as well. The orientation is given
by printing either "width" for GTK_ORIENTATION_HORIZONTAL or "height"
for GTK_ORIENTATION_VERTICAL.
There are GtkGestureSingle subclasses that can be made to handle multiple
fingers (GtkGestureSingle is a subclass of GtkGesture, and not the
opposite, after all). And GtkGestureSwipe already tries to handle
GDK_TOUCHPAD_SWIPE events, except this event handler silently ignores
those.
Falling back to the GtkGesture generic handler which already
handles touchpad gesture events fixes this.
This reverts commit 901e5ff3a3.
This causes criticals in e.g. the Text View: Multiple Buffers demo.
More work is required to get a fix for Bug 778853 that does not cause
anything else to regress.
https://bugzilla.gnome.org/show_bug.cgi?id=778853
The fact that it doesn’t reuse the existing GtkLabel if present is not
immediately obvious to users (or is it just me?), so clarify that the
pre-existing :label-widget, if any, is always removed and replaced.
POLICY_AUTOMATIC means scrollbars are only shown when needed, i.e. when
the size of the window is not large enough to show the entire child. So
when measuring the preferred size, such scrollbars should be ignored.
But measure() was adding size for bars for which policy_may_be_visible()
was TRUE, which it returns for POLICY_ALWAYS (good) & _AUTOMATIC (bad).
So we reserved space for child plus scrollbars, & because we have enough
space for the child, POLICY_AUTOMATIC hides the scrollbar, leaving the
extra reserved space empty at the right/bottom sides of the child. This
is very noticeable/inconvenient for non-overlay, automatic scrollbars.
Fix this by only requesting size for scrollbars that use POLICY_ALWAYS,
rather than basing the decision on policy_may_be_visible().
https://bugzilla.gnome.org/show_bug.cgi?id=778853
Using Ctrl + left/right to skip between words, or left/right to cancel a
selection, were causing movement on the screen in the opposite direction
of the glyph on the key. This was surprising and awful UX for RTL users.
This is based on a patch covering the former case by:
Author: Mehdi Sadeghi <mehdi@mehdix.org>
Date: Sat Feb 18 02:16:00 2017 +0000
https://bugzilla.gnome.org/show_bug.cgi?id=136059
Using Ctrl + left/right to skip between words, or left/right to cancel a
selection, were causing movement on the screen in the opposite direction
of the glyph on the key. This was surprising and awful UX for RTL users.
This is based on a patch covering the former case by:
Author: Ori Avtalion <ori@avtalion.name>
Date: Tue Apr 20 08:06:23 2010 +0000
https://bugzilla.gnome.org/show_bug.cgi?id=136059
It was "Missing name of pseudo-class", but the real problem is exactly
the opposite: we /have/ been given a name, but it is not a valid one.
Change it to "Invalid name of pseudo-class" to minimise confusion.
the scrollbar passed in better be either priv->hscrollbar or
priv->vscrollbar. Ensure that by using a simple else instead of an
else-if and a g_assert.
When a widget is created, its default scale is the scale of the
primary screen (for instance 2). But once parented to another widget
its scale factor should be the one of its parent (if parented to a
widget on a screen at scale factor 1, it should be 1).
The problem is that we don't emit the notify::scale-factor signal when
reparenting happens.
https://bugzilla.gnome.org/show_bug.cgi?id=776821
gtk_text_iter_backward_line() checks the value of
real->line_char_offset without previously calling
ensure_char_offsets (real) to make sure the former
is up-to-date.
As a consequence of this, when gtk_text_iter_backward_line()
is called after a gtk_text_buffer_insert_range() in the
first line of buffer, the iter is not moved to the start of
the line, and the return value is wrong.
Fixed by adding the ensure_char_offsets() call.
A test case for this bug is added to the textiter gtk testsuite.
priv->trigger_event is never set, so it is always NULL. This means the
gtk_menu_popup*() methods use the current event. The only way to get any
other event to combobox_menu_popup() was from the button-press-event
handler I just removed, which would end up being the current one anyway.
So, bin priv->trigger_event & explicitly pass NULL to gtk_menu_popup*().
gtk_show_uri_on_window() will pass enough information for Portal helpers
to allow dialogue parenting in Flatpak, gtk_show_uri() won't, so
deprecate it.
https://bugzilla.gnome.org/show_bug.cgi?id=778678
We can't pass the same string to two different snapshot states since
removing one of them will free the passed string, so just create another
one for the second state.
Now that priv->area is guaranteed to be constructed by us, and not
passed in by a user, we can move it to the .ui file and stop manually
managing its lifetime altogether. And once the area is there, we can
move the menu there too (and stop pointlessly destroying/rebuilding it).
We already have cell_layout_is_sensitive() to get whether at least one
cell in a Layout is sensitive, which we need because CellLayout/View
do not implement foreach(). So, since we wrote that, we can use it to
check our CellArea too, instead of doing foreach with a custom callback.
It was looping over all items, not breaking out when it found the first
selectable one, and then selecting the _last_ selectable one (if any)
found. So, it did exactly the opposite of its name. This made me quite
baffled when opening a submenu with right-arrow put me at its last item.
Originally, the loop set to_select and broke if the current item was
selectable and not tear-off, meaning that it would correctly select the
first suitable item. However, when tear-off functionality was removed
in commit 4ed9452e90, so was the break.
combo_box_popdown() currently skips popping down our menu if it is NULL.
But the required call to this at end-of-life was in destroy(), by which
point dispose() already NULLed the menu, so Menu::popdown() would never
run, even if it should. Fix this by trying popdown() earlier in unmap().
Also, add a converse assurance that we don’t popup() while not mapped.
Even once we remove all the now-pointless NULL checks, destroy() was the
wrong place to call combo_box_popdown(), and unmap() is the right place.
gtk_init() removed its support for supporting arguments, so we ought to do
likewise for Windows, which actually defines items that call gtk_init()
the old way (and also get rid of argument support in those functions,
since the direction is to not support them).
https://bugzilla.gnome.org/show_bug.cgi?id=773299
Commit fdc0c6426b removed the appears-as-
list style property, & hence the ability to put the ComboBox into list
mode – but it left behind a pile of hijinks that were only used in said
mode & so were now doing absolutely nothing. This commit deletes those.
While doing that, I got carried away…so this also stops pointlessly type
checking popup_widget, as that can never be anything but a GtkTreeMenu.
It still checks for NULL everywhere, which shouldn’t be needed, but (A)
this commit is already too big, & (B) simply removing such checks where
they _seem_ unnecessary causes bad times. I’ll puzzle through that later
Commit fdc0c6426b for removing (partly!)
appears-as-list also deleted the code that propagated wrap-width to the
TreeMenu and thus put us into “grid mode”. This restores that code.
And as Benjamin noted, calling check_appearance() here is wrong, so bye.