Commit Graph

17 Commits

Author SHA1 Message Date
Carlos Garnacho
14d99bacbc gdk/wayland: Use toplevel surface for activation
At the moment of launching/activating an application, the
keyboard focus may be on a transient surface that quickly
disappears after activation. If this happens, and the
compositor handles surface destruction before the activated
application gets to reply, the activation request may be
deemed outdated, and the "demands attention" paths be taken.

Peek the toplevel from the focus surface, as that has larger
guarantees to remain valid for the whole duration of the
operation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5820
2023-09-18 22:04:32 +02:00
Matthias Clasen
c78b34649b wayland: Don't assume the shell protocol
The gtk_shell proxy will be NULL if the compositor
is not gnome-shell. Handle that without crashing.

Fixes: #6048
2023-08-22 08:27:23 -04:00
Benjamin Otte
68b8c5cd99 wayland: Use gtk_shell1_get_version()
... or correct gtk_surface1_get_version() alternative.
2023-04-01 02:22:21 +02:00
Jonas Ådahl
b2a2bf819d wayland/launch-context: Use dispatch helper
Otherwise we risk a busy loop if e.g. the pipe broke.
2023-02-11 23:14:53 +01:00
Matthias Clasen
4aabc45685 Drop gdkintl.h
This header was merely including gi18n-lib.h.
Just do that directly.
2022-09-23 23:33:42 -04:00
Carlos Garnacho
4b41d4f78c 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
2022-06-02 23:08:40 +02:00
Carlos Garnacho
fb68600d88 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.
2022-06-02 23:08:40 +02:00
Guido Günther
4d741bac98 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>
2022-01-19 08:57:10 +01:00
Benjamin Otte
279f9aa6d3 wayland: Don't include gdkinternals.h 2021-09-24 22:50:29 +02:00
Carlos Garnacho
be4216e051 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.
2021-05-03 17:20:50 +02:00
Carlos Garnacho
745cbc6c91 gdk/wayland: Update to gtk_shell1 version 3
Bring in line with gtk3, in terms of startup notification and
activation support.
2020-11-18 00:41:46 +01:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Matthias Clasen
ba91af62ad Drop gdk_app_launch_context_set_screen
This function is not necessary, since we already know the display.
2017-10-30 23:01:34 -04:00
Matthias Clasen
94c5d691df wayland: Formatting fixes 2015-02-28 00:02:30 -05:00
Matthias Clasen
52578945bd Wayland: Fix various compiler warnings
Mostly missing declarations, missing statics and unused functions.
2014-09-05 20:41:06 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Kristian Høgsberg
590f3dfa1f Add Wayland backend 2011-02-05 16:11:54 -05:00