wayland: Use gtk_shell1_get_version()

... or correct gtk_surface1_get_version() alternative.
This commit is contained in:
Benjamin Otte 2023-04-01 02:03:54 +02:00
parent 9d99259cbd
commit 68b8c5cd99
4 changed files with 3 additions and 5 deletions

View File

@ -93,7 +93,7 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
id = app_launch_data.token;
wl_event_queue_destroy (event_queue);
}
else if (display->gtk_shell_version >= 3)
else if (gtk_shell1_get_version (display->gtk_shell) >= GTK_SHELL1_NOTIFY_LAUNCH_SINCE_VERSION)
{
id = g_uuid_string_random ();
gtk_shell1_notify_launch (display->gtk_shell, id);

View File

@ -393,7 +393,6 @@ gdk_registry_handle_global (void *data,
&gtk_shell1_interface,
MIN (version, GTK_SHELL1_VERSION));
gdk_wayland_display_set_has_gtk_shell (display_wayland);
display_wayland->gtk_shell_version = version;
}
else if (strcmp (interface, "wl_output") == 0)
{

View File

@ -134,7 +134,6 @@ struct _GdkWaylandDisplay
GSource *event_source;
int seat_version;
int gtk_shell_version;
int pointer_gestures_version;
uint32_t server_decoration_mode;

View File

@ -217,7 +217,7 @@ gdk_wayland_toplevel_hide_surface (GdkWaylandSurface *wayland_surface)
if (toplevel->display_server.gtk_surface)
{
if (display_wayland->gtk_shell_version >= GTK_SURFACE1_RELEASE_SINCE_VERSION)
if (gtk_shell1_get_version (display_wayland->gtk_shell) >= GTK_SURFACE1_RELEASE_SINCE_VERSION)
gtk_surface1_release (toplevel->display_server.gtk_surface);
else
gtk_surface1_destroy (toplevel->display_server.gtk_surface);
@ -2136,7 +2136,7 @@ gdk_wayland_toplevel_focus (GdkToplevel *toplevel,
{
if (timestamp != GDK_CURRENT_TIME)
gtk_surface1_present (wayland_toplevel->display_server.gtk_surface, timestamp);
else if (startup_id && display_wayland->gtk_shell_version >= 3)
else if (startup_id && gtk_surface1_get_version (wayland_toplevel->display_server.gtk_surface) >= GTK_SURFACE1_REQUEST_FOCUS_SINCE_VERSION)
gtk_surface1_request_focus (wayland_toplevel->display_server.gtk_surface,
startup_id);
}