Commit Graph

72452 Commits

Author SHA1 Message Date
Carlos Garnacho
8e86e6325b gtk/main: Do not use touchpad event sequence for pointer focus lookup
Despite touchpad gestures having a sequence, these must use the logical
pointer focus. Avoid using the sequence for GtkPointerFocus lookups with
those events, in order to ensure those events make it all the way to the
intended target.

This is fallout from adding GdkEventSequence information to touchpad
gestures.
2022-01-26 15:59:36 +01:00
Carlos Garnacho
2b41e72196 gdk: Always request "flush events" frame clock phase on events
This change is done for 2 reasons:

- The logic to request this phase when compressing scroll events is
  slightly broken. If there are multiple scroll events that are
  coalesced into one, the surface frame clock will not get this request.
  The worst case is having >= 2 scroll events on every frame, as the
  compressed event will be left in the queue, and be further compressed
  on future events.

- Even scroll events aside, this phase is requested in oddly specific
  places that are not enough to cover all events, others do rely on
  unrelated GdkFrameClock activity that happens to flush the events
  as well.

Unify this phase request so it explicitly happens on the arrival of any
event. This ensures that events (compressed or not) will be handled
promptly after arrival.
2022-01-26 15:49:29 +01:00
António Fernandes
1a64eeb88e gtkbitset: Define autocleanup function 2022-01-25 21:33:31 +00:00
Emmanuele Bassi
2f8eac2c0a Merge branch 'fix-popovermenu-removechild' into 'main'
popovermenu: Fix crash when removing child

See merge request GNOME/gtk!4393
2022-01-25 15:40:28 +00:00
Kévin Commaille
aaba777ad0
popovermenu: Fix crash when removing child
gtk_menu_section_box_remove_custom was looking in the wrong place for the
stack ancestor, causing an assertion error.
2022-01-25 15:31:00 +01:00
Guido Günther
a580547f47 gtktext: Make sure input method sees focus in
Currently when the widget is realized after the focus in event the input
method isn't activated as enable is never sent. The call trace is

  gtk_text_focus_changed ->
    gtk_im_context_focus_in ->
      gtk_im_context_wayland_focus_in

which returns early as self->widget is NULL since it's set up in
gtk_text_realize() via gtk_im_context_set_client_widget(). Handle that
case by invoking gtk_im_context_focus_in() from gtk_text_realize() too.

A case where the above happens is a GtkSearchEntry in a GtkSearchBar.
E.g. in gtk4-demo when starting the demo and then hitting the search
button right away.
2022-01-25 11:15:29 +01:00
Boyuan Yang
00ee7ffa6a Update Chinese (China) translation 2022-01-24 19:46:37 +00:00
Leônidas Araújo
f02b7d55b1 Update Brazilian Portuguese translation 2022-01-24 17:08:46 +00:00
Rafael Fontenelle
bed709a322 buildertool: use curly apostrophe 2022-01-24 17:04:17 +00:00
Bilal Elmoussaoui
b362eeefdf g-i: mark GtkSnapshot to_(node|paintable) as nullable
Fixes an upstream issue reported at https://github.com/gtk-rs/gtk4-rs/issues/845
2022-01-23 22:11:07 +00:00
Matthias Clasen
7b02498963 Merge branch 'matthiasc/for-main' into 'main'
Use pango api better

See merge request GNOME/gtk!4412
2022-01-23 15:19:39 +00:00
Matthias Clasen
6fd53f28f3 Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.#
2022-01-23 09:55:46 -05:00
Matthias Clasen
fefc8b5a82 Merge branch 'matthiasc/for-main' into 'main'
Use pango api better

See merge request GNOME/gtk!4411
2022-01-23 14:34:58 +00:00
Matthias Clasen
4fe976549e Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.
2022-01-23 09:09:57 -05:00
Matthias Clasen
044ff82d0b Merge branch 'matthiasc/for-main' into 'main'
Use pango api better

