Commit Graph

28511 Commits

Author SHA1 Message Date
Matthias Clasen
eaabc3722e scale: Fix sporadic criticals
gtk_css_node_update_layout_attributes can cause us to
free priv->layout, and then bad things happen. Therefore,
we must call that function on a new layout *before* setting
priv->layout.
2021-04-10 10:07:55 -04:00
CEO of Programming
475a4c8262 Update gtklistbox.c 2021-04-10 01:04:05 +00:00
Matthias Clasen
ed9b3f5057 Revert Compose sequence changes
This was breaking muscle memory of people with
the us intl keyboard layout, for important keys
such as '. The unfortunate side-effect is that
our handling of <dead_acute> is a bit hampered
by sequences that don't fit the pattern. But
such is life.

Fixes: #3807
2021-04-01 15:52:12 -04:00
Carlos Garnacho
0ec077bcdc Merge branch 'wip/exalm/overshoot-changes-gtk3' into 'gtk-3-24'
scrolledwindow: Cancel overshoot on dimension changes

See merge request GNOME/gtk!3333
2021-04-01 12:14:10 +00:00
Alexander Mikhaylenko
27d38eca9a scrolledwindow: Cancel overshoot on dimension changes
If we scroll down in a list that's still being filled, we hit the edge and
initiate overshoot, and then the adjustment's upper value increases. This
leads to an unwanted bounce back.

Additionally, if in a similar situation the upper value decreases, the
overscroll glow gets stuck.

Update kinetic scrolling upper and lower value on changes, and immediately
cancel it if dimensions on that side change.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3752
2021-04-01 16:37:03 +05:00
Matthias Clasen
9a2382bebc Merge branch 'spinbutton-localized-digits-3' into 'gtk-3-24'
spinbutton: Interpret localized digits

See merge request GNOME/gtk!3369
2021-03-30 02:37:41 +00:00
Matthias Clasen
fa69e5f42d spinbutton: Interpret localized digits
Interpret input where the characters have numeric values.

See #3387
2021-03-29 22:10:06 -04:00
Matthias Clasen
316aa85b8d label: Fix reacting to screen resolution changes
Labels were not reacting when the screen resolution
changes, as e.g. when turning "Large Text" on of off.
2021-03-29 20:48:15 -04:00
Matthias Clasen
ba8c18019d imcontext: Look for Compose file in the right place
The documentation states that GTK will load a Compose
file from ~/.config/gtk-3.0/Compose. Unfortunately,
backports changed this unintentionally to look in
the gtk-4.0 directory. Change it back.
2021-03-29 18:31:23 -04:00
Matthias Clasen
3c6d96980f Fix make dist 2021-03-26 21:54:29 -04:00
Matthias Clasen
4c7944175f Merge branch 'double-dead-keys-3' into 'gtk-3-24'
Double dead keys 3

See merge request GNOME/gtk!3354
2021-03-27 01:11:20 +00:00
Matthias Clasen
8c7846733a imcontext: Tweak dead key handling
Reshuffle things to allow for a limited amount of
dead key 'chaining'. We keep up to 2 dead keys in
the preedit, so you can type
<dead_acute> <dead_cedilla> <c>
to produce ḉ, while still getting ```c with
<dead_grave> <dead_grave> <dead_grave> <c>.
2021-03-26 20:42:24 -04:00
Matthias Clasen
58b3145c90 composetable: Limit algorithmic checking
Only check for combinations of up to 2 dead keys with
a base character. We don't want to spend ages generating
all permutations of long sequences.
2021-03-26 20:28:14 -04:00
Daniel van Vugt
86da4e0c97 cssshadowvalue: Apply device scale to the offset when blurring text
Although the surface already has the device scale set, that doesn't
apply to the offset which is in raw device units. So we need to scale
the device offset explicitly.

Fixes: https://gitlab.com/rastersoft/desktop-icons-ng/-/issues/119
2021-03-24 18:37:12 +08:00
Matthias Clasen
59397005fa Regenerate compose sequence file
Update our compose sequences based on the current
update xorg Compose.pre file. Beyond that, remove
some deadkey sequences that we are now handling
(better) in code.
2021-03-21 22:11:37 -04:00
Matthias Clasen
41c3e9873c Move compose related tooling to a subdir
This reduces the clutter in gtk/.
2021-03-21 22:11:27 -04:00
Matthias Clasen
7b3c387af9 compose-parse: Add a negative lookaside
Make this script parse gtk-compose-remove.txt for
sequences to remove from the xorg Compose file.
This will be used for removing some deadkey combinations
that we can handle better in code.

Also, make this script explicitly python2. I tried
porting it to python3, but gave up in the end.
2021-03-21 22:11:16 -04:00
Matthias Clasen
a0cdd25bd4 imcontext: Improve dead key handling more
For sequences like ``, we want to commit the first
deadkey and then continue preedit with the second.

The alternative is to do chained deadkeys, where
entering ~~a yields ̃̀̃̃a. But we don't do that, and
I think that would be more controversial.
2021-03-21 22:09:56 -04:00
Matthias Clasen
c26525f87c imcontext: Improve dead key handling
For sequences like `x, where we don't have a compose
sequence, we still want to commit "`x", and not silently
eat the keys.
2021-03-21 22:09:41 -04:00
Bernhard M. Wiedemann
850768270f updateiconcache: Sort list of entries
because filesystem readdir order is indeterministic.

