Commit Graph

38772 Commits

Author SHA1 Message Date
Matthias Clasen
8bcc6b1d96 docs: Fix up syntax
There's no [type_func@...[ syntax, it is all [func@...].
2021-05-22 20:56:14 -04:00
Matthias Clasen
40f292cb13 docs: Sync up debug flag information 2021-05-22 20:46:59 -04:00
Matthias Clasen
601a8de422 treemodel: Cosmetic docs changes 2021-05-22 20:46:59 -04:00
Matthias Clasen
fe564318b6 sortlistmodel: Cosmetic docs changes 2021-05-22 20:46:16 -04:00
Matthias Clasen
09244edc15 expression: Cosmetic docs changes 2021-05-22 17:28:10 -04:00
Matthias Clasen
f5f8f83e3e textbuffer: Cosmetic docs changes 2021-05-22 17:25:27 -04:00
Matthias Clasen
74a39bbae0 textview: Cosmetic docs changes 2021-05-22 17:25:27 -04:00
Matthias Clasen
3ab34ffdc0 text: Cosmetic docs fixes 2021-05-22 17:25:26 -04:00
Matthias Clasen
13a93489b7 widget: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
b35e02db20 shortcutscontroller: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
2d12a7d9ee directorylist: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
9a7e4f4304 eventcontroller: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
876104835e sorter: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
786e28fec0 filter: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
91f7b9663f gtk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Matthias Clasen
f5bd9f721c Merge branch 'wip/exalm/check-activate' into 'master'
checkbutton: Don't allow to uncheck radios by activating them

See merge request GNOME/gtk!3569
2021-05-21 02:06:58 +00:00
Matthias Clasen
4a0d3d7acc docs: Reduce redundancy
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.

This adds a few missing nullable annotations too.
2021-05-20 20:45:06 -04:00
Matthias Clasen
7fe0610b68 introspection: Stop using allow-none
allow-none has been deprecated for a long time
already. Instead use optional and nullable everywhere.
2021-05-20 19:17:49 -04:00
Matthias Clasen
8ba16eb4f1 Documentation fixes
Mostly fixing up indentation of continuation lines,
and other small cleanups.
2021-05-20 19:17:49 -04:00
Matthias Clasen
ab6a5be0f8 Fix documentation syntax
Properties use : in their link syntax.
2021-05-20 19:16:59 -04:00
Matthias Clasen
94b0907534 Merge branch 'wip/exalm/switch-icons-2' into 'master'
icons: Fix switch-off icon

See merge request GNOME/gtk!3571
2021-05-20 22:49:29 +00:00
Alexander Mikhaylenko
0017b4b69a icons: Fix switch-off icon
It wasn't converted to paths and so wasn't rendered correctly.
2021-05-20 23:36:30 +05:00
Matthias Clasen
bff7ac4a1d popover: Update docs
Remove mention of show/hide animations, and mention
cascading close instead.

Fixes: #3960
2021-05-20 09:18:47 -04:00
Alexander Mikhaylenko
fb6c6c85bf checkbutton: Don't allow to uncheck radios by activating them
Do the same check as when clicking.
2021-05-20 14:38:33 +05:00
Alexander Mikhaylenko
bad01edd2c checkbutton: Sync the indicator state with the widget
Clicking the whole check button toggles it, so make sure the hover and
active states are propagated to the indicator like in GTK3.
2021-05-20 12:17:45 +05:00
Matthias Clasen
7de266a620 Merge branch 'wip/carlosg/sequence-accepted-in-group' into 'master'
gtkgesture: Apply gesture group state after setting up sequence

Closes #3946

See merge request GNOME/gtk!3560
2021-05-18 10:58:19 +00:00
Carlos Garnacho
6b7b232114 gtkwindow: Fix "shadowed" checks for GTK grabs
We iterate here from the target widget up the toplevel checking
for the previous and new grab, there's however 2 bugs here:
- The check for is_shadowed was different to the check for was_shadowed
- The loop started with the assumption that the widgets did not hold
  a grab, just to change it if the grab widget was found. (or maybe
  it's the other way around? it's unclear with the differing checks
  for past/present state).