See merge request GNOME/gtk!4409
2022-01-23 04:29:58 +00:00
Matthias Clasen
feac1e5fba Use pango api better
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.
2022-01-22 23:10:53 -05:00
Yaron Shahrabani
dd5455fcd2 Update Hebrew translation 2022-01-21 16:04:24 +00:00
Yaron Shahrabani
315971f02d Update Hebrew translation 2022-01-21 15:53:39 +00:00
Emmanuele Bassi
a092986af3 Merge branch 'targz' into 'main'
ci: Put gtk dll into an archive

Closes #4653

See merge request GNOME/gtk!4403
2022-01-19 19:58:36 +00:00
Sri Ramkrishna
6633f4e02f Update docs/reference/gtk/migrating-3to4.md 2022-01-19 19:24:01 +00:00
Guido Günther
ee8970f23d ci: Only use letters in "expose_as" 2022-01-19 18:51:29 +01:00
Guido Günther
46f1e4c414 ci: Put gtk dll into an archive
This avoids the wild card that makes the CI fail
2022-01-19 18:51:16 +01:00
Dz Chen
a853e27765 Update Chinese (China) translation 2022-01-19 15:44:00 +00:00
Matthias Clasen
68985d42bb Merge branch 'win32-gl-improvements' into 'main'
Windows: Some fixes to GL context realization (EGL/GLES in particular)

See merge request GNOME/gtk!4386
2022-01-19 13:49:40 +00:00
Matthias Clasen
9146a21738 Merge branch 'bilelmoussaoui/g-i' into 'main'
g-i: mark gtk_text_iter_get_child_anchor as nullable

See merge request GNOME/gtk!4401
2022-01-19 13:48:57 +00:00
Luca Bacci
8c2128703b Merge branch 'provide-libgtk-dll-as-ci-artifact' into 'main'
Provide GTK DLL as GitLab CI artifact

See merge request GNOME/gtk!4395
2022-01-19 11:17:28 +00:00
Luca Bacci
b2d9cae0ec Provide GTK DLL as GitLab CI artifact 2022-01-19 11:17:28 +00:00
Carlos Garnacho
11eb66298d Merge branch 'context-early' into 'main'
gtkimcontextwayland: Remember context on focus-in so enable can happen later

See merge request GNOME/gtk!4397
2022-01-19 10:48:48 +00:00
Bilal Elmoussaoui
0f67e46549 g-i: mark gtk_text_iter_get_paintable as nullable 2022-01-19 10:22:40 +00:00
Guido Günther
45397534eb gtkimcontextwayland: Save context even when text_input isn't around yet
Remember the current context on focus-in even though the text-input
isn't set up yet. This helps in the case where the text-input is not yet
created but a widget already got focused. Without that the enable()
invocation in text_input_enter() woulnd't be invoked leaving the input
method disabled.

This fixes

    gtk4-demo --run=search_entry

which would initially not show the on-screen keyboard when e.g using
phoc/sway as compositor.
2022-01-19 10:20:46 +00:00
Bilal Elmoussaoui
ffa93b87f8 g-i: mark gtk_text_iter_get_child_anchor as nullable 2022-01-19 10:18:40 +00:00
Chun-wei Fan
0fe37d1828 gdkdisplay-win32.c: Clean up GL initialization further 2022-01-19 11:56:32 +08:00
Chun-wei Fan
43839898b3 GDK: Force GLES 3.0+ on libANGLE
...when libANGLE is being used on Windows, by checking for a
Windows-specific an ANGLE-specific extension.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
6f2848c311 Cleanup "GDK/Win32: Try to fix initializing GLES contexts"
As per Benjamin's suggestions, cleanup the previous implementation on
initializing the GLES context on Windows, so that we use more items that are
already in GDK proper and integrate two functions into one.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
38c17c1f79 gdkglcontext-win32-wgl.c: Cleanup GL context creation
Instead of first trying to explicitly ask for a WGL 4.1 context, ask for
the WGL context version that matches what is reported via
epoxy_gl_version(), so that we get the maximum WGL version that is
supported by the graphics drivers, and make sure any WGL contexts that
are shared with this (initial) WGL context are created likewise.

We can try to do a default-bog-standard 3.2 core WGL context creation
if the need arises, but let's leave that alone for now.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
b85aa10700 gdkglcontext.c: Ensure EGL contexts are in-sync with shared context
The EGL context that we are actually creating must have matching OpenGL/ES
versions and allowed GL API set with the previously-created EGL context
that will be shared with it so that they can interoperate together, if
applicable.

