Commit Graph

69585 Commits

Author SHA1 Message Date
Matthias Clasen
10b302ac29 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-05-03 21:11:53 -04:00
John Renner
f1bfbeba45 Allow repeated selection extension on gktlistbox 2021-05-03 21:11:46 -04:00
Emmanuele Bassi
ca405f1060 a11y: Update the labelled-by relation of GtkTreeExpander
Whenever we change the :child property, we need to update the
labelled-by relation.
2021-05-03 21:11:36 -04:00
Emmanuele Bassi
4baec1ef22 a11y: Set state on the GtkTreeExpander widget
Instead of setting it on its internal child.
2021-05-03 21:11:21 -04:00
Matthias Clasen
d35e069436 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-05-03 21:11:12 -04:00
Emmanuele Bassi
6a95ca6995 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-05-03 21:11:01 -04:00
Matthias Clasen
268c174506 x11: Don't beep on untrusted displays
This can trigger BadAccess, and we don't
want that.

Fixes: #3862
2021-05-03 21:10:56 -04:00
Matthias Clasen
7e3493b15e 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-05-03 21:10:46 -04:00
Alberts Muktupāvels
be65bab5f6 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-05-03 21:10:39 -04:00
Matthias Clasen
c04139405a 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-05-03 21:10:29 -04:00
Emmanuele Bassi
5fc008024b 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-05-03 21:10:24 -04:00
Matthias Clasen
f6bec2edf2 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-05-03 21:10:14 -04:00
Matthias Clasen
c1e68f6044 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-05-03 21:10:08 -04:00
Matthias Clasen
549e5a8e3a 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-05-03 21:10:03 -04:00
Matthias Clasen
5783d8af91 Fix a possible crash in gtk_show_uri
g_file_get_basename can return NULL.
Deal with it somehow.

Fixes: #3883
2021-05-03 21:09:54 -04:00
Matthias Clasen
1926d91e1d 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-05-03 21:08:11 -04:00
Matthias Clasen
0441101786 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-05-03 21:07:53 -04:00
Matthias Clasen
eb8fce3645 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-05-03 21:06:36 -04:00
Matthias Clasen
016294ba6e atspicontext: Remove an unused field
We don't make any use of the cache field, so drop it.
2021-05-03 21:06:31 -04:00
Jason Francis
b9ce81b912 meson: check for madvise() 2021-05-03 21:06:03 -04:00
Matthew Garrett
a9d0563085 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-05-03 21:05:57 -04:00
Matthias Clasen
e6bab9b64c placesview: Fix server mount feedback
We weren't properly resetting the in-entry progress.
2021-05-03 21:05:44 -04:00
Matthias Clasen
513aa20f76 placesview: Fix mounting remote locations
This was broken by a stupid copy-paste error.
2021-05-03 21:05:37 -04:00
Matthias Clasen
83b38e55c0 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-05-03 21:05:14 -04:00
Chun-wei Fan
22b23a6d19 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-05-03 21:05:04 -04:00
Chun-wei Fan
908f5dc142 GSK: 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-05-03 21:04:58 -04:00
Chun-wei Fan
7ef493ec88 GDK: 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-05-03 21:04:51 -04:00
Matthias Clasen
6edfd29df0 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-05-03 21:04:38 -04:00
nana-4
eabbc0ef30 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-05-03 21:04:26 -04:00
Eli Schwartz
bfcd5f4881 meson: only build demo manpages when demos are enabled
Installing them even when manpages are enabled, but the demos are
disabled, produces manpages for unavailable programs...
2021-05-03 21:04:13 -04:00
Matthias Clasen
201fc28a67 x11: Be quiet on exit by default
The condition we check for to catch X servers going away
may not be accurate anymore, and the warning shows up in
logs, causing customers to be concerned. So, be quiet by
default, unless the user explicitly asked for a message.
2021-05-03 21:04:02 -04:00
Ondrej Holy
0026f74dbe 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-05-03 21:03:56 -04:00
Matthias Clasen
d116ba348f ngl: Fix a rare assertion violation
When we clean up the uniform allocations after a frame,
it can happen that our space requirements actually increase,
due to padding that depends on the order of allocations.