Make these checks consistent, and ensure we start with the right
assumption for the past/present grabbing state, and accounting that
new/old grab widgets may or may not be part of the pick stack.
2021-05-18 00:16:55 +02:00
Carlos Garnacho
0a5d21ca9e gtkwindow: Rename function
With gtk_grab_notify_foreach() just taking care of emitting crossing
notifications due to the GTK grab change, rename it to a more apt
gtk_synthesize_grab_crossing().
2021-05-18 00:16:48 +02:00
Carlos Garnacho
f003a4c6cc gtkwindow: Simplify GTK grab notification
The _gtk_widget_grab_notify() function just (maybe) did a) reset
controllers and b) hide toplevels. The second part was a testing
remnant introduced in commit 024d832d94, not part of the original
fix.

Do the former more concisely, called from the place where we figure
out whether a widget's ability to receive events changed due to
GTK grabs. It's across those changes that we are interested in
resetting the controllers.

With the gestures being reset both ways, GtkWindowHandle (and
probably other) gestures are now able to reset after a GTK grab
takes input away (e.g. GtkMenuButton). This could be seen as
a sudden jump the next time they'd be dragged with the mouse,
as the gesture would "resume" the previous interaction.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3942
2021-05-18 00:16:48 +02:00
Carlos Garnacho
53df32e6cf gtkgesture: Apply gesture group state after setting up sequence
When a new sequence is added to a GtkGesture, its state is looked
in other gestures in the same group, and made to match in this
gesture. This however happened a bit too early, before the
gesture touchpoint was fully set up. As this may result in signal
emission and whatnot, it's a good idea to make it happen with a
fully set up touchpoint.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3946
2021-05-18 00:16:12 +02:00
Alexander Mikhaylenko
4f16e661cf theme: Specificity bump for dropdowns
Fix a fallout from d56711b5d8
2021-05-17 23:26:08 +05:00
Alexander Mikhaylenko
d56711b5d8 listitemwidget: Have .activatable style class if the item is activatable
Match GtkListBox, so it's possible to use the same styles for them.

Update GtkListView and GtkGridView docs to reflect that, fix a few gtk-doc
formatting leftovers along the way.
2021-05-17 18:10:35 +05:00
Alexander Mikhaylenko
27e662cfd1 emojichooser: Set selection-mode=none on the toolbar flowbox
Selection is never used there, avoid unwanted selected states if clicking
outside the buttons.
2021-05-17 14:09:03 +05:00
Matthias Clasen
07b5072c9c Merge branch 'matthiasc/for-master' into 'master'
inspector: Use new get_egl_display apis

See merge request GNOME/gtk!3546
2021-05-14 00:40:05 +00:00
Matthias Clasen
8c75e6896e inspector: Use new get_egl_display apis
This makes the code a bit more concise.

Also, get WGL information when we are using it.
2021-05-13 15:25:18 -04:00
Matthias Clasen
bf454e948d Fix picking with transforms
When transforms include scales, we weren't picking
children properly. The special-case in gtk_widget_do_pick
only applies to 2D translations.
2021-05-12 20:58:16 -04:00
Emmanuele Bassi
8ef353a970 docs: Fix indentation of the arguments
The indentation of new lines inside documentation blurbs must be smaller
than 4 spaces, otherwise the Markdown parser will consider the line to
be part of a pre-formatted code block.

Fixes: #3945
2021-05-12 17:38:07 +01:00
Matthias Clasen
ea162ed016 inspector: Avoid a crash with GL variants
When configuring the inspector display, preserve
debug flags that affect which GL variant we pick.
Otherwise, we may end up with a GLX context on the
default display, and an EGL context on the inspector
one. This hopelessly confuses libepoxy, and things
don't go well when that happens.
2021-05-10 21:25:08 -04:00
Matthias Clasen
e2aa161590 inspector: Show EGL info for X11 as well 2021-05-10 21:24:50 -04:00
Matthias Clasen
a723baec4b inspector: Show text direction
This is not a property, so show it on the misc tab.
2021-05-10 20:55:43 -04:00
Matthias Clasen
564d835fba Merge branch 'broadway-display-scale' into 'master'
broadway: Add a setter for display scale

Closes #3934

