Quickly clicking rows should always activate the row if
single-click-activation is enabled. Before, only the first click
(n_press == 1) would activate the row.
Using gtk_widget_insert_before on a complex container
is a *bad* idea; it will mess up the containers bookkeeping
of its children and can easily lead to failure and crashes.
While it's a bit dubious whether array+length annotations should be
marked as "nullable", we do this elsewhere in the API, so might as well
be consistent.
In practice, the array argument is only ever allowed to be NULL iff the
length argument is 0; annotations are static, so if somebody decides to
pass a NULL argument with a non-zero value, they will get a run time
critical error, instead of a compile time one, which is somewhat counter
to the point of annotating the API in the first place.
Fixes: #2923
When claiming a sequence in a gesture signal handler,
the expected result is that GtkGesture::handle-event
returns TRUE, causing the event to not be propagated
further.
This doesn't work for button release events, since
gtk_gesture_handle_event does the following:
add point
emit ::update
remove point
check claimed status
The ::update signal is where the application code
claims the sequence. But removing the point purges
the sequence from the gestures memory, so checking
the claimed status returns FALSE.
This patch fixes things to behave as expected, by
checking the claimed status before removing the point.
With csd, we are handling external widgets when
there is an entry in the headerbar. Use a weak ref
to prevent that pointer from going stale. This fixes
a crash when cancelling a save dialog.
Fixes: #3110
We were doing more iter comparisons than necessary in the
inner loop of gtk_text_layout_snapshot(), in the presence
of a selection. Rewrite the code to compare line numbers
instead, which is faster than full iter comparisons.
When the text says it has handled the event,
trust it. We don't want to emit ::search-started
if the content hasn't changed, but we still
should not propagate e.g. an Insert key press
if it has already toggled overwrite mode in
the text.
Fixes: #2874
Assume that the fully expanded revealer will likely get an allocation
that matches the child's minimum or natural allocation, so we
special-case these two values.
So when - due to the precision loss - multiple sizes would match the
current allocation, we don't pick one at random, we prefer the min and
nat size.
The preference of nat size over min sie was decided after an IRC vote,
we don't actually have an idea what's more likely to happen in the real
world.
Should we ever get better data, we might want to switch.
We use ceil() in measure(), so using it again will increase the
child's size whenever there is even a tiny rounding error.
This should also not make the size too small, because:
min = ceil(child_min * scale)
min / scale >= child_min
floor (min / scale) >= floor (child_min) = child_min
The last equality is because child_min is an integer.
Fixes#3137
After commit 7e77afe94c moved the deletion
of text into the signal handler, in order to make undo work, we need to
override the GtkEntryBuffer::deleted-text class closure when subclassing
GtkEntryBuffer, as well as overriding GtkEntryBufferClass.delete_text,
otherwise the default class closure will be invoked, and will try to
delete an empty buffer.
Fixes: #3140
Use the Windows API CryptProtectMemory() to encrypt the data that we want to
secure, and use CryptUnprotectMemory() to de-crypt the secured data that we
want to access, since mmap() and mlock() are not available on Windows.
We have a widget for password and passphrase entries, but we have no way
to handle the data securely. This is usually performed by a separate
GtkEntryBuffer—for instance, the one in GCR. While we have API for
setting a new entry buffer on GtkText, we don't have API for
GtkPasswordEntry, though, so the options are:
- expose additional API for GtkPasswordEntry to allow setting a secure
text buffer on the internal GtkText widget
- provide a secure text buffer out of the box
Given that an insecure-by-default GtkPasswordEntry is basically
pointless, might as well have a secure buffer built in.
We don't really need to make the password entry buffer public out of the
box, but we can re-evaluate at a later date.
Fixes: #2403
When we start a dnd of the selection in the drag-update handler,
set the gesture state to denied. Otherwise, we get more drag-update
signals, and things get really confused, leading to no dnd and
sadness.
Removed sentence that claimed the view will wrap the model in a
GtkSingleSelection, as it's no longer true. Fixed the code example in
GtkListView for the same reason. Fixed a small typo in GtkDropDown docs.
We were connecting signal handlers to the display
and seats here, and never cleaning them up, leading
to crashes after the inspector is closed. This is
fairly easy to reproduce under Wayland, where the
scroll device is only created the first time we
create a scroll event.
Declarations, definitions, and gtk-doc stanzas should use the same name
for arguments. Otherwise both g-ir-scanner and gtk-doc will complain
that they can't find the argument.
My previous change here was too hasty - this code is not
actually transforming points - it is just a convoluted
way to transform the z axis from child coordinates to
the parent.
Now that both arguments to the _new_with_factory() constructors
are nullable, there's no good reason to keep a separate _new()
around. Just make gtk_list_view_new() and gtk_grid_view_new()
take both a model and a factory.
Replace our uses of graphene_matrix_transform_point,
_point3d and _bounds by our own versions that handle
projective transforms correctly.
This fixes render node bounds being incorrect for widgets
involving projective transforms (e.g. testrevealer swing
transformations), and also fixes picking on such widgets.