Notifications are not going to be emitted during the finalization, and
GObject will warn if you try to acquire and release a reference to the
notification queue when the reference count of an object has reached
zero.
Fixes: #5420
Recommend that scope implementations should fall
back to or derive from GtkBuilderCScope in order
to not lose GTK's type-guessing machinery.
Related: #5398
Nested async calls are always a challenge.
Hopefully, things are straightened out now,
and we report GTK_DIALOG_ERROR errors for
the cases we care about.
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller. The ::release handler is in
GtkColumnViewTitle. We can't claim the event in the
existing handlers because then the ::release handler will
never get called. Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
Active state is handled by main now. It appears that listitem and
treeexpander handled it manually (probably before main did). This
is unnecessary now, so let's remove it.
If the anchor is below the expanded item, the expanded item will
go out of view if there are sufficient children items. This is not
ideal, so make sure to scroll to the item to ensure it remains in
view.
With the introduction of the hide-expander property, I noticed that
the active state would persist in many cases because the release
signal was never emitted. In gtk3 tree expanders, expanded
on release. gtk4 expanded on press to match window explorer.
Per irc chat, the designers didn't have a strong preference
for press or release. In order to keep consistency and
fix this bug, let's move back to release.
We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.
gtk_widget_set_visible and gtk_window_present
are better alternatives, and calling gtk_widget_show
on newly created widgets is no longer necessary
anyway.
With GtkText and GtkTextView (and in extension, all their subclasses)
handling OSK activation activation, this gesture is only useful for
all text input widgets that are not subclasses of these 2 widgets,
e.g. the VTEs and crosswords of the world.
These still do need a hand in handling OSK activation, so only
set up the gesture for such cases.
If the ::release handler is invoked, the press/release happened without
drags in between. Additionally check that there is no selection at all.
This makes OSK invoked on taps that move the caret around, while tapping
in the selection invokes edition popup and text handles without bringing
in the OSK.
This way, the drag gesture lets the click gesture ::release handler
happen if there was no actual changes to the selected text (i.e.
too short drags). This matches the ::release handler behavior match
the situations in which the OSK was being invoked by the wayland
GtkIMContext.
If the ::release handler is invoked, the press/release happened without
drags in between. Additionally check that the press did not happen within
the selection, and that there is no selection at all.
This makes OSK invoked on taps that move the caret around, while tapping
in the selection invokes edition popup and text handles without bringing
in the OSK.
This way, the drag gesture lets the click gesture ::release handler
happen if there was no actual changes to the selected text (i.e.
too short drags). This matches the ::release handler behavior match
the situations in which the OSK was being invoked by the wayland
GtkIMContext.
This method is so far private for both external GtkIMContext
implementations and external GtkIMContext users, and is meant
to activate the OSK in the environments where this may happen.
GTK depends on the a11y infrastructure to be in place unless GTK_A11Y is
set to none. It appears that despite that, users attempt to
get around the a11y requirement without setting GTK_A11Y.
This can cause, amongst other issues, performance problems
with gtk applications. Log failure to connect to the a11y
bus.
this allows setting a Gtk.GestureStylus to a state, where it can be
used to handle non-stylus devices (e.g. mice).
This might be useful for applications that handle stylus input, but
want to allow falling back to a mice, if the user is unable to provide
stylus input.
Even though button 1 (or touch down) presses do most often have
an effect in one way or another (starting drag, moving focus,
starting selection, ...), there is one situation that they do
immediately nothing: When clicking on the entry does not move
the text caret around. Dragging might start a selection, but
the entry did not do anything just yet, and an immediate
button/touch release should remain at "did nothing".
And that is precisely the hint that the Wayland IM context's click
gesture takes, clicks that do not scroll nor move the caret around,
having the GtkText not claim the gesture in that situation makes
the IM gesture able to do its thing without in-fighting.
This is typically not a problem when the GtkText is embedded in
another GtkEditable implementation (e.g. GtkEntry), since the
IM gesture is inactive and capturing from the parent widget, so
gets a pass that it otherwise doesn't get when both gestures are
in the same widget. This makes it work regardless of GtkText not
being a child of a composite widget, like NautilusQueryEditor
and AdwRowEntry.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5351
Everybody (including myself) gets this wrong,
so accept 'simple' and 'none' as shorthands
for the official IDs 'gtk-im-context-simple'
and 'gtk-im-context-none'.
Noticed this while reviewing the gi-docgen docs for GtkAspectFrame while developing some java bindings.
It's my understanding that @self was intended; as it would cause gi-docgen to interpret it as a reference to
the the GtkAspectFrame pointer named 'self'.
8455b9ac74 seems to have introduced a problem where we can wind
up focusing no widget at all if the `while (parent)` loop doesn't
find a widget it can successfully move the focus to. This 'fixes'
that by falling back to doing the previous thing if we make it
all the way through that loop without moving the focus. Thanks to
@coreyberla for a hint to improve the implementation.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
These are being replaced by GtkFileDialog.
This commit only moves the headers for GtkFileChooserWidget and
GtkFileChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFileChooserWindow.
It is getting replaced by GtkAlertDialog
This commit only moves the header to deprecated/,
and keeps the implementation in gtk/, since it will
eventually be salvaged into a private, dialog-free
widget.
These are being replaced by GtkFontDialog
and GtkFontDialogButton
This commit only moves the headers for GtkFontChooserWidget and
GtkFontChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFontChooserWindow.
These are being replaced by GtkColorDialog
and GtkColorDialogButton.
This commit only moves the headers for GtkColorChooserWidget
and GtkColorChooserDialog to deprecated/, and keeps the
implementations in gtk/, since they will eventually be
salvaged into a private GtkColorChooserWindow.
We need the padding inside the filelistcell, so that
its event controllers cover the whole area.
Introduce a .complex style class for columnviews that
achieves that, and make the filechooser use it.
The build breaks with a C4013 warning/error on Visual Studio because we don't
have a prototype defined for _gtk_get_datadir(), so include gtkprivate.h.
The vs2017-x64 CI did not catch this error because it is building GLib as a
fallback subproject, causing the msvc_recommended_pragmas.h header not to be
found, which is used to detect problems like this.
The tracker search engine implementation was not
setting all the custom attributes that we require
now.
The quartz search engine will need similar fixes.
These settings existed before, we keep using them.
This loses some information about sorting by multiple
columns, but it is sufficient to get the same primary
sort column back.
The "Show Time" setting does not take immediate effect (only after
changing folders) because it's set as a single call to
column_view_get_time_visible() on the FileChooserCell creation.
Instead create a bind a show-time property that gets updated
as the setting is changed.
Move the gestures to the individual cells, and
make them trigger the context menu via an action
that takes item position and coordinates.
The semantics are changed slightly: the menu actions
now operate on the clicked item, not on the selection.
Still to do: Fix up keyboard activation.
If the async query fails to reproduce a file info,
we still need to thaw the model, otherwise it ends
up frozen forever.
This was deduced by reading the code, I haven't
actually seen it happen.
We can use the new collation property of GtkStringSorter,
and get the benefit of sort key caching. This commit
also fixes an accidental leak of all sorters, and
removes the sorter from the location column - we never
show that column when individual colummns are sortable.
This reverts commit 34752a15a71597d00a8d08befc545ac1c178b81b.
Leaving out the drag source portion as that needs a total
reimplementation. The GtkDropTarget only required minor
modifications.
Put a filter model between the selection model and
the filesystem model, and make it filter on the
filechooser::visible attribute. This makes the filer
combo in the filterchooser and the 'show hidden files'
item work. But we need to prod the filter to trigger
a refiltering every now and then.
Provide the filtered-out and visible bits as a file attributes
under the names filechooser::filtered-out and filechooser::visible,
so that we can filter on it.
To track changes of the selected items in a selection
model, we need to listen to both ::selection-changed
and ::items-changed.
This fixes the open button not turning sensitive
when initially loading a new folder.
When a list item is activated, we activate the default widget.
Unfortunately, due to some other bug, sometimes the open button
is not made sensitive, and then default.activate falls back
to activating the focus widget (which is the item we are just
coming from). Boom
Soon GtkFileSystemModel will not be a GtkTreeModel implementation,
so preemptively remove any usage of this interface. Populate the
list store using the GListModel's 'items-changed' signal.
This has to be the shortest-living object in GTK history!
It helped us greatly during the transition to GtkColumnView, but
now we can remove it in favour of GFileInfo directly. Perhaps I
could have never introduced GtkFileSystemItem in the first place,
but we're 30 commits deep and it's too late to just redo the whole
thing that will get us exactly here anyway.
We now start a mini-series of commits that will ultimately remove
the GtkTreeModel implementation of GtkFileSystemModel.
As a first step, port GtkSearchEngineModel iter through the files
using GListModel API.
Now that most of the treeview usage is gone, remove the remaining
code that uses it - mostly event handling code, which for now won't
work, but will be fixed by next commits - and drop the tree view
entirely.
So far, GtkFileChooserWidget has relied on GtkTreeView's selection
management. This commit moves it away from GtkTreeView, and that's
a massive surgery - sorry :(
The most important aspect of this commit is that 'selection_model'
is now the main model we deal with. Changing between directories,
recent files, and search, all sets the selection_model's model.
Selections are entirely handled by GtkSelectionModel now.
React to column view's 'activate' signal, instead of treeview's
'row-activated'. It doesn't handle file sensitivity yet, but that
will probably be dropped later.
Move the entire location column, which only contains the location
renderer, to the column view. The code to generate locations from
the current folder is essentially intact.
This commit moves the icon loading code into a new private
widget called GtkFileThumbnail, which is bound to the GFileInfo
of the model, and asynchronously loads the file icon from that.
Replace the 'list' page of the main stack with another page, this
one containing a GtkColumnView. This, again, is the very minimal
code to achieve a column view - and validate the GListModel code
introduced in the previous commit - but there's a long way until
this column view covers the full range of features of the file
chooser.
The tree view still lives in an unused 'list2' page. From now on,
commits will "cannibalize" the treeview, each commit porting any
particular feature - be it a column, an event controller, etc -
to the column view, and dropping the corresponding feature from
the treeview.
This is a trivial implementation of the GListModel interface. It
does not do anything fancy, like filtering out hidden files, nor
sorting.
The purpose of this minimal implementation is to bootstrap the
initial work to port GtkFileChooserWidget to GtkColumnView.