Commit Graph

55113 Commits

Author SHA1 Message Date
2d76cd4b2b Update Portuguese translation 2022-10-29 15:46:12 +00:00
bd736aed8c Update Ukrainian translation 2022-10-29 05:46:25 +00:00
89ea9ba600 Update Slovenian translation 2022-10-28 06:33:43 +00:00
b009366e21 Merge branch 'keypad-accels' into 'gtk-3-24'
Differentiate keypad keysyms in accelerators

See merge request GNOME/gtk!5176
2022-10-28 04:02:48 +00:00
6cc0552ab8 Differentiate keypad keysyms in accelerators
When displaying accelerators, differentiate keypad
symbols with a 'KP' prefix. Fixing a 17 year old bug.

Backport of c58d9446f40b36136f25baf.
2022-10-27 14:57:01 -04:00
2703e420ae Merge branch 'wip/carlosg/xdg-activation-3-24' into 'gtk-3-24'
gdk/wayland: Support the xdg-activation wayland protocol (3.24)

See merge request GNOME/gtk!3489
2022-10-26 22:15:11 +00:00
0b4b9f6136 Merge branch 'tooltips-x11-scale-cursor-size' into 'gtk-3-24'
GtkTooltip: Scale the cursor size on X11

See merge request GNOME/gtk!5173
2022-10-26 15:41:23 +00:00
bbce00f3a3 GtkTooltip: Scale the cursor size on X11
GtkSettings/X11 takes the values as provided by
XSettings. Unlike other backends, the values of
XSettings are in physical size (that's because
X11 doesn't support mixed-DPI setups anyway).

Take that in account when retrieving the cursor
size in gtk_tooltip_position ().

Note that this discrepancy between the X11 and
other backends has been fixed in GTK4.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5223
2022-10-26 15:21:38 +02:00
22c95cd1e9 gdk/wayland: Enable xdg-activation only if wayland-protocols >= 1.21
This way we can keep the same wayland-protocols requirement, so the latest GTK3
still builds on distributions shipping older versions of wayland-protocols,
such as Debian Bullseye.

Should fix CI builds as well.
2022-10-25 23:52:47 +02:00
3b25f9a662 gdk/wayland: Check the GdkSurface wl_surface before using it for activation
Double check the GdkSurface has a wl_surface before using it as the activation
token source, since we cannot use NULL surfaces here.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1862
Backport-of: 4b41d4f78ce71b60f0d51837cd1b6a1b346d679d
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-10-25 15:54:05 +02:00
7fa87abf8a gdk/wayland: Dispatch GdkAppLaunchContext activation token in its own queue
Use a separate queue to dispatch the token object exclusively, just like we
do on the GdkSurface activation paths.

Backport-of: fb68600d88d4d334f7da7d079b106a1ef14503a6
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-10-25 15:53:57 +02:00
45f0b5d052 wayland: Use xdg-activation for non-startup initiated focus requests
Currently, we have all the plumbing in place so that GTK consumes the
startup notification ID when focusing a window through the xdg-activation
protocol.

This however misses the case that a window might be requested to be
focused with no startup ID (i.e. via interaction with the application,
not through GApplication or other application launching logic).

In this case, we let the application create a token that will be
consumed by itself. The serial used is that from the last
interaction, so the compositor will still be able to do focus prevention
logic if it applies.

Since we already do have a last serial at hand, prefer xdg-activation
all the way over the now stale gtk-shell focusing support. The timestamp
argument becomes unused, but that is a weak argument to prefer the
private protocol over the standard one. The gtk-shell protocol support
is so far left for interaction with older Mutter.

Backport-of: 4dcacff3120d5c1cef888061dbc42f5fbe093a58
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-10-25 15:53:49 +02:00
e80251e751 wayland: Keep startup_notification_id around long enough
When using xdg_activation we need to keep the id around until we send
the first activate to signal succesful startup.

Backport-of: 999509be619bfa0f50a549489b5ab5c890b574fa
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-10-25 15:53:36 +02:00
54348c5270 wayland: xdg-activation: Don't assume there's a focus surface
Tools like gtk4-launch can't set surface on the activation token so
don't require it. If the compositor requires it we can't do anything
about it anyway. This avoids a critical:

   (gtk4-launch:23497): Gdk-CRITICAL **: 17:07:24.704: gdk_wayland_surface_get_wl_surface: assertion 'GDK_IS_WAYLAND_SURFACE (surface)' failed

Fixes: be4216e051 ("gdk/wayland: Support the xdg-activation wayland protocol")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Backport-of: 4d741bac98f906796d61eebfb4f74f5b1cecb2b6
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-10-25 15:53:26 +02:00
a79d6972e0 gdk/wayland: Support the xdg-activation wayland protocol
This protocol implements the IPC necessary to focus application
windows across launcher/launchee. Add support for it.
2022-10-25 15:50:02 +02:00
84a3ea5ec4 Merge branch 'gtk-cursor-wayland-hotspot' into 'gtk-3-24'
[gtk3] [wayland] Fix hotspot positioning with scaled surface.

See merge request GNOME/gtk!5159
2022-10-21 17:29:31 +00:00
686864a118 [gtk3] [wayland] Fix hotspot positioning with scaled surface.
Fixes !5278 to behave the same way as X11.
2022-10-21 14:22:51 +02:00
95cb7d04c7 Update Bulgarian translation 2022-10-07 09:08:40 +00:00
108343b037 Merge branch 'wl-ime-lockscreen-fixes' into 'gtk-3-24'
gtk3: Backport of !4962. !5050, !5012: gtkimcontextwayland: Refactor handling of client updates

See merge request GNOME/gtk!5091
2022-10-06 10:57:35 +00:00
92813e52cd gtkimcontextwayland: Shuffle full resets after IM changes
Doing reset() on the text widgets after commit and delete_surrounding
is still too eager for some IMs (e.g. those that expect being able
to commit text while keeping a preedit buffer shown).

However, reset() is more of a "synchronize state" action on Wayland,
and it is still desirable to do that after changes that do come from
the IM (e.g. requesting the new surrounding text and cursor/anchor
positions). Notably here, the text_input protocol may still come up
with a preedit string after this state synchronization happens.

Shuffle the code so that the text widgets do not reset() the IM
context after text is deleted or committed, but the Wayland IM does
apply its practical effects after these actions happen. This keeps
the Wayland IM fully up-to-date wrt text widget state, while not
altering the ::commit and ::delete-surrounding-text behavior for
other IM context implementations.
2022-10-06 17:40:38 +07:00
a88e848306 gtktextview: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace	key behavior in	the GNOME Shell OSK, since that	relies
on the surrounding text	being properly updated for the next iteration.
2022-10-06 17:29:50 +07:00
018083fab7 gtkentry: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace key behavior in the GNOME Shell OSK, since that relies
on the surrounding text being properly updated for the next iteration.
2022-10-06 17:29:50 +07:00
fa6aca2925 gtkentry: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.

Since there is going to be an actual IM reset anyways, it does
no longer make sense to try to preserve the old priv->need_im_reset
status during commit handling.
2022-10-06 17:29:50 +07:00
7b1f9a3b08 gtkentry: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.
2022-10-06 17:29:36 +07:00
b0c4196f98 gtkentry: Shuffle the places doing IM reset
During entry widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.

Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.
2022-10-06 17:28:25 +07:00
0a8b0025e3 gtktextview: Shuffle the places doing IM reset
During text widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.

Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.

Also, fix a bug during GtkEventControllerKey::im-update where the condition
on cursor position editability to reset the IM context was inverted.
2022-10-06 17:16:39 +07:00
a2f579eca8 gtkimcontextwayland: Refactor handling of client updates
Currently, the wayland IM context sends zwp_text_input_v3.commit from
a number of places, and some of them with partial data. In order to
make client state updates "atomic" and complete, make the communication
happen over an unified notify_im_change() function that happens on
a narrower set of circumstances:

  - The GtkIMContext is reset
  - The GtkIMContext is just focused
  - The gesture to invoke the OSK is triggered
  - The IM context is reacting to changes coming from the compositor

Notably, setting the cursor location or the surrounding text do not try
to commit state on their own, and now will be flushed with the corresponding
IM update or reset. But also, these requests won't be prevented from
happening individually on serial mismatch, instead it will be the whole
state commit which is held off.

With these changes in place, all client-side updates are notified
atomically to the compositor under a single .commit request.
2022-10-06 17:16:33 +07:00
293cee1724 Merge branch 'wip/carlosg/flush-uncompressed-motion' into 'gtk-3-24'
gdk: Ensure GdkFrameClock::flush-events with uncompressed motion

See merge request GNOME/gtk!5075
2022-10-03 20:48:10 +00:00
5ea961ed93 gdk: Ensure GdkFrameClock::flush-events with uncompressed motion
Sometimes, there may be motion events left in the queue, because at the
time of handlign these motion events the GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS
phase is not requested.

Ensure that, when finding motion events on a window that does not disable
motion compression, the events are anyways flushed, so they can be processed
early by the window/widget event handlers.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4946
2022-10-03 16:42:40 +02:00
1ad49f238c Merge branch 'wip/carlosg/translate-string-selections' into 'gtk-3-24'
wayland: Translate STRING/UTF8_STRING selection atoms to mimetypes

See merge request GNOME/gtk!5072
2022-10-03 09:06:51 +00:00
725ae0c878 Update Friulian translation 2022-10-03 08:39:31 +00:00
0c1ea92219 wayland: Translate STRING/UTF8_STRING selection atoms to mimetypes
Since the GDK API layer in 3.x is considerably tied to X11 details,
it makes sense to provide this bit of translation in case the app
uses these exclusively and does not use actual mimetype strings.
Provide this bit of translation of X11 selection atoms to mimetypes.

While at it, use the right zwp_primary_selection_source_v1 API with
primary selection data sources. From the looks of it, this just
happened to work.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5217
2022-10-03 10:35:48 +02:00
67432fe3bc Update Croatian translation 2022-10-02 14:37:54 +00:00
0bd5cfb1ce Update Georgian translation 2022-10-02 10:38:04 +00:00
80d8970072 Merge branch 'wip/titlebar-gesture-gtk3' into 'gtk-3-24'
[3-24] wayland: Add support for gtk_surface1_titlebar_gesture()

See merge request GNOME/gtk!5070
2022-10-01 01:34:33 +00:00
45ba6e9329 wayland: Add support for gtk_surface1_titlebar_gesture()
This adds a private GDK API that GTK calls using GDK_PRIVATE_CALL(). It
is more or less a copy of the GdkSurface::titlebar_gesture() API, and
achieves the same. If the backend or compositor doesn't support titlebar
gestures, the existing path is used as a fallback.
2022-09-30 22:38:03 +02:00
1a745a6b35 Update Abkhazian translation 2022-09-29 15:16:17 +00:00
4c77925af6 Update Croatian translation 2022-09-29 12:16:17 +00:00
d388d65eb7 Update Croatian translation 2022-09-29 12:14:26 +00:00
0e5fe45ea2 gdk_wayland_display_init_gl: use GLES API if required
gdk_wayland_gl_context_realize properly checks for GLES and uses
eglBindAPI with the proper API, but before that init is always called
with regular GL interface which is not implemented for many embedded
devices.

This was fixed in GTK 4 with commit 482845b02705 ("wayland: Remove
initial GL API bind"), but that commit cannot easily be applied because
the current version queries some GL properties during init so we would
need to backport more for it to be applicable.

This patch takes the minimal approach of initializing GLES context,
allowing the gtk3 demo OpenGL test (and real applications) to work
when GDK_GL=gles is set.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3028
2022-09-28 14:34:41 +09:00
812b3930d0 Merge branch 'gdk-win32-fix-subclassing-gdk-win32-selection' into 'gtk-3-24'
GdkWin32: Fix subclassing for GdkWin32Selection

See merge request GNOME/gtk!5054
2022-09-26 12:52:32 +00:00
8f0d580cf9 GdkWin32: Fix subclassing for GdkWin32Selection 2022-09-26 14:28:03 +02:00
56100ab49a Merge branch 'work/zzag/kde-dnd' into 'gtk-3-24'
gdk/wayland: Update selection's offer before updating dnd targets

See merge request GNOME/gtk!5045
2022-09-23 09:09:22 +00:00
965aa2e65f gdk/wayland: Update selection's offer before updating dnd targets
gdk_wayland_drop_context_update_targets gets targets from the
selection's offer. In order to ensure that the drop context has
up-to-date targets, update the selection's offer before updating
targets.

This fixes drag-and-drop not working reliably when running Firefox in
Plasma Wayland session.
2022-09-23 11:12:41 +03:00
4c991b8b39 Merge branch 'backport-mr-4776-to-gtk3' into 'gtk-3-24'
Recognize "stylus" devices as GDK_SOURCE_PEN

See merge request GNOME/gtk!5036
2022-09-20 10:57:20 +00:00
a533474dfe Update Turkish translation 2022-09-18 08:19:53 +00:00
9c9920e46e Update Turkish translation 2022-09-18 08:19:45 +00:00
8984b13d84 Recognize "stylus" devices as GDK_SOURCE_PEN
Add "stylus" to the list of substrings in a device name that cause it to be recognized
as a GDK_SOURCE_PEN device (previously "wacom", "pen" and "eraser").  Some devices
just use "stylus" in their name, and are otherwise recognized as
GDK_SOURCE_TOUCHSCREEN instead.

Fixes #4394.
2022-09-17 15:06:27 +02:00
5f8ab17a0c Update Hungarian translation 2022-09-14 00:36:30 +00:00
cbfec14df4 Merge branch 'gtk3-fontchooser-fix' into 'gtk-3-24'
Fix a critical in GtkFontChooserWidget

See merge request GNOME/gtk!5027
2022-09-13 13:19:57 +00:00