Commit Graph

28447 Commits

Author SHA1 Message Date
Bob Ham
6f6b5faaa2 gtkapplication-dbus: Initialise screensaver-active property
When GtkApplication starts listening to the screensaver's D-Bus
status, the screensaver-active property is not initialised and
applications making use of the property are out of sync until the
first state change.  Any application starting when the screensaver is
active will think it's inactive.

To fix this, we set the property when we first start monitoring the
screensaver.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1091
2020-10-19 14:51:19 +05:00
John Ralls
b46f50079b [Mac Keys] Restore command-key bindings.
Lost in transition from gtkrc to css.
2020-10-13 14:36:13 -07:00
John Ralls
715dc780fd [Mac Keybindings] Removed duplicate lines. 2020-10-13 14:36:13 -07:00
Philip Withnall
7072d57d12 gtkfilechooser: Fix open() references in documentation
While it’s true that you can pass the results of
`gtk_file_chooser_get_filename()` straight to `open()` or `fopen()` on
Linux, you can’t do so on Windows as it expects the filename to be in
the ANSI codepage. Using the GLib wrappers `g_open()`/`g_fopen()`
instead means that the appropriate UTF-8 → UTF-16 → `wopen()`/`wfopen()`
conversions are done.

Spotted by Fabian Keßler in
https://gitlab.gnome.org/GNOME/glib/-/issues/2212.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-10-12 12:12:33 +01:00
Samuel Thibault
7ee6fb2ec0 GtkPlug/Socket: add accessibility support
When a plug is embedded in a socket, we need to also plug the at-spi
tree, so that screen readers can find the at-spi content of the plugged
widgets.

This change does this plugging automatically: on the plug widget, an
additional _XEMBED_AT_SPI_PATH property is set to provide the at-spi path
(just like we have _XEMBED_INFO for other X11 information), and when
embedding it, the socket reads it, and makes it as its only child.

Since GtkPlugAccessible can not inherit both from AtkPlug (a child of
AtkObject) and from GtkContainerAccessible (a child of AtkObject), we
actually make GtkPlugAccessible a child of an AtkPlug, and that's what
will be embedded (in at-spi terms) into an AtkSocket.

Similarly, GtkSocketAccessible can not inherit both from AtkSocket and
GtkContainerAccessible, so we make it a parent of the AtkSocket that
embeds the AtkPlug.

This change depends on atk 2.35.1 which implements the at-spi technical
details.

This separates out atk-bridge-2.0 dependency, which is not part of atk,
but of at-spi2-atk.
2020-10-08 22:00:21 +02:00
Matthias Clasen
b34cfc89e6 Merge branch 'scrollto' into 'gtk-3-24'
Implement ATK's scrollSubstringTo()

See merge request GNOME/gtk!2671
2020-10-08 19:47:34 +00:00
Matthias Clasen
c91e65ba10 colorchooser: Bring color names back
These are useful for accessibility.
2020-10-07 15:36:23 -04:00
Martin Pieuchot
df670047ea Implement ATK's scrollSubstringTo()
This implementation is based on gtk_text_view_scroll_to_iter() and
thus shares its limitations for the sake of simplicity.

A single offset is opportunistically picked to build the iterator
needed for gtk_text_view_scroll_to_iter().  That means that substrings
spanning over multiple lines or larger than the current window might
not be displayed optimally after scrolling.

Partially closes #1625, the toPoint() variant has been discarded.
2020-10-07 20:20:05 +02:00
Jan Alexander Steffens (heftig)
d3d9788d71
gtkplacessidebar: Disconnect and unref cloud_manager in dispose
The manager's providers-changed signal can fire after the sidebar has
been freed. Make sure we disconnect the sidebar from the manager.

https://bugs.archlinux.org/task/57984
https://bugs.archlinux.org/task/68123
2020-10-06 23:51:36 +02:00
Matthias Clasen
bd2b635b6e Merge branch 'BUG_gtktreeview_headers_focus_on_click_GTK3' into 'gtk-3-24'
GtkTreeviewColumn: don't focus-on-click header buttons