Instead of asserting that it doesn't happen, just make
it work by growing our allocation.

Fixes: #3853
2021-05-03 21:03:40 -04:00
Matthias Clasen
06c0012dd4 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-05-03 21:02:53 -04:00
Matthias Clasen
7b84ffd378 icon browser: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-05-03 21:02:45 -04:00
Matthias Clasen
cc5d2f24e8 widget-factory: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-05-03 21:02:38 -04:00
Matthias Clasen
c06462aec0 gtk-demo: Make header buttons not steal focus
This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.
2021-05-03 21:02:32 -04:00
Matthias Clasen
a4aaab2e5b 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-05-03 21:02:26 -04:00
Matthias Clasen
fe237c4030 roundedrect: Speed up contains_rect and friends
gsk_rounded_rect_contains_rect was calling
gsk_rounded_rect_contains_point, which potentially
checks all four corners, for a total of up to 16
corner/point checks. But there is no need to do
more than 4 such checks to answer the question.
2021-05-03 21:02:08 -04:00
Matthias Clasen
ff8f32bf10 nodeeditor: Make the help window wide enough
Make the help window wide enough to show the
tables without wrapping.
2021-05-03 21:01:54 -04:00
Matthias Clasen
8a8edde78d media: Fix a memory leak
This was introduced in e7dc82fa32.
2021-05-03 21:01:46 -04:00
Matthias Clasen
3852512446 gsk: Don't overshadow
Reduce the cairo shadows to the same size as their GL brethren.
2021-05-03 21:01:39 -04:00
Matthias Clasen
c926f9491a 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-05-03 21:01:28 -04:00
Matthias Clasen
03176fe23c 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-05-03 21:01:13 -04:00
Matthias Clasen
d0cb76fff4 ngl: Fix an oversight
All the rest of debug spew goes to stderr here.
2021-05-03 21:00:57 -04:00
Matthias Clasen
d76e106382 wayland: Improve font setting fallback more
We may get a response from the portal that contains
no useful settings at all. In that case, we should
fallback as well.

Fixes: #3838
2021-05-03 21:00:32 -04:00
Carlos Garnacho
f7ab0b19c7 surface: Always set PHASE_PAINT as pending when updates are scheduled
At times (most often when closing subsurfaces that are scheduling
relayouts) the PHASE_PAINT handling gets broken with the following
sequence:

1. Surface receives wl_callback.done for the previous frame.
   Surface is thawed.
2. A new update on the surface is scheduled. PHASE_PAINT is
   requested directly on the frame clock. priv->pending_phase is
   left unset in the surface.
3. Surface gets frozen
4. Frame clock processes the update scheduled at 2. The surface
   is frozen, so paint is prevented. PHASE_PAINT is considered
   handled.
5. Compositor emits wl_callback.done again. Surface is thawed.
6. At this point the machinery is off
   - The surface didn't paint but has pending update regions
   - priv->draw_needed is set in the toplevel and other portions
     of the widget tree
   - So queueing redraws is ineffective at eventually calling
     gdk_surface_schedule_update() again on the toplevel surface.
   - We don't paint anymore, so this broken state is not flushed
     until other subsurface changes manage to schedule the missing
     update.

To fix this, always set PHASE_PAINT in priv->pending_phase when
doing gdk_surface_schedule_update(). If the frame clock turns
around before the surface is thawed, it will still be waiting to
be processed the next iteration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3750
2021-05-03 21:00:19 -04:00
Emmanuele Bassi
b50df28e38 Install documentation in the appropriate place
We're already installing each reference into its own namespaced
directory, so we don't need to add further path elements.

Additionally, with the changes in:

  https://gitlab.gnome.org/GNOME/devhelp/-/merge_requests/20
  https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/54

we can browse the GTK API references in DevHelp.
2021-05-03 21:00:06 -04:00
Matthias Clasen
f97d32e253 wayland: Improve font setting fallback
When we don't get stettings from the portal, the current
fallback is 'awful fonts'. There is no need for that. Instead,
set the fallback values to grayscale antialiasing with slight
hinting.
2021-05-03 20:59:46 -04:00
Matthias Clasen
b7a0744324 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-05-03 20:59:32 -04:00