See merge request GNOME/gtk!3538
2021-05-10 20:11:38 +00:00
Matthias Clasen
b13c2e17f1 inspector: Support scale changes on Broadway 2021-05-10 10:55:41 -04:00
Matthias Clasen
7259be35b0 Merge branch 'file-replace-trap' into 'master'
print-editor: Fix saving

See merge request GNOME/gtk!3536
2021-05-09 23:06:49 +00:00
Matthias Clasen
0108ffe059 inspector: Fix saving css
g_file_replace_contents() does not accept -1
as length, unlike similar apis.
2021-05-09 11:19:43 -04:00
Matthias Clasen
fef9f1187d Merge branch 'matthiasc/for-master' into 'master'
fontbutton: Quote font family names

See merge request GNOME/gtk!3534
2021-05-09 14:43:03 +00:00
Alexander Mikhaylenko
435a8f6337 theme: Fix GtkActionBar spacing 2021-05-09 17:01:36 +05:00
Alexander Mikhaylenko
2c8e4573f2 actionbar: Fix the css node docs 2021-05-09 16:55:48 +05:00
Alexander Mikhaylenko
b45721373a action-bar: Add start and end style classes to GtkActionBar boxes
Make it possible to add spacing to them from the theme without affecting
the center child should it happen to be a box.
2021-05-09 16:54:59 +05:00
Matthias Clasen
e0ebf4e401 fontbutton: Quote font family names
Otherwise, spaces in family names will trip up
the css parser.
2021-05-08 20:54:50 -04:00
Marco Trevisan (Treviño)
0769dfbd32 emoji: Try to load emoji data using both language and territory
When loading the emoji data we just try to get the data for a language
while there may be territory specializations and emojibase provides
them.

So, split the loading function and try to load the data for the fully
defined language string (i.e. `it-ch`) before loading the generic one
for the language (i.e. `it`) and eventually falling back to the generic
english.
2021-05-07 16:10:29 +02:00
Matthias Clasen
633d783f0c Merge branch 'carlosgc/calendar-day' into 'master'
calendar: value of day property is shifted by 1

See merge request GNOME/gtk!3524
2021-05-07 11:42:59 +00:00
Matthias Clasen
3ad7d304bd Merge branch 'update-emoji-data' into 'master'
emoji: Update data to CLRD v39

See merge request GNOME/gtk!3520
2021-05-07 11:05:46 +00:00
Carlos Garcia Campos
7b2b8b86e1 calendar: do not allow to set 0 as day
We no longer unselect the current day when 0 is set, so update the
documentation and the property definition.
2021-05-07 12:13:49 +02:00
Carlos Garcia Campos
1f8985e476 calendar: value of day property is shifted by 1
The day is a number between 1 and 31 and that's what we get from
GDateTime.
2021-05-07 11:10:36 +02:00
Matthias Clasen
59cc3a9f86 Merge branch 'hidden-mnemonics-fix' into 'master'
label: Make hidden mnemonics work again

See merge request GNOME/gtk!3518
2021-05-07 00:34:33 +00:00
Matthias Clasen
febd143ac8 Merge branch 'emoji-data-prefix-fix' into 'master'
emoji: Use a portable and configuration-dependent path to load the data

See merge request GNOME/gtk!3522
2021-05-06 15:33:15 +00:00
Marco Trevisan (Treviño)
4a4525a65d emoji: remove duplicated include 2021-05-06 16:00:06 +02:00
Marco Trevisan (Treviño)
c98dd1afb9 emoji: Use a portable and configuration-dependent path to load the data
Load the emojis data in all the platforms, respecting the configured
GTK_DATA_PREFIX
2021-05-06 16:00:06 +02:00
Dan Cîrnaț
bd7b29a6c4 Only compile gtkmountoperation-stub if the X11 backend is not enabled 2021-05-06 10:38:41 +02:00
Marco Trevisan (Treviño)
ba3cbac21a emoji: Update data to CLRD v39
This is based on version 6.2.0 of emojibase, containing CLRD 39