See merge request GNOME/gtk!1805
2020-10-05 18:19:11 +00:00
Olivier Fourdan
33059211f4 gtksettings: Avoid a possible NULL pointer dereference
_gtk_settings_get_style_cascade() checks for the given GtkSettings to be
non-NULL, but does so after using the pointer to get the
GtkSettingsPrivate.

Make sure we use the GtkSettings pointer only after the precondition is
verified.

https://gitlab.gnome.org/GNOME/gtk/-/issues/2780
2020-09-30 15:22:15 +02:00
Olivier Fourdan
cec7ff1ba7 cssnode: Bail out nicely if there is no settings
On gdk_display_close(), the GtkSettings attached to the display are
freed.

Yet the gtk CSS code may still be called from the widget unparent,
leading to a segfault.

Check if the GtkSettings is not NULL and bail out nicely if not.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2780
2020-09-30 15:22:15 +02:00
Matthias Clasen
0eda000cef Merge branch 'entry-icon-press-event-type-3.24' into 'gtk-3-24'
[3.24] Fix event type annotation on GtkEntry::icon-press / icon-release

See merge request GNOME/gtk!2524
2020-09-28 16:10:49 +00:00
Matthias Clasen
d3cd68f11d scrolledwindow: Fix critical when unsetting scroll cursor
When installing the scroll cursor, add a weak ref to scrolled_window
that clears it if finalised. Unset the weak ref when the uninstalling
the cursor, and when the widget is destroyed.

Patch by Michael James Gratton

Fixes: #749
2020-09-26 20:55:42 -04:00
Jakub Steiner
8ad9958737 HighContrast: render CSS
- scss was not manually procss, thus things like new public color for
  @text_view_bg were not exported

Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/284
2020-09-23 18:19:45 +02:00
Matthias Clasen
3f5f1ec957 Merge branch '3166-gtk-show-uri-deprecation' into 'gtk-3-24'
gtkshow: Document that gtk_show_uri is deprecated

See merge request GNOME/gtk!2595
2020-09-23 12:19:00 +00:00
Thomas Holder
e35378ba37 gtktreeview: Fix child access after TEST_EXPAND_ROW
In gtk_tree_view_build_tree with recurse=TRUE, the TEST_EXPAND_ROW
signal might invalidate the child iterator. Getting the iterator after
the signal (instead of before) fixes the issue.

Fixes https://gitlab.com/inkscape/inkscape/-/issues/1879
2020-09-22 09:27:29 +02:00
Peter Bloomfield
ad03ab2ebb gtkshow: Document that gtk_show_uri is deprecated
Due to the deprecation in gtkshow.h, there is proper deprecation warning
for C code. But, for bindings (python in one case), there is no warning,
due to missing "Deprecated:" annotation in gtkshow.c

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3166
2020-09-18 17:00:41 -04:00
Jakub Steiner
059137f714 assets: adjust gesture graphic
- quick, somebody on the internet is offended!

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3074
2020-09-17 21:43:37 -04:00
Matthias Clasen
8cafaebe8b colorchooser: Backport the new color palette
Add more and better colors to the default color palette.
2020-09-16 18:37:27 -04:00
Sebastian Dröge
ec1a48e830 Fix event type annotation on GtkEntry::icon-press / icon-release
This is not only a GdkEventButton but can also be a GdkEventTouch.
Having this annotation wrong causes bindings code to fail whenever a
wrongly typed event comes through.
2020-09-03 09:36:00 +03:00
Sebastian Dröge
d4868da99c Annotate sequence argument of GtkGesture signals as nullable 2020-09-02 15:29:42 +03:00
Carlos Garnacho
e2d05f0625 searchengine: Prepare for apps linking to Tracker 2.x
Given it does seem likely Tracker is going to miss the goal to get all
applications ported to Tracker 3, the scenario where there's applications
linking to Tracker 2.x while GTK was built with Tracker 3 support becomes
more likely.

