diff options
author | raveit65 <[email protected]> | 2016-07-31 23:18:20 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-08-05 12:02:56 +0200 |
commit | f5df4dcb173d9b0fa183c50e9fdd6730c81eb9cf (patch) | |
tree | b0fac1c41f5fc8a65154e4c40422923aaf3bf472 /multiload | |
parent | da123cf8e224bdcdf0c2fb02b198c27a22b27278 (diff) | |
download | mate-applets-f5df4dcb173d9b0fa183c50e9fdd6730c81eb9cf.tar.bz2 mate-applets-f5df4dcb173d9b0fa183c50e9fdd6730c81eb9cf.tar.xz |
GTK+-3 multiload: avoid deprecated gdk_app_launch_context_new ()
Diffstat (limited to 'multiload')
-rw-r--r-- | multiload/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/multiload/main.c b/multiload/main.c index 673c2f4a..9915bed1 100644 --- a/multiload/main.c +++ b/multiload/main.c @@ -101,6 +101,9 @@ start_procman (MultiloadApplet *ma) GDesktopAppInfo *appinfo; gchar *monitor; GdkAppLaunchContext *launch_context; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkDisplay *display; +#endif GAppInfo *app_info; GdkScreen *screen; @@ -116,7 +119,12 @@ start_procman (MultiloadApplet *ma) GdkScreen *screen; GdkAppLaunchContext *context; screen = gtk_widget_get_screen (GTK_WIDGET (ma->applet)); +#if GTK_CHECK_VERSION (3, 0, 0) + display = gdk_screen_get_display (screen); + context = gdk_display_get_app_launch_context (display); +#else context = gdk_app_launch_context_new (); +#endif gdk_app_launch_context_set_screen (context, screen); g_app_info_launch (G_APP_INFO (appinfo), NULL, G_APP_LAUNCH_CONTEXT (context), &error); g_object_unref (context); @@ -129,7 +137,12 @@ start_procman (MultiloadApplet *ma) &error); if (!error) { +#if GTK_CHECK_VERSION (3, 0, 0) + display = gdk_screen_get_display (screen); + launch_context = gdk_display_get_app_launch_context (display); +#else launch_context = gdk_app_launch_context_new (); +#endif gdk_app_launch_context_set_screen (launch_context, screen); g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error); |