Commit Graph

39549 Commits

Author SHA1 Message Date
Luca Bacci
40709245ad GtkFileChooserWidget: Propagate keys from external entry to fcwidget at the BUBBLE phase
Now that we use event controllers we can forward keybindings from the
external entry to the filechooserwidget at the bubble phase.

Fixes #4905

References:
 * commit 1fb075dbca
 * commit 686116ba61
2022-05-13 21:47:34 +02:00
Christian Hergert
6d95ac9299 actionmuxer: check for observer before unregistering
This can happen if the group can be resolved even when doing the initial
registration of an action as observer will not yet be in the GSList of
watchers (and therefore has no weak references).

Fixes a warning like the following:

 g_object_weak_unref: couldn't find weak ref
2022-05-11 21:54:33 -04:00
Christian Hergert
ce003f4eec actionmuxer: set handler ids initially to zero
These were getting created with possible non-zero values and then inserted
into a hashtable where the readers may not know the state of the group.

Ensure those values are set to zero until we assign them below.
2022-05-11 21:54:28 -04:00
Matthias Clasen
f54c153775 printdialog: Handle nonexisting files better
When a non-existing file is selected in the file chooser
for print-to-file, we weren't updating the button label
to show the new filename. Fix that.

Also, use newer file chooser api.
2022-05-11 16:32:17 -04:00
Matthias Clasen
2f9387630f Merge branch 'wip/carlosg/ignore-null-preedit-4.6' into 'gtk-4-6'
imcontextwayland: Ignore preedit updates from NULL to NULL

See merge request GNOME/gtk!4711
2022-05-09 19:57:44 +00:00
Carlos Garnacho
c1895ad823 imcontextwayland: Ignore preedit updates from NULL to NULL
If we get consecutive preedit string updates that announce a NULL
string, we still do end up issuing ::preedit-changed with those.
Ignore changes from NULL to NULL, it is the other combinations which
must issue this signal.

(cherry-picked from commit d6fe6f495a)
2022-05-09 17:41:08 +02:00
Matthias Clasen
d91c612eab listitemwidget: Avoid some unnecessary work
Only update widget and accessible state if the
selected property actually changed.
2022-05-07 10:31:37 -04:00
Ivan Molodetskikh
3894f04d0e list-item: Use notify_by_pspec instead of by name
This is a hot path when scrolling a ColumnView, and
g_param_spec_pool_lookup () was taking a measurable part in this hot
path. Instead, notify using pspecs to avoid the name lookup.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3334
2022-05-07 10:31:22 -04:00
Ivan Molodetskikh
a39d55e5b0 listitemfactory: Track notify manually instead of freeze/thaw
freeze/thaw_notify () showed up on the perf trace for rapid ColumnView
scrolling. Track the three properties manually to make it a little
faster.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3334
2022-05-07 10:31:15 -04:00
Benjamin Otte
fc5966a347 Don't invalidate parent if it didn't change
This looks like a leftover excess invalidation from when the surrounding
code was refactored to not just be called on parent changes but also
when repositioning inside the same parent in commit
507016cafc

Ivan Molodetskikh found this problem in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3334#note_1445873 which
contains a longer analysis of this problem and the performance
reductions it causes.

Related: #3334
2022-05-07 10:31:00 -04:00
Luca Bacci
f0120700dc GtkFileChooserWidget: return empty GListModel in get_files () instead of NULL 2022-05-03 12:38:22 +02:00
Luca Bacci
6b740c86f9 GtkFileChooserWidget: check for empty instead of NULL GListModel
While porting GtkFileChooserWidget from GList to GListModel we did not
change some checks for NULL to checks for empty list.

Fixes #4851, #4858
2022-05-03 12:38:03 +02:00
Sophie Herold
1e561035e2 filechooser: Small fix for select folder mode
When changing folders, we were making the select
button insensitive when there is no folder selected.
However, the select button should be usable to
select the current folder.

Fixes #4020
2022-04-29 20:11:44 +02:00
Benjamin Otte
ae01669737 boxlayout: Do not infloop
if the loop for determining max width grows too big, print an error and
abort assuming that a satisfactory value was reached.

This will cause wrong layout and might cause widgets to overlap, but it
will not infloop.

It actually works around and doesn't really fix the primary cause of the
following bugs, but good enough to close them:

Fixes: #4252
Fixes: #4517


(cherry picked from commit 515b1f5292)
2022-04-26 21:11:32 +00:00
Matthias Clasen
6e5573f5bb theme: Fix vertical spin button selection
The selection should be black-on-blue as it is
everywhere else now. This was just a leftover.