Avoid the upcoming GType clashes if that were the case, and resort to the
good (I lie) old Tracker 2 search engine.
2020-09-01 13:22:12 +02:00
Jakub Steiner
72513972d7 Adwaita: error labels insensitive & backdrop states
- address colored labels for the two states

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063#note_891618
2020-08-18 12:28:56 +02:00
Jakub Steiner
22af449b46 Adwaita: error labels and entries
See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063
2020-08-14 14:17:59 +02:00
Jakub Steiner
c09b9904c8 Adwaita: add public color for text views
- define @text_view_bg to complement @theme_text_color for high
  contrast legible text views.

Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/226
2020-08-07 18:55:04 +02:00
Jakub Steiner
2427ebf9ba Adwaita: sass wasn't re-rendered
- particularly the typographic fix c80ac1c05d
2020-08-07 18:53:15 +02:00
Matthias Clasen
ccc30804d2 Merge branch 'wip/oholy/gtkmountoperation-newline-gtk-3-24' into 'gtk-3-24'
gtkmountoperation: Drop the new line character when splitting a message

See merge request GNOME/gtk!2400
2020-08-07 13:31:29 +00:00
Matthias Clasen
a0e7a231a8 Merge branch 'cherry-pick-267ea755' into 'gtk-3-24'
placesview: Always open default location after mounting

See merge request GNOME/gtk!1288
2020-08-07 13:08:03 +00:00
Ondrej Holy
ec1e2fac95 gtkmountoperation: Drop the new line character when splitting a message
When asking for a password, the message string is split on primary
and secondary if it contains a newline character. However, the newline
character is currently part of both strings, which creates weird
spacing between the GtkLabels. I suppose this is bug, which was not
visible as in most cases (if not all) the message string hasn't
contained the new line characters so far. But we are going to change
that now, see GNOME/gvfs!82. Let's drop the new line character similarly
as it is done when asking for a question, or showing processes in order
to fix the weird spacing.
2020-08-07 10:30:13 +02:00
Chun-wei Fan
1feb169bfa Visual Studio projects: move projects to win32/
This will simplify our source tree a bit
2020-07-16 18:57:03 +08:00
Chun-wei Fan
dd5fd12343 gtk/gtkfilechoosernativeportal.c: Fix on C89 compilers
Make sure we declare variables at the top of the block-we can't declare
variables in a for loop initilization in this case.
2020-07-16 18:31:37 +08:00
Chun-wei Fan
6f54881851 gtkcssshadowvalue.c: Fix build on older Visual Studio
This code made use of isnan(), which is not provided by pre-2013 Visual
Studio, so fix the build by including fallback-c89.c in place of math.h,
and update fallback-c89.c to include the implementation of isnan() for
Visual Studio, which is copied from the fallback-c89.c in gdk/.
2020-07-16 18:28:06 +08:00
Jakub Steiner
c80ac1c05d Adwaita: revert letter-spacing for large-title
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2932
2020-07-14 12:26:45 +02:00
Matthias Clasen
b1fe8b5ab4 Merge branch 'wip/sadiq/fix-entry-magnifier' into 'gtk-3-24'
entry: Restrict magnifier popover within the entry size

See merge request GNOME/gtk!2228
2020-07-13 12:15:29 +00:00
Mohammed Sadiq
c5fe16caa6 text-view: Fix select-all from touch bubble
The 'select-all' signal requires a boolean argument to specify
whether to select all or none.  So explicitly pass TRUE to select
all text instead of letting the demons choose one for us.
2020-07-13 16:27:50 +05:30
Mohammed Sadiq
cadd794d2c entry: Restrict magnifier popover within the entry size
The magnifier shown with touch input should not go beyond the widget
limits.
2020-07-12 06:37:09 +05:30
Matthias Clasen
b5f73f1426 Merge branch 'wip/smcv/gtk3-gresource-internal' into 'gtk-3-24'
build: Don't export GResource-related symbols with newer GLib