This will fix the situation by making sure that we request for the
OpenGL/ES version and OpenGL API set that match with what we have in our shared
EGL context.  Otherwise, the newly-created EGL context assumed a OpenGL/ES 2.0
context that supported desktop OpenGL, which may not be what we wanted, such as
in the case of libANGLE.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
598c7d9cf4 GDK/Win32: Try to fix initializing GLES contexts
We are now able to create EGL contexts properly on Windows, but not GLES.  This
tries to fix things by doing the following:

*  Record the GL context type in a more proper fashion, using an Enum.  This
   makes things a bit cleaner.
*  Force GLES-3.0+ contexts, since libANGLE requires this to properly work with
   the shaders-its 2.0 contexts don't work well with our shaders.
2022-01-19 11:56:32 +08:00
Chun-wei Fan
3e9d858af1 gskrenderer.c: Use GL renderer on Windows by default
Since now we have the shaders working on Windows under GLES with libANGLE using
a 3.0+ context, drop the check to fall back to the Cairo renderer when GLES is
being used.
2022-01-19 11:56:32 +08:00
Matthias Clasen
6fd29e6600 Merge branch 'wip/wayland-surface-offset' into 'main'
Fix DND hotspot position under Wayland + EGL/Vulkan

See merge request GNOME/gtk!3705
2022-01-18 23:48:26 +00:00
Matthias Clasen
b67636747b Merge branch 'gdksurface-wayland-assert' into 'main'
gdksurface-wayland: Fix contradictory assert

See merge request GNOME/gtk!4385
2022-01-18 23:46:59 +00:00
Matthias Clasen
ea464c9874 Merge branch 'gsk-transform-nullable' into 'main'
Mark various GskTransform functions as nullable in their return value

See merge request GNOME/gtk!4378
2022-01-18 23:44:23 +00:00
Matthias Clasen
0e9c4a3964 Merge branch 'document_shortcut_func_ret' into 'main'
gtk: document return value of ShortcutFunc

See merge request GNOME/gtk!4389
2022-01-18 23:41:15 +00:00
Matthias Clasen
1b15f89dfd Merge branch 'wip/dont-always-restore-saved-gtk4' into 'main'
wayland: Don't always restore the saved size when floating

Closes #4634

See merge request GNOME/gtk!4394
2022-01-18 23:40:49 +00:00
Matthias Clasen
7192ff672e Merge branch 'build-post-install-query-media-modules' into 'main'
Meson: Also query media modules in post-install

See merge request GNOME/gtk!4380
2022-01-18 23:39:26 +00:00
Matthias Clasen
7a99e03888 Merge branch 'ebassi/fix-release-test' into 'main'
reftest: Avoid assertions being compiled out

See merge request GNOME/gtk!4391
2022-01-18 15:07:37 +00:00
Jonas Ådahl
be7a391a13 wayland: Don't always restore the saved size when floating
We only save the size when we transition from floating to fixed, so that
we can restore the size to the one prior to being fixed.

However, we should not restore to this size whenever we see a 0x0 size
from xdg_toplevel, as it can do that any time it doesn't care about the
size, e.g. when the surface is floating and just changing state.

Fix this by only using the saved size when transitioning from fixed to
floating, not when staying floating while previously floating.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4634
2022-01-18 15:46:10 +01:00
Emmanuele Bassi
23aec81f1a reftest: Avoid assertions being compiled out
Calling functions inside a g_assert() means those functions will be
compiled out when building with G_DISABLE_ASSERT.

This fixes the release job in the CI pipeline.
2022-01-18 14:07:37 +00:00
Alexandros Theodotou
738d962aca
gtk: document return value of ShortcutFunc 2022-01-18 10:58:47 +00:00
Luca Bacci
93bc97b7ec Merge branch 'fix-keyboard-shortcuts-win32' into 'main'
Win32 key events cleanup

See merge request GNOME/gtk!4349
2022-01-17 13:34:17 +00:00
Luca Bacci
243bb57a27
GdkWin32: Add translation result w/o CAPS LOCK to key events for accelerator matching 2022-01-17 14:14:55 +01:00