Commit Graph

69560 Commits

Author SHA1 Message Date
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
Matthias Clasen
3ef8ff2a43 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-05-03 20:59:25 -04:00
Matthias Clasen
b4844e2ace ngl: Fix an oversight
We were special-casing 2D affine transforms,
but overlooked even simpler transforms.
2021-05-03 20:59:16 -04:00
Matthias Clasen
610f5ce75c 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-05-03 20:58:20 -04:00
Matthias Clasen
3c4c7896fc 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-05-03 20:58:13 -04:00
Matthias Clasen
686752a852 comboboxtext: Remove misleading docs
The entry is no longer accessible.
The docs were outdated.

Fixes: #3824
2021-05-03 20:57:38 -04:00
Matthias Clasen
8bb1b8da57 ngl: Avoid huge intermediate textures
Instead of rendering the unclipped child to a texture
(and risking blowing the texture size limit, and bad
downscaling), just render the clipped region, and live
with the fact that we can't cache the rendered texture.

This avoid bad artifacts when scrolling long textviews
in rounded clips.
2021-05-03 20:57:16 -04:00
Matthias Clasen
1b81af591d ngl: Plug a memory leak
This was introduced in f9457af128.
2021-05-03 20:57:10 -04:00
Matthias Clasen
88a8287c1d ngl: Fix downscaled textures
It is not pretty, but at least it works now.
2021-05-03 20:57:05 -04:00
Chris Mayo
8cc2dbe6f8 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-05-03 20:56:56 -04:00
Matthias Clasen
aec29503bf 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-05-03 20:56:36 -04:00
Matthias Clasen
1506a41448 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-05-03 20:56:01 -04:00
Matthias Clasen
63622923f0 Add one more compose test 2021-05-03 20:55:56 -04:00
Matthias Clasen
59c87b8387 Add more compose tests
Test the sequences whose demise made people
unhappy.
2021-05-03 20:55:46 -04:00
Matthias Clasen
fdf71e13c4 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-05-03 20:55:32 -04:00
Chris Mayo
5d49dabade 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-05-03 20:55:24 -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
Carlos Garnacho
1e9e7bf0d9 Merge branch 'wip/exalm/overshoot-changes' into 'master'
scrolledwindow: Cancel overshoot on dimension changes

Closes #3752

See merge request GNOME/gtk!3300
2021-04-01 12:11:15 +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
Matthias Clasen
65a061f3c2 Merge branch 'ebassi/broadway-docs' into 'master'
docs: Update the Broadway instructions

See merge request GNOME/gtk!3380
2021-03-31 21:42:59 +00:00
Matthias Clasen
fc63e6856f Merge branch 'ebassi/docs-links' into 'master'
docs: Update the links to the docs of GTK dependencies

Closes #3817

See merge request GNOME/gtk!3381
2021-03-31 21:42:49 +00:00