Commit Graph

38496 Commits

Author SHA1 Message Date
Matthias Clasen
15483ac9df imcontext: Fix cursor positions
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.

Fixed: #3885
2021-04-21 06:28:52 -04:00
Emmanuele Bassi
dbe4543969 Merge branch 'gtksecurememory-updates' into 'master'
gtksecurememory: Request that secure memory not be dumped to disk

See merge request GNOME/gtk!3452
2021-04-17 23:46:38 +00:00
Jason Francis
b27ec5ebde
meson: check for madvise() 2021-04-17 19:30:20 -04:00
Matthew Garrett
6622ebb310
gtksecurememory: Request that secure memory not be dumped to disk
Linux 3.4 added support for the MADV_DONTDUMP option to madvise(), which
requests that the covered memory not be included in coredumps. It makes
sense to use this to prevent cases where application crashes could
result in secrets being persisted to disk or included in dumps that are
uploaded to remote servers for analysis. I've avoided making this fatal
since there's a chance this code could be built on systems that have
MADV_DONTDUMP but run on systems that don't.
2021-04-17 19:29:42 -04:00
Matthias Clasen
a804e4bd8c a11y: Add more debug spew
This is in an attempt to figure out why orca won't speak.
2021-04-17 12:00:17 -04:00
Matthias Clasen
a04ce41799 testatcontext: Print out platform changes
This helps debugging what changes orca sees.
2021-04-17 12:00:11 -04:00
Matthias Clasen
379bb6c9f5 placesview: Fix server mount feedback
We weren't properly resetting the in-entry progress.
2021-04-16 19:34:24 -04:00
Matthias Clasen
3df3a0499f placesview: Fix mounting remote locations
This was broken by a stupid copy-paste error.
2021-04-16 19:17:37 -04:00
Matthias Clasen
0d308d09f3 mountoperation: Some cosmetics
Fix up the dialog minimally.
2021-04-16 19:05:14 -04:00
Matthias Clasen
1331d5cf97 cssimageurl: Remove direct pixbuf use
Rely on the gdkpixbufutils api that gives us
a paintable.
2021-04-16 18:27:40 -04:00
Matthias Clasen
91f3f5c63b image, picture: Move pixbuf code to gdkpixbufutils
This cleans up and moves the code to load files
while taking the scale into account. Along the way,
we drop the last uses of GdkPixbufAnimation, and
consolidate the pixbuf using code in one place.
2021-04-16 18:27:40 -04:00
Matthias Clasen
08b101ace8 pixbufutils: Remove an unused function 2021-04-16 09:19:06 -04:00
Matthias Clasen
5e53c0473a Merge branch 'latest.glib.msvc' into 'master'
Fix builds against latest stable GLib with MSVC

See merge request GNOME/gtk!3443
2021-04-16 12:25:43 +00:00
Matthias Clasen
4d19de4e03 window: Fix deferred focus unsetting
In commit 4a76abffd4, we deferred unsetting focus
and default until after the next draw, overlooking the
case where the focus is set to another widget before we
ever get to the unsetting.

Fixes: #3413
2021-04-16 07:35:26 -04:00
Chun-wei Fan
153019a794 GTK: Fix builds against latest stable GLib with MSVC
GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.
2021-04-16 11:39:24 +08:00
Matthias Clasen
24cd05672e Merge branch 'im-context-event-leak' into 'master'
imcontext: Eat key events during preedit

See merge request GNOME/gtk!3440
2021-04-15 22:16:49 +00:00
Matthias Clasen
9f6b3e179f themes: Make fallback work a bit better
One case we did not include in fd329e0ec5 is

Adwaita-dark -> Default:dark

It turns out that it is needed.
2021-04-15 17:09:46 -04:00
Matthias Clasen
20fb64704d imcontext: Eat key events during preedit
Avoid passing through random key press or release
events while we are showing preedit. That prevents
'accidents' like typing Ctrl-. bringing up the
Emoji chooser during preedit, or hitting Ctrl-a
after the Compose key moving the 'dot' around in
vim in terminals.
2021-04-15 16:59:02 -04:00
nana-4
c6483d431f theme: Use -gtk-icon-filter for full-color icons
Not for symbolic icons.

Don't apply `-gtk-icon-filter: opacity(0.5);` to the symbolic icons as
they already have the "gray" colors indicating the disabled state.
Symbolic icons can be styled using the `color` property.

Also remove the obsolete comment.
2021-04-15 18:39:08 +09:00
Matthias Clasen
13ece4ee9b Make gtk_test_init work without assertions
The g_test_init macro 'helpfully' refuses to work when
assertions are disabled. So we just use the function.
2021-04-12 21:22:46 -04:00
Matthias Clasen
ecfba2d31b Inspector: Fix a possible undefined use 2021-04-12 21:22:46 -04:00
Matthias Clasen
367dfee36e Fix unused variable warnings
These happen for variables which are only used
in assertions, when assertions are disabled.
2021-04-12 21:22:46 -04:00
Matthias Clasen
3ad56a762f Merge branch 'grouped-toggle-fix' into 'master'
togglebutton: Fix expected group behavior