http://cldr.unicode.org/index/downloads/cldr-39
https://github.com/milesj/emojibase/blob/b3c9a78/packages/data/CHANGELOG.md
2021-05-06 05:08:37 +02:00
Matthias Clasen
d94c386320 label: Make hidden mnemonics work again
The change in 875a92b95f made labels strip
out underlines earlier, but overlooked that this made
mnemonics not work before the timeout to show them
has passed. That was unintentional. Make mnemonics
work regardless of their visibility, again.
2021-05-05 22:55:52 -04:00
Matthias Clasen
65017a0031 Merge branch 'bilelmoussaoui/trick-gir-list-position' into 'master'
gtk: trick g-ir scanner to add INVALID_LIST_POSITION

See merge request GNOME/gtk!3513
2021-05-05 00:04:16 +00:00
Bilal Elmoussaoui
dc5aab62c8 gtk: trick g-ir scanner to add INVALID_LIST_POSITION
without it, the define doesn't get picked in the introspection data
2021-05-05 00:45:21 +02:00
Alexander Mikhaylenko
0e58bfe90e texthandle: Add a contents css node
Allow to theme it including using css transforms to avoid having assets.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3475
2021-05-04 23:53:05 +05:00
Matthias Clasen
e3e0342db7 Merge branch 'wip/exalm/switch-icons' into 'master'
icons: Fix switch icon names

Closes #3920

See merge request GNOME/gtk!3509
2021-05-04 16:18:29 +00:00
Matthias Clasen
b1f12a0535 Merge branch 'wip/exalm/icons' into 'master'
Update icons from adwaita-icon-theme

Closes #2656

See merge request GNOME/gtk!3510
2021-05-04 16:18:00 +00:00
Alexander Mikhaylenko
60f4b07196 icons: Update from adwaita-icon-theme
Also add the missing edit-clear RTL variant.
2021-05-04 19:12:04 +05:00
Alexander Mikhaylenko
4c60dac9cb icons: Remove media-playback-start-symbolic-rtl
See https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/issues/101
2021-05-04 19:12:04 +05:00
Alexander Mikhaylenko
48d95d2d7a icons: Fix switch icon names
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3920
2021-05-04 17:49:07 +05:00
Alexander Mikhaylenko
f3633d46ca cssselector: Fix max_selector usage
Reverts 2ae8ace784 other than code style
fixes.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3100
2021-05-04 12:34:29 +05:00
Matthias Clasen
da613c504b Merge branch 'wip/exalm/textview-selection' into 'master'
textview: Selection rendering fixes

See merge request GNOME/gtk!3503
2021-05-03 23:55:46 +00:00
Alexander Mikhaylenko
316c783fce label: Update selection node and redraw on state changes
Mirror GtkText and GtkTextView.
2021-05-04 02:29:10 +05:00
Matthias Clasen
9e952bc7ff dragsource: Keep the source alive long enough
When a drop causes the event controller to be finalized
(directly or indirectly), we end up segfaulting while
trying to wrap up the drag operation. So, keep a reference
on the GtkDragSource from when the drag begins to when
it is done.

This fixes a crash in gnome-todo when dragging tasks.
2021-05-03 17:00:17 -04:00
Alexander Mikhaylenko
e4832a9e94 text: Queue redraw on state changes
Mirror GtkTextView.
2021-05-04 01:20:53 +05:00
Alexander Mikhaylenko
70ee86c951 textlayout: Clip selection bounds to the line extents
The rest of the line will be painted separately.
2021-05-04 01:08:19 +05:00
Alexander Mikhaylenko
167134e1a8 textlayout: Support fully transparent selection text
Pango treats 0 alpha value as a unset alpha, so we have to special case it.
2021-05-04 00:16:05 +05:00
Alexander Mikhaylenko
0fa4b7a249 textview: Invalidate selection when its style changes 2021-05-04 00:16:05 +05:00
Alexander Mikhaylenko
f413d5ef22 textlayout: Only special case selection rendering for opaque colors
If the selection is partially transparent, it may still be desirable to
see the colors from tags underneath.
2021-05-04 00:16:05 +05:00
Matthias Clasen
a49ff5a1c4 textbtree: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
faf56a8abe stack: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
e510538f37 printoperation: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
b2bf48c3f0 listbase: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
cf0330d601 filterlistmodel: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
2f51f5affe emojichooser: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
a69ae36a99 fnmatch: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
6863528df1 a11y: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
f9d6134247 inspector: Improve monitor information display
Avoid a nested listbox, show the connector,
don't show information we don't have. Also,
disconnect all signal handlers from the display
when the inspector is going away.
2021-05-02 21:02:09 -04:00
Matthias Clasen
dfecc8fe02 inspector: Show keyboard layouts 2021-05-02 21:02:09 -04:00
Matthias Clasen
0768cfb7df shortcuts: Ignore consumed modifiers for mnemonics
This is necessary to make mnemonics like Alt-1 work in
layouts where numeric keys are shifted, like AZERTY.

