Commit Graph

28482 Commits

Author SHA1 Message Date
Matthias Clasen
8780cde919 imcontextsimple: Bring back modifier intent
This was lost by accident in 85d34932f3.
2021-02-16 19:31:17 -05:00
Jakub Steiner
3d30790280 Adwaita: Avoid fine-tune scrollbars jumping
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3672
2021-02-16 11:41:57 +01:00
Matthias Clasen
b201438b39 Merge branch 'wip/jimmac/larger-smaller-scrollbar-gtk3' into 'gtk-3-24'
Adwaita: Scrollbar transitions and size

See merge request GNOME/gtk!3205
2021-02-15 18:08:20 +00:00
Carlos Garnacho
dca64da1fe Merge branch 'touch-scroll-scale' into 'gtk-3-24'
Add scaling adjustment for touch dragging a scrolled window

See merge request GNOME/gtk!2615
2021-02-15 17:27:26 +00:00
Jakub Steiner
ca34428d17 Adwaita: Scrollbar transitions and size
- tone down the size of the controller again
 - transition between the indicator and control fluidly

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1886
2021-02-15 13:45:21 +01:00
Matthias Clasen
d11cde0c1c imcontext: Be more lenient in parsing Compose
X11 allows keysyms to be specified in addition to strings.
We only support the strings. In the past, we ignored everything
after the string. Go back to doing that, but issue a warning
that we've ignored the keysym.
2021-02-14 13:03:50 -05:00
Matthias Clasen
22960c5c20 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back.

Fixes: #3664
2021-02-14 12:10:09 -05:00
Matthias Clasen
abefce0961 Fix distcheck 2021-02-12 10:24:27 -05:00
Jakub Steiner
35adc7ed04 Adwaita: Bring back borders of tiled windows
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3661
2021-02-11 15:24:59 +01:00
Jakub Steiner
6f4ebce914 adwaita: disable shadows when window is maximized, fullscreen, tiled
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-10 18:18:10 +01:00
Matthias Clasen
d2fe033c21 imcontextsimple: Fix a crash
In the backport, I inadvertendly removed the
set_client_window implementation, which needs
to remain.
2021-02-09 18:11:38 -05:00
Matthias Clasen
85d34932f3 imcontext: Backport compose sequence improvements
Improve compose sequence handling:
- Show preedit for compose seqences
- Support sequences of up to 20 code points
- Warn when ignoring Compose file features
- Support compose sequences producing multiple characters
- Support hex escapes
2021-02-08 20:28:49 -05:00
Chun-wei Fan
a612a42c11 Meson: Avoid UAC on 32-bit Windows for gtk-update-icon-cache
As the program executable name has 'update' in its filename,
gtk-update-icon-cache.exe is considered to be an installer program on 32-bit
Windows [1], which will cause the program to fail to run unless it is running
with elevated privileges (i.e. UAC).

Avoid this situation by embedding a manifest file into the final executable
that tells Windows that this is not a program that requires elevation.

Also make the autotools build files dist the new script and use the new script
to generate the manifest and rc files, instead of hardcoding the generating
bits in gtk/Makefile.am

Fixes issue #3632.

[1]: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709628(v=ws.10)?redirectedfrom=MSDN,
under section "Installer Detection  Technology"
2021-02-03 14:56:07 +08:00
Jakub Steiner
d13b9f797a Adwaita: make scrollbars larger
When using scrollbars as active controls, rather than their primary role as indicators,
increase their size as click targets.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1886
2021-01-25 14:15:14 +01:00
vanadiae
0a9e2d6ed7 gtk-debug: Allow interactive debug even without G_ENABLE_DEBUG
Currently when GTK3 is compiled without G_ENABLE_DEBUG, the inspector
can't be opened with GTK_DEBUG=interactive because it doesn't parse
this env var without G_ENABLE_DEBUG.

Since the inspector is always good to have, this commit now always
parses the GTK_DEBUG env var but only keep the "interactive" flag if
G_ENABLE_DEBUG isn't defined.
2021-01-18 18:35:50 +01:00
Chun-wei Fan
91343251b9 gtk/fallback-c89.c: Add fallback for fmin()
fmin() is a function that is introduced with C99/C++11, so check for the
presence of it and provide a simple implementation for it if it does not
exist.

Also update the config.h.win32.in template accordingly, since this
function is provided on Visual Studio 2013 or later.
2020-12-23 12:52:19 +08:00
Chun-wei Fan
ecd6b0b9a4 gtk/gtkscrolledwindow.c: Declare variables at top-of-block
This way, the code can be built on C89-esque compilers.
2020-12-23 11:24:34 +08:00
Sebastian Keller
2a89189f1a textview: Use correct aspect ratio when invaldiating cursor
The size of the cursor depends on either the gtk-cursor-aspect-ratio
GtkSetting or as of the previous commit on the GtkSetting or the
cursor-aspect-ratio style property. GtkTextView was only considering the
style property.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller
0165cce645 stylecontext: Add style property fallback for gtk-cursor-aspect-ratio
The gtk-cursor-aspect-ratio GtkSetting was only recently introduced and
replaced the cursor-aspect-ratio style property. This was causing old
configurations that used CSS to modify this property to no longer apply.
This commit introduces a fallback from the GtkSetting to the style
property if the value of the setting is unchanged.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller
6c5489ab25 settings: Support loading float values from keyfiles
The gtk-cursor-aspect-ratio property got added as a float property.
However there is no parser for float values from keyfiles which meant
that it could not be changed from settings.ini.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Matthias Clasen
69e7ab649c Merge branch 'fix-gtk-nautilus-typo' into 'gtk-3-24'
[Gtk3] GtkNativeDialog: Fix a typo in the docs

