Commit Graph

28405 Commits

Author SHA1 Message Date
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
Jakub Steiner
de348ba984 Adwaita: notebook legibility fixes
- make inactive tabs more legible

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2652
2020-06-23 22:24:57 +02:00
John Ralls
c6036592c9 [Quartz]Silence type mismatch warning. 2020-06-20 10:20:20 -07:00
Friedrich Beckmann
7d9a939f99 quartz: gtk-application - inhibit openFiles events from cmdline
When an application is started via cmdline, then openFiles events
from MacOS are generated although gtkapplication already interprets
the cmdline arguments and opens suitable arguments as files. So they
would be opened twice. Depending on the exact situation the
openFiles event can also be issued before the startup signal
is given. Depending on the application this can result in a crash
due to unexpected behaviour. I took this idea from the
gedit-app-osx.m file. Also from Jesse van den Kieboom.

See:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2098#note_842975
https://gitlab.gnome.org/GNOME/gtk/-/commit/a3ad7fa80f764fb7bcbe
https://gitlab.gnome.org/GNOME/gedit/-/blob/master/gedit/gedit-app-osx.m#L592
2020-06-18 21:08:28 +02:00
Matthias Clasen
a3ad7fa80f Merge branch 'gtk-application-quartz' into 'gtk-3-24'
quartz: Bugfix - Add openFiles delegate to gtk_application (#463)

See merge request GNOME/gtk!2098
2020-06-16 16:41:27 +00:00
Friedrich Beckmann
665f8b6b87 quartz: added open capability to gtk_application
This patch implements the openFiles delegate which is required
to open files which are associated with an application via the
Finder or via open on the command line. The patch has been
proposed by jessevdk@gmail.com.

See: https://gitlab.gnome.org/GNOME/gtk/-/issues/463

I tested the patch with the GNU pspp application on MacOS with
the quartz backend.
2020-06-16 16:59:06 +02:00
Benjamin Otte
947c3e9f72 Merge branch 'benzea/fix-css-update' into 'gtk-3-24'
Fix CSS update loop

See merge request GNOME/gtk!2093
2020-06-15 20:13:56 +00:00
Benjamin Berg
7a5caf1bc0 cssnode: Don't queue_validate/deque_validate invisible nodes
Otherwise setting/unsetting the parrent may cause on an invisible widget
may cause the style to be continuously updated.

Fixes: #2849
2020-06-15 21:31:16 +02:00
Matthias Clasen
3065f47ab5 Merge branch 'michaelweghorn/issue1820_gtkfilechoosernativeportal_get_filter' into 'gtk-3-24'
Make gtk_file_chooser_get_filter work for the portal GtkFileChooserNative (issue #1820)

See merge request GNOME/gtk!1960
2020-06-15 17:52:58 +00:00
Matthias Clasen
46a7ffc336 Merge branch 'michaelweghorn/issue1820_gtkfilechoosernative_get_filter' into 'gtk-3-24'
gtk_file_chooser_get_filter Make gtk_file_chooser_get_filter work for the non-portal GtkFileChooserNative (issue #1820)

See merge request GNOME/gtk!1959
2020-06-15 17:51:36 +00:00
Philip Withnall
fb998ff52d gtkbuilder: Eliminate array reallocations in get_parameters()
`gtk_builder_get_parameters()` is a hot path, being called twice for
each object in each UI file in an application. The majority of objects
have ≤ 8 properties, which are each filtered into either `parameters` or
`filtered_parameters`.

Unfortunately, both of those arrays are created as empty `GArray`s, and
adding 8 elements to an empty `GArray` hits the worst possible case of
reallocating and `memcpy()`ing the array 3 times. As the array size is
doubled with each reallocation, the cost is not particularly well
amortised when the array size is small.

From the `ObjectInfo`, we actually know how many properties there are in
total, so just allocate the arrays at the right size to begin with.

This saves 7% of the instruction cycles needed to start up
gnome-software to the point where it’s showing its main window,
according to callgrind. gnome-software is making around 5500 calls to
`gtk_builder_get_parameters()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-10 19:59:03 +01:00
Michael Weghorn
d59b28d5f4 Make gtk_file_chooser_get_filter work for portal case
This makes 'gtk_file_chooser_get_filter' work for the
portal native file chooser by handling the corresponding
'current_filter' argument in the response retrieved via
D-Bus.

In order to try to map the retrieved 'current_filter' to one
of the existing list of filters, use the retrieved filter's name,
similar to how xdg-desktop-portal-gtk does it when evaluating the
'current_filter' input parameter in 'options'.)

Note: This depends on the following merge/pull requests
which fix the filter handling in gtk for native file choosers
and introduce the 'current_filter' handling for FileChooser portal.

* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1959
* https://github.com/flatpak/xdg-desktop-portal/pull/493
* https://github.com/flatpak/xdg-desktop-portal-gtk/pull/311

This fixes #1820 for desktop portal case.

Fixes: #1820
2020-06-09 22:52:11 +02:00
Thomas Holder
1573ff6803 gtk_file_chooser_set_current_name: fix type of name argument
The description says UTF-8 string, but the annotation said filename.
2020-06-05 12:43:49 +02:00
Emmanuele Bassi
d60746ae6c Merge branch 'issue-2820' into 'gtk-3-24'
docs: Update the link to the GtkBuilder schema

See merge request GNOME/gtk!2042
2020-06-05 09:46:56 +00:00
Emmanuele Bassi
e9c4c80102 docs: Update the link to the GtkBuilder schema
The link to the file is still using the old cgit format, which redirects
to master, where the RNC file is gone.

Fixes: #2820
2020-06-05 10:16:19 +01:00
Kjell Ahlstedt
52d944ec44 flowbox: Don't use a removed child after it has been unparented
In gtk_flow_box_remove(), call g_sequence_remove() before the child is unparented.

See MR !2029
2020-06-04 08:24:08 -04:00
Neville
7fd126e2af Adwaita: Remove .tile from checkbox style selector
Currently .tile style is required for the larger blue checkboxes.
The .tile style is removed since it adds unwanted style to elements.
Also the selector to ignore list elements has been modified since
it currently checks for checkboxes that are not lists.
2020-06-03 20:56:39 +05:30
Matthias Clasen
92f11144f3 Merge branch 'gtk-3-24' into 'gtk-3-24'
Fix GPtrArray sorting function

See merge request GNOME/gtk!1984
2020-06-01 14:46:14 +00:00
Alexander Mikhaylenko
60f69462fc Adwaita: Revert black decoration background
Before I tried this change, I thought it might break apps that do
transparent window background. So I checked a few that did this:
gnome-terminal, tilix, kgx. It worked, so it must work everywhere, right?

However, it just so happens that vte is drawn using CAIRO_OPERATOR_SOURCE
operator rather than CAIRO_OPERATOR_OVER like everything else. This means
that if vte widget is transparent, anything below it, like a black
decoration background, won't be shown.

So really it is still broken, so reverting it.
2020-05-30 15:22:40 +05:00
Tristan Partin
6a507c0b63
Fix GPtrArray sorting function
GPtrArray's GCompareFunc passes a double pointer that needs to be
dereferenced in order to use the data you are actually wanting to
compare.

See: https://developer.gnome.org/glib/stable/glib-Pointer-Arrays.html#g-ptr-array-sort
2020-05-29 15:24:09 -05:00
Michael Weghorn
baddc90c26 filechoosernative: Make get_filter work for (non-portal) native chooser
'gtk_file_chooser_get_filter' did not work for GtkFileChooserNative,
since the previous way did not properly handle the delegate dialog,
s.a. commit a136cbae8f
("filechoosernative: forward current_filter to delegate dialog",
2018-11-29) for details, wich basiscally fixed the same thing for
the 'gtk_file_chooser_set_filter' case.

This fixes #1820 for the fallback dialog. A solution for the portal
one (which also requires changes to xdg-desktop-portal and
xdg-desktop-portal-gtk as well) will be suggested in a subsequent step.

Bug: #1820
2020-05-23 14:02:34 +02:00
Jakub Steiner
1f8c019d1e Merge branch 'theme-linked-button-fixes-gtk3' into 'gtk-3-24'
Adwaita: Fix and simplify the linked buttons styling (GTK3)

See merge request GNOME/gtk!1948
2020-05-22 09:30:16 +00:00
Ondrej Holy
cb9b7278d6 trash-monitor: Rate limit updates
Trash monitor queries info from gvfsd-trash after each file monitor
change which can be problematic when too many changes happen in
a short time. Let's rate limit the number of queries...

Fixes: #1010
2020-05-21 21:16:20 -04:00
nana-4
34d85329a9 Adwaita: Fix and simplify the linked buttons styling
- Remove various unnecessary overrides for linked buttons.
- Add missing outline styles to the %linked_vertical ones.
- Consistently use :not(.vertical) instead of :dir(ltr|rtl) for linked
  combo buttons.
- Remove :only-child styling from the messagedialog button. The
  :only-child is equivalent to :first-child:last-child, so we don't need
  the styling there specially.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2752
Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2549
2020-05-21 00:51:54 +09:00
Matthias Clasen
88fc1640ed Merge branch 'BUG_double_popover_focus_filechooser_GTK3' into 'gtk-3-24'
filechooser: set default widget early for 'Rename' popover

See merge request GNOME/gtk!1592
2020-05-19 23:26:56 +00:00
Carlos Garnacho
df8e6ea32e gtksearchenginetracker3: Pre-fill GFileInfo from query
Provide the minimal info necessary. Improves apparent responsiveness
(since we don't visibly clear and repopulate the list) and saves doing
file stat/reads on every file in the result set.
2020-05-19 22:03:39 +02:00
Carlos Garnacho
ae776046fc gtksearchengine: Add tracker3 search engine
Make this dependency optional at build time, and prefer it over
the old tracker <= 2.x implementation.
2020-05-19 22:03:39 +02:00
Carlos Garnacho
5858f7c5bd gtksearchengine: Add autoptr handler for this type
So subclasses can just use G_DECLARE_*_TYPE.
2020-05-19 22:03:20 +02:00
Carlos Garnacho
99031f885e gtksearchengine: Add "got_results" argument to ::finished
The filechooser tries to figure out whether it got results by poking
the model, but all files might go through the async GFileInfo querying
state.

Make all search engines (and the composite one) just notify about this
fact, so the file chooser can behave appropriately without waiting for
the async operations to finish.
2020-05-19 22:03:20 +02:00
LRN
0e8eedee16 Merge branch '324-print-paper' into 'gtk-3-24'
W32: Ensure paper size/orientation is preserved

See merge request GNOME/gtk!695
2020-05-18 08:55:47 +00:00
Alexander Mikhaylenko
97f540622a eventcontrollerscroll: Fix the history push condition
Once upon a time, there was a function called gdk_event_get_scroll_deltas().
It returned %TRUE when an event had scroll deltas and that was used as the
condition to decide whether to push scroll deltas to the scroll history,
even when the both deltas are 0 for the stop event at the end of scrolling.

When GtkScrolledWindow kinetic scrolling code was adapted for
GtkEventControllerScroll, it was replaced with a (dx != 0 && dy != 0)
check. This prevented the stop event from getting into the history, and
instead allowed non-smooth scrolling to affect the history as they have
synthetic deltas with one of the values being -1 or 1 and the other on 0.

Instead, check the direction as we already have it as a local variable.
2020-05-15 01:37:40 +05:00
Matthias Clasen
4f7c3610d6 Merge branch 'wip/sadiq/entry-select-all' into 'gtk-3-24'
entry: Always show “select-all” button on touch popup

See merge request GNOME/gtk!1857
2020-05-13 15:05:21 +00:00
Simon McVittie
4db3f142d7 aboutdialog: Document the new licenses added in 3.24.20
Originally part of b4c79bad "Assorted documentation fixes" by
Matthias Clasen.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-05-11 18:35:58 +01:00
Simon McVittie
177aeca5a1 aboutdialog: Update precondition checks for new licenses added in 3.24.20
To avoid making this mistake again, add a static assertion that the
enum is in sync with gtk_license_info, and use the length of
gtk_license_info for the precondition check.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: #2734
2020-05-11 18:35:58 +01:00
Alynx Zhou
530f0c0300 Remove platform specific code 2020-05-11 10:13:17 +08:00
Mohammed Sadiq
c823a4d673 entry: Always show 'select-all' button on touch popup
On touch, the popup shown shall contain the 'select-all' button
only if a selection is in progress and if the entry is editable.
Let the button be shown always if selectable so that it’s more helpful.
2020-05-07 18:09:40 +05:30
Matthias Clasen
86b0b80dfa filechooser: Translate type column
When the code for this was copied from nautilus,
we forgot to adapt it for running in a library
instead of an application - gettext() doesn't work
in a library.

Fixes: #2690
2020-05-02 20:07:33 -04:00
Florian Müllner
f28c6d34a7 appchooserdialog: Don't show broken subtitles
Commit 07beb6dba2 made GtkAppChooserWidget useful with no content-type,
however when used in a GtkAppChooserDialog, this will lead to a confusing
"Opening (null) files" subtitle.

Fix this by omitting the subtitle altogether in that case.
2020-05-01 18:22:39 +02:00
Alynx Zhou
721ce22a86 menu: Fix touch support by using pointer emulation under X11
GtkMenu under X11 cannot handle touch events properly,
so just disable touchscreen grabbing for it, which makes
it fallback to pointer emulation.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/945

menu: Fix grab on other backend
2020-04-30 10:16:25 +08:00
Matthias Clasen
521a382d79 HighContrast: regenerate css 2020-04-27 08:47:35 -04:00
Peter Bloomfield
3b5e10ef4d file-system-model: Refactor a helper
Push more common code into the helper for
gtk_file_system_model_query_done() and
gtk_file_system_model_one_query_done().
2020-04-27 08:21:45 -04:00