See merge request GNOME/gtk!2218
2020-07-09 16:26:43 +00:00
Simon McVittie
b4d120fcb4 build: Don't export GResource-related symbols with newer GLib
This makes the desired behaviour explicit, and matches the behaviour
seen with Meson, where "external : false" is the default.

Before GNOME/glib!1468, not passing --internal to the resource compiler
meant "no special export attribute, do what you would normally do",
so these symbols were not exported due to our global use of
-fvisibility=hidden.

However, since GNOME/glib!1468, not passing --internal to the resource
compiler results in the symbols being decorated with G_MODULE_EXPORT,
which overrides -fvisibility=hidden. This was necessary because Windows
DLLs normally behave a bit like the equivalent of ELF libraries with
-fvisibility=hidden.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/2919
2020-07-09 16:57:42 +01:00
Carlos Garnacho
b999c8d826 autotools: Teach about tracker3 search engine
Add --enable-tracker3 option (off by default, like in meson) and
hook the tracker3 search engine to build. Also, make sure it's part
of dist.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2912
2020-07-09 17:05:57 +02:00
Matthias Clasen
3dd3695ac4 Merge branch 'printing-portal-fix' into 'gtk-3-24'
Printing portal fix

See merge request GNOME/gtk!2210
2020-07-09 03:27:41 +00:00
Casey Jao
6c911248c9 Remember to call print_cb even if print operation is cancelled.
Closes #2917.
2020-07-08 21:51:16 -04:00
Emmanuele Bassi
faa748d4c9 Merge branch 'gtk3-fix-menu-touch' into 'gtk-3-24'
menu: Fix touch support by using pointer emulation under X11

See merge request GNOME/gtk!1794
2020-07-07 15:20:03 +00:00
Christian Hergert
30b2e1e7a3 textview: invalidate pixelcache for some invisible changes
When making changes above the current visible region, we might need to
invalidate the pixelcache as the Y positions will no longer match. This
usually is not needed because changes are made interactively and are made
onscreen.

Other cases, though, can include an application changing the first line
of the buffer automatically. We lose the ability to pixelcache well in
this scenario, but that is unlikely an issue since rapid Y geometry resize
or scrolling is less likely to be occuring. For situations where this is
an issue, you can avoid removing the \n from the buffer so line heights
are uneffected.

Fixes #2882
2020-06-29 15:07:59 -07:00
Matthias Clasen
8b5bddcecc Merge branch 'quantize-corner-mask-cache' into 'gtk-3-24'
CSS: Quantization for corner mask cache

See merge request GNOME/gtk!2103
2020-06-29 16:11:34 +00:00
Luca Bacci
18f56ddf53
Limit corner mask cache
Fixes issue #2853
2020-06-29 17:06:28 +02:00
Luca Bacci
8d21c14592
Quantization for corner mask cache
Fixes issue #2853
2020-06-29 17:06:22 +02:00
Jakub Steiner
1118708976 Merge branch 'adwaita-fix-gtk-3-24' into 'gtk-3-24'
Remove .tile from checkbox style selector

See merge request GNOME/gtk!2018
2020-06-24 12:40:01 +00:00
Matthias Clasen
40bbcfebcb Merge branch 'cursor-aspect-ratio-for-3' into 'gtk-3-24'
Add a gtk-cursor-aspect-ratio setting

See merge request GNOME/gtk!2144
2020-06-23 21:14:58 +00:00
Matthias Clasen
804ae299a7 Add a gtk-cursor-aspect-ratio setting
Add a setting that controls how thick the text caret is drawn.
This setting replaces a style property that we used to have.
The default value is 0.04.
2020-06-23 16:51:09 -04:00