Deprecate more startup-notification API

This commit is contained in:
Matthias Clasen 2023-02-01 17:58:43 +01:00
parent a52f9d6def
commit 8796950651
6 changed files with 19 additions and 5 deletions

View File

@ -1149,7 +1149,7 @@ _gdk_display_get_next_serial (GdkDisplay *display)
* [method@Gtk.Window.set_auto_startup_notification]
* is called to disable that feature.
*
* Deprecated: 4.10. Using gdk_toplevel_set_startup_id() is sufficient.
* Deprecated: 4.10: Using [method@Gdk.Toplevel.set_startup_id] is sufficient
*/
void
gdk_display_notify_startup_complete (GdkDisplay *display,
@ -1168,6 +1168,8 @@ gdk_display_notify_startup_complete (GdkDisplay *display,
* if no ID has been defined.
*
* Returns: (nullable): the startup notification ID for @display
*
* Deprecated: 4.10
*/
const char *
gdk_display_get_startup_notification_id (GdkDisplay *display)

View File

@ -86,7 +86,7 @@ GdkClipboard * gdk_display_get_primary_clipboard (GdkDisplay
GDK_DEPRECATED_IN_4_10_FOR(gdk_toplevel_set_startup_id)
void gdk_display_notify_startup_complete (GdkDisplay *display,
const char *startup_id);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10
const char * gdk_display_get_startup_notification_id (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL

View File

@ -2074,8 +2074,10 @@ gdk_x11_display_make_default (GdkDisplay *display)
display_x11->startup_notification_id = NULL;
startup_id = gdk_get_startup_notification_id ();
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (startup_id)
gdk_x11_display_set_startup_notification_id (display, startup_id);
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
@ -2303,6 +2305,8 @@ gdk_x11_display_get_user_time (GdkDisplay *display)
* Gets the startup notification ID for a display.
*
* Returns: the startup notification ID for @display
*
* Deprecated: 4.10
*/
const char *
gdk_x11_display_get_startup_notification_id (GdkDisplay *display)
@ -2329,7 +2333,9 @@ gdk_x11_display_get_startup_notification_id (GdkDisplay *display)
* The startup ID is also what is used to signal that the startup is
* complete (for example, when opening a window or when calling
* gdk_display_notify_startup_complete()).
**/
*
* Deprecated: 4.10: Using [method@Gdk.Toplevel.set_startup_id] is sufficient
*/
void
gdk_x11_display_set_startup_notification_id (GdkDisplay *display,
const char *startup_id)
@ -3042,7 +3048,9 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
display_class->get_next_serial = gdk_x11_display_get_next_serial;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
display_class->get_startup_notification_id = gdk_x11_display_get_startup_notification_id;
G_GNUC_END_IGNORE_DEPRECATIONS
display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete;
display_class->create_surface = _gdk_x11_display_create_surface;
display_class->get_keymap = gdk_x11_display_get_keymap;

View File

@ -80,9 +80,9 @@ Cursor gdk_x11_display_get_xcursor (GdkDisplay *display,
GDK_AVAILABLE_IN_ALL
guint32 gdk_x11_display_get_user_time (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10
const char * gdk_x11_display_get_startup_notification_id (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_4_10
void gdk_x11_display_set_startup_notification_id (GdkDisplay *display,
const char *startup_id);
GDK_AVAILABLE_IN_ALL

View File

@ -87,7 +87,9 @@ gtk_application_impl_x11_before_emit (GtkApplicationImpl *impl,
g_variant_lookup (platform_data, "desktop-startup-id", "&s", &startup_notification_id);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_x11_display_set_startup_notification_id (gdk_display_get_default (), startup_notification_id);
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void

View File

@ -321,7 +321,9 @@ gtk_application_add_platform_data (GApplication *application,
{
const char *startup_id;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
startup_id = gdk_display_get_startup_notification_id (display);
G_GNUC_END_IGNORE_DEPRECATIONS
if (startup_id && g_utf8_validate (startup_id, -1, NULL))
{
g_variant_builder_add (builder, "{sv}", "activation-token",