diff --git a/gtk/main.c b/gtk/main.c index a12e78633..5cdfab1e0 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -512,7 +512,7 @@ on_startup( GApplication * application, gpointer user_data ) gtk_ui_manager_ensure_update ( ui_manager ); /* create main window now to be a parent to any error dialogs */ - win = GTK_WINDOW( gtr_window_new( ui_manager, cbdata->core ) ); + win = GTK_WINDOW( gtr_window_new( GTK_APPLICATION( application ), ui_manager, cbdata->core ) ); g_signal_connect( win, "size-allocate", G_CALLBACK( on_main_window_size_allocated ), cbdata ); g_application_hold( application ); g_object_weak_ref( G_OBJECT( win ), (GWeakNotify)g_application_release, application ); @@ -587,7 +587,7 @@ main( int argc, char ** argv ) int ret; struct stat sb; char * application_id; - GApplication * app; + GtkApplication * app; GOptionContext * option_context; bool show_version = false; GError * error = NULL; @@ -650,11 +650,11 @@ main( int argc, char ** argv ) /* init the application for the specified config dir */ stat( cbdata.config_dir, &sb ); application_id = g_strdup_printf( "com.transmissionbt.transmission_%lu_%lu", (unsigned long)sb.st_dev, (unsigned long)sb.st_ino ); - app = g_application_new( application_id, G_APPLICATION_HANDLES_OPEN ); + app = gtk_application_new( application_id, G_APPLICATION_HANDLES_OPEN ); g_signal_connect( app, "open", G_CALLBACK(on_open), &cbdata ); g_signal_connect( app, "startup", G_CALLBACK(on_startup), &cbdata ); g_signal_connect( app, "activate", G_CALLBACK(on_activate), &cbdata ); - ret = g_application_run (app, argc, argv); + ret = g_application_run( G_APPLICATION( app ), argc, argv); g_object_unref( app ); g_free( application_id ); return ret; diff --git a/gtk/tr-window.c b/gtk/tr-window.c index 6b8fe8226..9839baa3d 100644 --- a/gtk/tr-window.c +++ b/gtk/tr-window.c @@ -580,7 +580,7 @@ onOptionsClicked( GtkButton * button UNUSED, gpointer vp ) ***/ GtkWidget * -gtr_window_new( GtkUIManager * ui_mgr, TrCore * core ) +gtr_window_new( GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core ) { int i, n; const char * pch; @@ -593,7 +593,7 @@ gtr_window_new( GtkUIManager * ui_mgr, TrCore * core ) p = g_new0( PrivateData, 1 ); /* make the window */ - self = gtk_window_new ( GTK_WINDOW_TOPLEVEL ); + self = gtk_application_window_new ( app ); g_object_set_qdata_full( G_OBJECT(self), get_private_data_key( ), p, privateFree ); win = GTK_WINDOW( self ); gtk_window_set_title( win, g_get_application_name( ) ); diff --git a/gtk/tr-window.h b/gtk/tr-window.h index 7e1a404ed..63b2d490e 100644 --- a/gtk/tr-window.h +++ b/gtk/tr-window.h @@ -28,7 +28,7 @@ #include #include "tr-core.h" -GtkWidget * gtr_window_new( GtkUIManager * uim, TrCore * core ); +GtkWidget * gtr_window_new( GtkApplication * app, GtkUIManager * uim, TrCore * core ); GtkTreeSelection * gtr_window_get_selection( GtkWindow * ); void gtr_window_set_busy( GtkWindow *, gboolean isBusy ); void gtr_window_refresh( GtkWindow * );