Without this patch, building openSUSE's balsa package
had variations between builds in /usr/share/balsa/icon-theme.cache

(cherry picked from commit b364827a5b)
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2021-03-13 15:12:18 +00:00
Timm Bäder
bfe0f7dd4d label: Skip updating link state if we have no layout
This can happen whenever the ::activate-link handler sets different
markup on the label, causing all links to be recreated. In this case,
the GtkLabelLink* passed to emit_activate_link is garbage after the
g_signal_emit call and we shouldn't try to do anything with it.

Fixes #1498
2021-03-05 14:56:20 -05:00
Alexander Mikhaylenko
d70fa89bdf Adwaita: Use transparent black for window border in dark too
Avoid smear when the background behind the window is dark. Adjust opacity
to make it appear roughly the same as before on white background.
2021-03-05 22:43:49 +05:00
Sebastian Keller
392e52187d Adwaita: Ensure SSD decorations do not change size when losing focus
56f6ac5f introduced a 20px shadow for the '.tiled decoration:backdrop'
selector. This selector is more specific than the '.ssd decoration'
selector and caused unfocused tiled SSD windows to have a shadow that
focused ones did not have. The mutter code however assumes that the size
of the decoration does not change between the states and this was
causing a crash when clicking below the titlebar in unfocused tiled SSD
windows.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3716
2021-03-05 00:36:15 +01:00
Alexander Mikhaylenko
d0cf3007c6 Revert "Add scaling adjustment for touch dragging a scrolled window"
This reverts commit d4943ef2fb.

This commit has broken scrolling in GtkTreeView. VTE has
`scroll-unit-pixels` property now, so the original issue is fixed
separately.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3707
2021-03-03 15:04:41 +05:00
Matthias Clasen
7b6f627666 imcontext: Fixes to the state machine
It turns out that we we were sometimes emitting
preedit-end multiple times, and sometimes not at
all. Same for preedit-start. To fix this up, introduce
a in_compose_sequence flag, maintain it, and use it
in the right places.

After these changes, both

C-S-u 1 2 3 Enter
Compose a e

generate the right signals:

preedit-start, preedit-changed,..., preedit-end, commit
2021-02-24 14:15:33 -05:00
Matthias Clasen
db1cb04896 imcontext: Take out the warnings
Don't warn about Compose file constructs we don't
support. We haven't supported these for a long time,
and nobody has every complained. No need to wake
up sleeping dogs.
2021-02-22 15:18:25 -05:00
Matthias Clasen
523d5121d3 imcontext: Make Compose preedit less intrusive
Tweak the preedit display for Compose sequences to
be not so distracting. We only show the Compose key
when it occurs in the middle of the sequence or is
the only key so far, and use · instead of ⎄ for it.

Also, make sure to display dead keys more adequately.
2021-02-18 12:38:22 -05:00
Matthias Clasen
f56a5ee260 Merge branch 'wip/jimmac/tiled-resize-area-gtk3' into 'gtk-3-24'
Adwaita: control surface for resize tiled windows

See merge request GNOME/gtk!3212
2021-02-17 03:53:55 +00:00
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
56f6ac5fcc Adwaita: control surface for resize tiled windows
- window resizing control area is implemented as where the shadows are drawn
    - create a 'fake' shadow for the tiled case to allow easier resizing of
      the tiled window ratio even if it's offset to the side of the border

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3670
2021-02-16 14:23:12 +01: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