Fixes: #4788
2022-04-21 19:28:14 -04:00
Emmanuele Bassi
e17d51df66 Quench the anger of GCC
Direct access of the fields of the union trips compiler warnings with
GCC 12, such as:

  ../gtk/gtkimagedefinition.c:135:13: error: array subscript
  ‘GtkImageDefinition {aka union _GtkImageDefinition}[0]’ is partly
  outside array bounds of ‘GtkImageDefinitionEmpty[1]’ {aka
  ‘struct _GtkImageDefinitionEmpty[1]’} [-Werror=array-bounds]
2022-04-21 19:27:48 -04:00
Matthias Clasen
01f63c87b2 Fix file filter buildable support
File filters creates from ui files had some
extraneous gunk in them. Fix that. Test included.

Fixes: #4787
2022-04-21 19:27:37 -04:00
Marcel Tiede
e449bd8459 docs: Fix typo in description of GtkExpression 2022-04-21 19:27:26 -04:00
Alexander Mikhaylenko
edb69f0bb3 scrolledwindow: Pick up gtk-overlay-scrolling changes on the fly 2022-04-21 19:26:25 -04:00
Alexander Mikhaylenko
cf48d15c2c scrolledwindow: Fix :kinetic-scrolling setter 2022-04-21 19:26:17 -04:00
Alexander Mikhaylenko
7cc49ba288 tooltipwindow: Don't restrict minimum tooltip label length
We only care about wrapping at that length, we still want short tooltips
for short labels.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3741
2022-04-21 19:26:03 -04:00
Alexander Mikhaylenko
6809a78321 tooltipwindow: Remove a duplicate gtk_widget_class_set_css_name() call 2022-04-21 19:25:52 -04:00
Emmanuele Bassi
c1002b20ee Mark nullable arguments in GtkPaned
The set_start_child() and set_end_child() methods take NULL for the
child argument, as a way to remove the child from the paned widget.
2022-04-21 19:25:42 -04:00
Emmanuele Bassi
fdf3ae31c6 docs: Fix the GtkPaned style
Use proper links to properties and methods, and drop gtk-doc'isms.
2022-04-21 19:25:36 -04:00
Julian Sparber
f915c6bb5c label: Move focus out of widget after last link
This allows the user to navigate via tab the links in a label and exits
the widget after the last link, when moving forward, and first link,
when moving backward.

This also ensures that ellipsised links arn't focused.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4681
2022-04-21 19:25:09 -04:00
Julian Sparber
659c1c41de label: Maintain value for has-tooltip for labels with links
The `has-tooltip` property gets set to `false` for label with links if no
link is selected. This makes sure to only change the property to `true`
but never to `false`.
2022-04-21 19:24:59 -04:00
Ivan Molodetskikh
8f2be7e840 scrollable: Clarify when to set adjustment props
Instead of populating the properties right away (when the widget might
not have been allocated yet, and hence cannot know the right values),
the widget should queue an allocation, where it will populate the
values.
2022-04-21 19:24:52 -04:00
Carlos Garnacho
812c8926ec imwayland: Do not defer commit() after set_surrounding_text()
For reasons that only apply to the old serial handling, asking for
the surrounding after IM changes resulted in lazy handling of
commit() afterwards.

With the recent interpretation of serials, this problem became more
apparent, since it is in fact very likely that the last interaction
step after an IM change is notifying of the changed surrounding
text after the IM change was applied.

Make handling of surrounding text similar to caret position changes,
always commit() after the state change, but skip through non-changes.

This makes the compositor state fully up-to-date after an IM change.
2022-04-21 19:24:00 -04:00
Carlos Garnacho
b14bc4749e imwayland: Connect OSK activating gesture to parent widget on editables
The gesture as connected currently on the child GtkText is easily overridden
by the parent editables (and gently done so in the attempt to consume all
clicks).

Connect this gesture to the parent editable widget in these cases, so the
gesture can cohabit with the click-consuming one. It's not part of the same
group, but it won't be abruptly cancelled.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4795
2022-04-21 19:23:48 -04:00
Maximiliano Sandoval R
de8cb17ee8 application: Add link and inline code blocks 2022-04-21 19:22:38 -04:00
Maximiliano Sandoval R
e69eb24b32 filter: Add link to FilterListmodel 2022-04-21 19:22:33 -04:00
Maximiliano Sandoval R
4a388b5540 texttag: Correct typo
Does not generate a gir docstring without it.
2022-04-21 19:22:27 -04:00
Matthias Clasen
25bedcd85d inspector: Avoid another crash
We need to handle all event types here.
This was tripping over GDK_TOUCHPAD_HOLD events.
2022-04-21 19:20:10 -04:00
Matthias Clasen
feb3d3b274 inspector: Avoid a crash
Attribute lists can be NULL, it turns out.
2022-04-21 19:19:45 -04:00
Matthias Clasen
e191519d30 css: Plug a memory leak
We were leaking the terms of calc values. Oops.
2022-04-21 19:19:33 -04:00
Matthias Clasen
e2abb0211c imcontextsimple: Plug a memory leak 2022-04-21 19:18:34 -04:00
Maximiliano Sandoval R
b024c9a743 docs: Fix links in selection models 2022-04-21 19:18:25 -04:00
Xavier Claessens
91c60dcac0 Remove #ifdef ENABLE_NLS
libintl API is guaranteed to always be available, glib will fallback to
proxy-libintl in case gettext is not found.
2022-04-21 19:18:00 -04:00
Chun-wei Fan
177302cf4d inspector/general.c: Check whether GL context supports WGL
We may well be using an EGL context that does not support Desktop (W)GL on
Windows, such as in the case of using libANGLE.  So, check whether WGL is
supported for this running instance before trying to query WGL extensions.