Fixes: #3912
2021-05-02 18:33:44 -04:00
Matthias Clasen
32280090fe Check for root being a GtkWindow in a few places
These things were showing up as crashes during DND,
when the root is a GtkDragIcon. I'm sure there's more.
2021-04-30 13:45:39 -04:00
Geyslan G. Bem
65575fe0d0 gtkplacessidebar.c: fix coding style
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-04-28 08:42:59 -03:00
Geyslan G. Bem
1635998ac3 gtkplacessidebar.c: add bookmark null checking
This fixes nautilus crash and perhaps other callers issues.
Nautilus (and sometimes glib) crashes with malformed URI inside of the
bookmarks file .config/gtk-3.0/bookmarks when it has no LABEL.

This is result from the closed glib MR #2065 analysis and agreement.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2065#note_1091979

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-04-27 11:58:31 -03:00
Matthias Clasen
aa569acaa1 window: Don't let solid-csd linger
Just from reading the code, it seems that we
should unset .csd and .solid-csd at the same
time, since the are mutually exclusive and
we unset them here so realize() can set one
of them again.
2021-04-24 11:29:19 -04:00
Matthias Clasen
1c1c030b8e Simplify shadow conditions
The code in gtkwindow.c for dealing with the various
combinations of client-side decorations and client-side
shadows is entirely too complicated.

This commit does not really clean it up, but simplifies
one of the shadow conditions far enough to make some
sense.

With this change, I get the expected decorations in
all the cases I can easily reproduce locally.
2021-04-24 11:07:20 -04:00
Matthias Clasen
628d5406d7 x11: Fix shadows
Commit a2cd21cab6 changed a condition and inadvertedly
broke client-side shadows on X11. Change this back.

Fixes: #3896
2021-04-24 09:19:18 -04:00
Matthias Clasen
b2f3a3220e a11y: Don't sent redundant property changes
We were sending a property changed event for every set
property whenever we were sending any updates.
2021-04-23 07:34:00 -04:00
Matthias Clasen
13f9ca60d5 Merge branch 'gtk4-listbox-selection' into 'master'
Allow repeated selection extension on gtklistbox

Closes #3887

See merge request GNOME/gtk!3461
2021-04-22 23:29:45 +00:00
Emmanuele Bassi
8789e78796 a11y: Update the level property for tree expanders
We already have the depth of a tree expander in order to compute the
indentation.

Fixes: #3892
2021-04-22 14:40:35 +01:00
Matthias Clasen
be927d9ce6 Merge branch 'resize-borders' into 'master'
window: Fix up resize borders

Closes #3856

See merge request GNOME/gtk!3467
2021-04-22 11:13:20 +00:00
Matthias Clasen
dcb5a74275 Merge branch 'a11y-debug' into 'master'
Some a11y improvements

See merge request GNOME/gtk!3455
2021-04-22 11:04:30 +00:00
Matthias Clasen
8f70f1449d Merge branch 'gtk4-compose-modifiers' into 'master'
imcontextsimple: Ignore more modifiers in compose

See merge request GNOME/gtk!3468
2021-04-22 10:58:24 +00:00
Matthias Clasen
b25bc36d33 Merge branch 'wip/muktupavels/solid-csd' into 'master'
theme: fix solid-csd style

See merge request GNOME/gtk!3460
2021-04-22 10:48:22 +00:00
Matthias Clasen
da4e2a2976 theme: Make solid borders look better
As pointed out by Alberts Muktupāvels, without this,
we are missing the inner edge of the frame.
2021-04-22 06:45:28 -04:00
Matthias Clasen
f8dcda80cf theme: Fix solid-csd borders
The selectors did not apply anymore.
Based on a patch by Alberts Muktupāvels.
2021-04-22 06:45:28 -04:00
Matthias Clasen
01d81ffc17 window: Make resize border size independent
Deriving the resize border size from the shadows
carries the risk that we might end up with uneven
resize borders (or none at all, on some sides).