See merge request GNOME/gtk!3425
2021-04-12 02:40:43 +00:00
Matthias Clasen
233e662294 togglebutton: Fix expected group behavior
The expectation is that a grouped button stays
active when you click it. Grouped check buttons
behave this way, and grouped toggle buttons should
too.
2021-04-11 18:29:53 -04:00
Matthias Clasen
e2420f62fe menubutton: Propagate focus-on-click
Propagate the focus-on-click setting to the button
inside, so that setting menubuttons as !focus-on-click
works as expected. This helps for menubuttons in
header bars, where dragging on the button will otherwise
steal focus from the content.
2021-04-11 15:32:15 -04:00
Matthias Clasen
4a76abffd4 window: Defer focus setting until after paint
Commit 3dbf5038fa tried to defer focus changes
until after rendering is done. But it failed to do so, since
the toplevel ::render handler is still before rendering of
popups that are attached to that toplevel. To do this
properly, we need to do it in the AFTER_PAINT frame clock
phase.

Fixes: #3725
2021-04-09 19:44:10 -04:00
Matthias Clasen
9313d4b6b4 scrolledwindow: Stop using scroll cursors
We used to override cursor to use all-scroll while the
content is being scrolled. Unfortunately, there is several
problems with this:
- It is really only expected certain devices, and we don't
  have the device information on Wayland
- With the way cursor setting works in GTK4, non-NULL cursors
  of the content (eg the text views ibeam) win, making the
  scroll cursor not show up
- Under X11, we seem to miss scroll end events and then
  the scroll cursor gets stuck
Therefore, just remove this feature.
2021-04-09 08:26:09 -04:00
Matthias Clasen
288a5d4151 textview: Fix a problem with the last line
Sometimes, we missed the last line for display.

Fixes: #3835
2021-04-06 11:09:05 -04:00
Matthias Clasen
303ff60d5e modelbutton: Avoid a crash
We may not have a popover menu ancestor. The check for
this was forgotten in one of the branches here.

Fixes: #3831
2021-04-05 14:06:42 -04:00
Matthias Clasen
b79eb55b34 window: Actually enable the inspector by default
427d216081 changed the default in the schema,
but didn't handle cases where the schema isn't found.
2021-04-05 11:54:37 -04:00
Matthias Clasen
2e18f1b6e3 textlayout: Remove an unused function 2021-04-05 08:47:53 -04:00
Matthias Clasen
6cf712591f textlayout: Avoid allocations for line iteration
No need to collect the lines firs, and allocate memory
for that. We can just iterate over them right away.
2021-04-04 23:42:58 -04:00
Matthias Clasen
b32cd5d328 textlayout: Introduce some locals
No need to call _gtk_text_buffer_get_btree over and over.
2021-04-04 22:44:09 -04:00
Matthias Clasen
2af99bd65e textlayout: Create the cursor snapshot on demand
We don't need it all the time.
2021-04-04 22:27:53 -04:00
Matthias Clasen
5b0ea70d1c textattributes: Small docs fix 2021-04-04 22:27:53 -04:00
Matthias Clasen
d719a3d877 textbtree: Return tags in a GPtrArray
One of the callers prefers that, it lets us avoid
copying the array in one place, and generally makes
for better code.
2021-04-04 22:27:53 -04:00
Matthias Clasen
b0df8910ba textlayout: Only get selection color once
No need to do this for every paragraph that is
inside the selection.
2021-04-04 14:20:25 -04:00
Matthias Clasen
5b8bf04035 texttag: Just use qsort
No point in trying to optimize this.
2021-04-04 14:20:25 -04:00
Matthias Clasen
58e44e296f textbtree: Inline node data handling 2021-04-04 14:20:25 -04:00
Matthias Clasen
0334d002c0 textbtree: Speed up _gtk_text_btree_find_line_top
Another place where we can avoid allocating a stack
piecemeal.
2021-04-04 14:20:25 -04:00
Matthias Clasen
d731ce49ad textbtree: Don't opencode realloc
We can just use g_realloc here.
2021-04-04 14:20:25 -04:00
Matthias Clasen
a93614409e textbtree: Speed up _gtk_text_line_char_index
No need to allocate a stack piecemeal here.
2021-04-04 14:20:25 -04:00
Matthias Clasen
214e2d14be textbtree: Avoid malloc in one place 2021-04-04 14:20:25 -04:00
Matthias Clasen
67ee6b2740 textlayout: Don't call render_para too much
render_para produces no nodes for an empty paragraph.
Don't call it over and over for those.
2021-04-04 14:20:25 -04:00
Matthias Clasen
07a3fb833c textlayout: Remove some unnecessary code
The same field is set again 2 lines down.
2021-04-04 14:20:25 -04:00
Matthias Clasen
ff38d8cdc0 Modernize error underlines
Implement PANGO_UNDERLINE_ERROR as a dotted line, instead of
squiggly, which looks quite dated.
2021-04-03 13:52:56 -04:00
Matthias Clasen
a8e8e04496 settings: Make font-size changes apply immediately
We need to invalidate the style when font-size changes,
because we propagate this value through the initial
value of the CSS font-size property, and it will not
be recomputed otherwise.
2021-04-02 23:04:09 -04:00
Matthias Clasen
91bcf6f0ba immulticontext: Unset client widget on delegate change
Forgetting to do so was causing the Wayland im context
to leave behind a dead event controller. This was showing
up as a crash when closing the inspector after changing
the im-module property of a GtkText widget. The crash
was delayed until closing the inspector because the
inspector keeps a ref on the event controllers of the
currently shown widget.
2021-04-02 22:24:19 -04:00
Matthias Clasen
a228b2de64 imwayland: Name event controllers
This helps with debugging.
2021-04-02 22:24:00 -04:00
Matthias Clasen
23dab885cd text: Name all event controllers
This helps with debugging.
2021-04-02 22:23:03 -04:00