This will get rid of warning messages from libepoxy.
2022-04-21 19:16:13 -04:00
Alexander Mikhaylenko
d1fc90e8a2 eventcontrollerscroll: Always propagate hold events
Otherwise a stray scroll controller may prevent others from getting hold
events, even if it always propagates scroll events and does absolutely
nothing.
2022-04-21 19:15:58 -04:00
Matthias Clasen
29d4821e3d inspector: Allow viewing PangoAttrList properties
We have pango_attr_list_to/from_string, so this is
easy. The editing UI isn't ideal, but it solves my
immediate need to see attributes.
2022-04-21 19:15:20 -04:00
Christian Hergert
e50e2136d2 Default: avoid use of opacity for overlay scrollbars
If using the opacity CSS property the renderer cannot optimize these
handles without the use of offscreens due to the use of both a border
and rgb render node.

Instead, we can apply the alpha to the color values and get the same
effect in a way that the GL renderer can optimize without the use of
offscreen textures for a sizeable reduction in runtime overhead.
2022-04-21 19:14:14 -04:00
Yosef Or Boczko
a5eeb99f37 popover-menu: Fix buttons' position in RTL
The radio/check/previous buttons shows in
the wrong place in RTL. Fix it.

#4641

Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2022-04-21 19:14:03 -04:00
Carlos Garnacho
bc4b2c142f gtkimmulticontext: Handle switches between displays
Currently the GtkIMMultiContext may stick to a delegate GtkIMContext
that no longer applies after the multicontext is dissociated from
any widget.

Handle set_client_widget() so that it can handle changes between
widgets from 2 different display, but also so the delegate is made
NULL whenever the context has a NULL widget.

Doing so, any new client widget results in a new delegate IM context
lookup from the right GdkDisplay and GtkSettings, which avoids any
mix up.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4805


(cherry picked from commit b67da38916)
2022-04-20 14:54:04 +00:00
Matthias Clasen
b65d7c86d7 Merge branch 'filechooser-fixes-4-6' into 'gtk-4-6'
filechooser: cherry-pick fixes from main for 4.6

See merge request GNOME/gtk!4654
2022-04-20 01:34:51 +00:00
Emmanuele Bassi
e41a4ced8b a11y: Defer object registration after root registration
The root accessible object is registered asynchronously, as it needs to
call a method on the AT-SPI registry daemon. This means we need to defer
registering the GtkAtSpiContext on the accessibility bus and in the
cache until after the registration is complete.

Fixes: #4825
2022-04-19 22:05:46 +01:00
Matthias Clasen
eb2699aa9f filechooser: Small fix for save mode
When changing folders, we were making the select
button insensitive when there's no files around.
That doesn't make sense in save mode when we don't
want to select a file but create one.

Fixes: #4851
2022-04-19 13:51:44 +02:00
Matthias Clasen
fcab393c3b filechooser: Prevent random completion popups
It is very irritating when the entry completion popup
appears not in response to user input in the entry.
In particular, when that happens right as the dialog
is shown.

To prevent that, temporarily disable completion
when setting the entry text programmatically.
2022-04-19 13:49:31 +02:00
António Fernandes
42a4c62025 overlaylayout: Set position style class on child
As documented:
> Overlay children whose alignments cause them to be positioned
> at an edge get the style classes “.left”, “.right”, “.top”, 
> and/or “.bottom” according to their position.

Likely accidental regression in b7ee2cbc28

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2099

(cherry picked from commit 351ffef704)
2022-03-27 17:50:16 +00:00
James Westman
1f00cdc7a6 filefilter: Fix <suffixes> in buildable
A bug in GtkFileFilter's GtkBuildable implementation caused the
<suffixes> tag not to be recognized.
2022-03-17 16:18:28 -04:00