So, justs enforce that we have a big enough shadow
width on all sides.
2021-04-22 06:45:28 -04:00
Ulli Kehrle
c78ec37d83 imcontextsimple: Ignore more modifiers in compose
Previously it was impossible to compose characters on higher levels of
some keyboard layouts as pressing the level selection key would just
exit compose mode.

Examples for affected keyboard layouts include the Latvian
apostrophe-variant "lv(apostrophe)" (latched third level), the extended
German keyboard layout "de(e1)" (latched fifth level) as well as the
multilingual Canadian keyboard layout "ca(multix)" and the German
neo-layout "de(neo)" and its descendants (shifted fifth level).

To reproduce, set a compose key and select the Latvian apostrophe layout.
Notice that you now can input [ by pressing first the ' and then the 8-key.
Then pressing <compose>'8'8 should produce ⟦, but prior to this patch it
did not.
2021-04-22 03:56:30 +02:00
Matthias Clasen
a2cd21cab6 window: Tweak resize borders
Make windows resizable in the padding and border
area of the css box as well. This naturally makes
solid-csd borders work again.
2021-04-21 21:09:09 -04:00
Matthias Clasen
760e60fa04 window: Fix up resize borders
The invisible resize borders have been wider than they
should, for a while. Go back to a size close to what
we have in GTK3.

To summarize: resize borders will be at most 12 pixels
on each size, but never wider than the windows shadow.
The resize corners have 'legs' of 24 pixels where you
still get a corner resize cursor.

Fixes: #3856
2021-04-21 20:09:38 -04:00
John Renner
81914f466d Allow repeated selection extension on gktlistbox 2021-04-21 14:18:29 -07:00
Matthias Clasen
ebd8338795 Merge branch 'im-cursor-pos' into 'master'
imcontext: Fix cursor positions

Closes #3885

See merge request GNOME/gtk!3464
2021-04-21 17:43:12 +00:00
Matthias Clasen
11d637f869 Merge branch 'wip/oholy/placesview-default-location-regression' into 'master'
placesview: Open location even if mount was not found

Closes nautilus#1811

See merge request GNOME/gtk!3435
2021-04-21 12:22:17 +00:00
Emmanuele Bassi
b24fedda49 a11y: Update the labelled-by relation of GtkTreeExpander
Whenever we change the :child property, we need to update the
labelled-by relation.
2021-04-21 11:43:16 +01:00
Emmanuele Bassi
57cc2c4918 a11y: Set state on the GtkTreeExpander widget
Instead of setting it on its internal child.
2021-04-21 11:43:11 +01:00
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
8f9145109b a11y: Pair window:activate with window:deactivate signal
Orca needs both events in order to decide whether or not to subscribe to
other event/state changes in a window.
2021-04-21 10:22:20 +01:00
Matthias Clasen
99750ac7ed a11y: Realize notebook tabs when switching
We're not moving focus here, so we can't rely
on that to conjure the a11y objects into existence.
2021-04-20 20:35:22 -04:00
Alberts Muktupāvels
f89bad7f33
theme: fix solid-csd style
Move .solid-csd style out of .csd parent and adjust it so windows
look similar / same to GTK 3 windows:
- 4px padding.
- extra shadow.

https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086351
https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086377
2021-04-20 22:02:10 +03:00
Matthias Clasen
b97d0a3940 a11y: Avoid spurious selection changed events
Only send selection-changed events when we either
had a non-empty selection before, or have one now.

This should help orca speak the right things, and
not the wrong things.

Related: #3549
2021-04-20 13:23:56 -04:00
Emmanuele Bassi
639932ad8a a11y: Emit window:activate event
Orca uses the window:activate event type to track top levels, and avoid
being spammed by events coming from non-focused windows.
2021-04-20 17:24:13 +01:00
Matthias Clasen
1a944b2824 stackswitcher: Set accessible label properties
This makes the tabs in about dialogs come out as
'About', 'Credits', and 'System', instead of
'Tab', 'Tab', 'Tab'.
2021-04-19 22:11:55 -04:00
Matthias Clasen
ae83b79984 a11y: Emit focus events
Orca relies on these to keep track of the focus location,
ignoring the focused state. With this change, orca can
once again speak text in entries as I type.
2021-04-19 21:29:17 -04:00
Matthias Clasen
5f2c08cef1 a11y: Make things appear on focus in
We are starting with a pretty empty a11y object tree,
and we want orca to bring more of it into existence
by navigating the tree. But that only happens when we
send it events. Primarily focus events, which come in
from GTK via the platform_change mechanism. So realize
the context when we are sending platform_changes,
otherwise, orca never gets the mesage.
2021-04-19 20:39:32 -04:00
Matthias Clasen
a455db01a0 a11y: Actually set accessible roles
With most context realization happening inside
GtkAtspiContext in response to D-Bus calls, the
code in gtk_widget_realize_at_context that sets
the role is not executed for most accessibles,
causing them to be stuck with the 'filler' role
that makes orca ignore them.

To fix this, split gtk_widget_realize_at_context
into the actual context realization (getting on
the bus) and the setting of widget-specific
properties, and do the latter part when the
widget is rooted.

This makes accerciser report proper roles for
entries and buttons. Orca still has an issue
with getting the hierarchy populated.
2021-04-19 19:22:20 +01:00
Matthias Clasen
9e8187bdc4 a11y: Track window states more closely
Orca ignores events unless the object is inside an object
with role window and states ACTIVE and SHOWING. To arrange
for this, introduce a new ACTIVE platform state, and set it
for windows when they are active.

This gets orca to be a lot more talkative.
2021-04-19 19:22:20 +01:00
Matthias Clasen
9fbd11e1be a11y: Add the root object to the cache
Not 100% sure this is necessary, but maybe it helps
to get orca up to speed.
2021-04-19 19:22:20 +01:00
Matthias Clasen
aa09737d4d atspicontext: Remove an unused field
We don't make any use of the cache field, so drop it.
2021-04-19 19:22:20 +01: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
Ondrej Holy
ddeabc7e19 placesview: Open location even if mount was not found
Some locations have to be mounted, but their mounts are not user-visible
(e.g. smb-browse). Though this is maybe a bit weird, it is how it works
for years. The problem is that the commit 267ea755, which tries to get the
default location for opening, caused regression as it doesn't expect such
possibility. Before this commit, such locations were opened without any
issue, but nothing happens currently after clicking to "Connect" except of
clearing the "Connect to Server" entry. Let's fallback to the original
location if the mount was not found to fix this regression.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1811
2021-04-13 17:33:03 +02: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
Matthias Clasen
e7284c23da inspector: Support copying nodes to clipboard
Add a button that copies the serialization of the
selected node to the clipboard.
2021-04-02 21:38:14 -04:00
Matthias Clasen
36da7c3075 Merge branch 'matthiasc/for-master' into 'master'
comboboxtext: Remove misleading docs

Closes #3824

See merge request GNOME/gtk!3396
2021-04-03 00:04:36 +00:00
Matthias Clasen
a3b69f1101 Merge branch 'fix-initial-font-selection' into 'master'
fontchooser: Fix initial font selection

Closes #3687

See merge request GNOME/gtk!3392
2021-04-02 23:45:59 +00:00
Matthias Clasen
9f2d1ff264 comboboxtext: Remove misleading docs
The entry is no longer accessible.
The docs were outdated.

Fixes: #3824
2021-04-02 19:44:30 -04:00
Chris Mayo
ffa9814dd0 button: Style .keyboard-activating on frameless buttons
The use of the keyboard-activating CSS class for buttons was added
in [1], but the style did not apply to buttons with has-frame=FALSE.

[1] 00923615f4 ("button: Add back visual feedback for keynav", 2021-04-01)
2021-04-02 19:24:51 +01:00
Matthias Clasen
8caadaf404 fontchooser: Fix initial font selection
The change in 740559a54f to populate the list incrementally
broke initial font selection. Fix that, by trying to select
until the incremental filling is done.

Fixes: #3687
2021-04-02 01:06:23 -04:00
Matthias Clasen
469228fcd7 Merge branch 'theme-reorg' into 'master'
Reorganize our themes

See merge request GNOME/gtk!3079
2021-04-02 03:02:49 +00:00
Matthias Clasen
fd329e0ec5 Make theme fallback working with the new names
Since we are likely going to see theme names like
Adwaita and HighContrast, make fallback work as follows:

Adwaita -> Default
Adwaita:dark -> Default:dark
HighContrast -> Default:hc
HighContrast:dark -> Default:hc-dark
HighContrastInverse -> Default:hc-dark

Other themes will fall back to Default, as before.
2021-04-01 22:02:38 -04:00
Matthias Clasen
00923615f4 button: Add back visual feedback for keynav
We lost the visual feedback for activating a button
via Space or Enter when the :active pseudo-state became
managed. Bring it back with a style class.

Fixes: #3813
2021-04-01 18:38:11 -04:00
Matthias Clasen
8e9effcc1e Merge branch 'us-intl-compose' into 'master'
Revert Compose sequence changes

Closes #3807

See merge request GNOME/gtk!3386
2021-04-01 20:01:06 +00:00
Matthias Clasen
f98abe4400 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:31:21 -04:00
Chris Mayo
7216f71825 docs: Escape tags in GtkBuilder description
Fixes the tags and the rest of the gi-docgen created HTML page not being
visible in a browser.
2021-04-01 19:21:57 +01:00
Matthias Clasen
0bf3e4c25b Drop Adwaita and HighContrast themes
These themes will reappear in libadwaita in due course.
2021-04-01 12:39:30 -04:00
Matthias Clasen
8938b09bc9 Change the default theme to "Default"
We are not shipping Adwaita anymore.
2021-04-01 12:27:35 -04:00
Matthias Clasen
3654bcfbe8 Make the theme variants available as themes
This makes it easier to implement the theme switching
in widget-factory, since we don't have a variant setting.
2021-04-01 12:27:26 -04:00
Matthias Clasen
0dcf95b898 Reorganize our themes
Rename the included theme to Default, with 4 variants:
light, dark, hc, hc-dark. This replaces Adwaita,
Adwaita:dark, HighContrast and HighContrastInverse.
We still make the themes available under these names,
and we still set up Adwaita-dark and HighContrastInverse
as the dark variants of Adwaita and HighContrast.

The unification of the theme variants under Default
is not quite perfect; it would be nice to merge
the assets/ and assets-hc/ subdirectories and render
all assets from a single svg file.
2021-04-01 11:42:17 -04:00
Benjamin Otte
405fab8b36 Merge branch 'wip/otte/for-master' into 'master'
snapshot: scale border widths when appending border nodes

Closes #3819

See merge request GNOME/gtk!3384
2021-04-01 15:10:50 +00:00
Benjamin Otte
ef455f5c85 snapshot: Move sanity checks to a better place
Fixes cases where the sanity checks would reject valid code, like when
using GL shaders on a scaled transform.

Fixes #3819
2021-04-01 16:53:33 +02:00
Benjamin Otte
05e4cd1579 snapshot: scale border widths when appending border nodes
Found by Matthias on IRC while arguing about GtkSnapshot being too
complicated.
2021-04-01 16:37:43 +02:00
Matthias Clasen
0ea96e3b0c Merge branch 'filechooser-signal-disconnect' into 'master'
filechooserwidget: Disconnect settings signal on dispose

See merge request GNOME/gtk!3383
2021-04-01 14:25:08 +00:00
Alexander Mikhaylenko
d7a5dedd4f 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:30 +05:00
Rafał Dzięgiel
2e65416270
filechooserwidget: Reduce code duplication for disconnecting settings signal
Instead of getting current display before calling settings signal removal,
do it inside remove function and only if there is a signal connection to remove.
2021-04-01 09:36:23 +02:00
Rafał Dzięgiel
13c22e4e2f
filechooserwidget: Disconnect settings signal on dispose
Settings signal was not being disconnected on dispose causing
application crash when user changed icon theme after dialog disposal.
2021-04-01 09:28:37 +02:00
Avinash Sonawane
622bb9186e docs: Cover corner-case of @line_number = total lines in buffer 2021-03-30 17:00:33 +05:30