See merge request GNOME/gtk!2930
2020-12-08 03:21:26 +00:00
Phaedrus Leeds
59dfeaceff GtkNativeDialog: Fix a typo in the docs 2020-12-07 17:17:39 -08:00
Samuel Thibault
4ffe5a4954 gtknotebookpageaccessible: do not fallback to child accessible for extents
When the notebook page does not have a label, it should not fallback to
asking its child accessible for extent, since the child might be asking
exactly the converse when it is a socket, thus getting in an infinite
loop. When the page does not have a label, is does not really make sense to
give it an extent anyway.

Fixes atk#18
2020-12-05 00:34:32 +01:00
Carlos Garnacho
850a086adb Merge branch 'wip/exalm/accumulate-scrolling-backport' into 'gtk-3-24'
scrolledwindow: Accumulate velocity with kinetic scrolling

See merge request GNOME/gtk!2818
2020-12-01 13:14:40 +00:00
nana-4
6da446c1be Adwaita: Stop using $button_fill
The $button_fill hack for button.circular is pretty awkward and is
currently broken. Instead of relying on it, allow the button() mixin to
have an additional background-image optionally.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3354
2020-11-14 13:21:25 +09:00
Chris Lord
1d62a010ef scrolledwindow: Accumulate velocity with kinetic scrolling
Accumulate existing velocity when decelerating from a swipe if the swipe
velocity is above a certain fraction of that existing velocity.
2020-11-12 18:56:14 +05:00
Jakub Steiner
811c7f2266 Adwaita: !global vars no longer in sass
- render changes from dab79f5d77
2020-11-12 13:05:45 +01:00
Jakub Steiner
a84b41abfd Merge branch 'treeview-header-button-border-css' into 'gtk-3-24'
Highlight treeview header button border with more contrasting color on hover

See merge request GNOME/gtk!2467
2020-11-12 09:23:06 +00:00
crvi
dab79f5d77 Adwaita: Make treeview header button borders more visible
The existing treeview header button border in GTK3 is close to
invisible. The preferred way to find the border for a treeview column
is to hover the mouse near the beginning of the header button text
expecting the default cursor to switch to 'col-resize' cursor. This
works only when all column headers in the view are left aligned. After
adding a few numeric columns to the view, whose headers are right
aligned, it becomes really hard to find the location of the border
between a left aligned and right aligned column header.

This change addresses the issue by using high contrast colors for
borders of treeview header button - in line with the colors used in
Adwaita theme in GTK4.

See merge request GNOME/gtk!2467
2020-11-12 01:37:03 +05:30
Matthias Clasen
13f6790fdb expander: Documentation update
Document GtkExpander:label-fill as ignored.

Fixes: #3331
2020-11-07 12:03:46 -05:00
Matthias Clasen
0f0dad24f4 Fix the build with older pango
pango_font_family_get_face() was only introduced
in pango 1.46. Work around this for older releases.
2020-10-29 22:22:33 -04:00
Matthias Clasen
9536d3aeaa fontchooser: Fix family-only mode
When the level does not include the style, we only
include one face of each family in the list. But we
were just choosing the first face (typically, a light
or extra-light style). Improve this by picking the
default face (normally, the regular face), which is
the expected behavior.
2020-10-29 21:59:24 -04:00
Carlos Garnacho
f4c366044b Merge branch 'wip/exalm/swipe' into 'gtk-3-24'
gestureswipe: Count last event when calculating velocity

See merge request GNOME/gtk!2714
2020-10-21 16:58:27 +00:00
Alexander Mikhaylenko
847d378fea gestureswipe: Count last event when calculating velocity
The last event, matching lifting the finger/releasing the mouse button,
is important when there's a large delay between it and the previous events,
as in when performing a movement, stopping, then releasing fingers as
opposed to doing a swipe.

If this event is skipped, doing this will result in kinetic deceleration
matching the previous finger movement, while the expected behavior would
be no deceleration.

See also 97f540622a for a similar fix in
GtkEventControllerScroll.
2020-10-21 20:57:30 +05:00
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
Benjamin Schaaf
d4943ef2fb Add scaling adjustment for touch dragging a scrolled window
If a GtkScrollable uses a different scale than pixels the offset from a
drag must be adjusted to match this scale. This fixes issues like this
https://gitlab.gnome.org/GNOME/vte/-/issues/283 where the terminal
widget uses rows instead of pixels as its scale for each GtkAdjustable
thus causing a 1 pixel vertical drag to scroll 1 row.
2020-09-26 03:08:03 +10: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