pidgin/pidginapplication.c

branch
gtk4
changeset 41524
f0a68067cff5
parent 41520
a5dd595361b4
child 41537
9e61c1a7dcb1
equal deleted inserted replaced
41523:2ca542ed08e2 41524:f0a68067cff5
221 if(!GTK_IS_WIDGET(about)) { 221 if(!GTK_IS_WIDGET(about)) {
222 about = pidgin_about_dialog_new(); 222 about = pidgin_about_dialog_new();
223 g_object_add_weak_pointer(G_OBJECT(about), (gpointer)&about); 223 g_object_add_weak_pointer(G_OBJECT(about), (gpointer)&about);
224 } 224 }
225 225
226 gtk_widget_show_all(about); 226 gtk_widget_show(about);
227 } 227 }
228 228
229 static void 229 static void
230 pidgin_application_accounts(GSimpleAction *simple, GVariant *parameter, 230 pidgin_application_accounts(GSimpleAction *simple, GVariant *parameter,
231 gpointer data) 231 gpointer data)
400 /* fixme? */ 400 /* fixme? */
401 #if 0 401 #if 0
402 gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window)); 402 gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
403 #endif 403 #endif
404 404
405 gtk_widget_show_all(dialog); 405 gtk_widget_show(dialog);
406 } 406 }
407 407
408 static void 408 static void
409 pidgin_application_preferences(GSimpleAction *simple, GVariant *parameter, 409 pidgin_application_preferences(GSimpleAction *simple, GVariant *parameter,
410 gpointer data) 410 gpointer data)
677 static void 677 static void
678 pidgin_application_startup(GApplication *application) { 678 pidgin_application_startup(GApplication *application) {
679 PurpleAccountManager *manager = NULL; 679 PurpleAccountManager *manager = NULL;
680 PurpleUiInfo *ui_info = NULL; 680 PurpleUiInfo *ui_info = NULL;
681 GtkCssProvider *provider = NULL; 681 GtkCssProvider *provider = NULL;
682 GError *error = NULL;
683 GList *active_accounts = NULL; 682 GList *active_accounts = NULL;
684 gchar *search_path = NULL; 683 gchar *search_path = NULL;
685 gpointer handle = NULL; 684 gpointer handle = NULL;
686 685
687 G_APPLICATION_CLASS(pidgin_application_parent_class)->startup(application); 686 G_APPLICATION_CLASS(pidgin_application_parent_class)->startup(application);
687
688 adw_init(); 688 adw_init();
689 689
690 /* set a user-specified config directory */ 690 /* set a user-specified config directory */
691 if (opt_config_dir_arg != NULL) { 691 if (opt_config_dir_arg != NULL) {
692 if (g_path_is_absolute(opt_config_dir_arg)) { 692 if (g_path_is_absolute(opt_config_dir_arg)) {
711 #endif 711 #endif
712 712
713 provider = gtk_css_provider_new(); 713 provider = gtk_css_provider_new();
714 714
715 search_path = g_build_filename(purple_config_dir(), "gtk-3.0.css", NULL); 715 search_path = g_build_filename(purple_config_dir(), "gtk-3.0.css", NULL);
716 gtk_css_provider_load_from_path(provider, search_path, &error); 716 gtk_css_provider_load_from_path(provider, search_path);
717 if(error != NULL) { 717 gtk_style_context_add_provider_for_display(gdk_display_get_default(),
718 purple_debug_info("gtk", "Unable to load custom gtk-3.0.css: %s\n", 718 GTK_STYLE_PROVIDER(provider),
719 error->message); 719 GTK_STYLE_PROVIDER_PRIORITY_USER);
720 g_clear_error(&error);
721 } else {
722 GdkScreen *screen = gdk_screen_get_default();
723 gtk_style_context_add_provider_for_screen(screen,
724 GTK_STYLE_PROVIDER(provider),
725 GTK_STYLE_PROVIDER_PRIORITY_USER);
726 }
727 720
728 g_free(search_path); 721 g_free(search_path);
729 722
730 #ifdef _WIN32 723 #ifdef _WIN32
731 winpidgin_init(); 724 winpidgin_init();
800 g_list_free(active_accounts); 793 g_list_free(active_accounts);
801 } 794 }
802 795
803 /* Populate our dynamic menus. */ 796 /* Populate our dynamic menus. */
804 pidgin_application_populate_dynamic_menus(PIDGIN_APPLICATION(application)); 797 pidgin_application_populate_dynamic_menus(PIDGIN_APPLICATION(application));
805
806 /* GTK clears the notification for us when opening the first window, but we
807 * may have launched with only a status icon, so clear it just in case.
808 */
809 gdk_notify_startup_complete();
810 798
811 /* TODO: Use GtkApplicationWindow or add a window instead */ 799 /* TODO: Use GtkApplicationWindow or add a window instead */
812 g_application_hold(application); 800 g_application_hold(application);
813 801
814 /* connect to the online and offline signals in purple connections. This 802 /* connect to the online and offline signals in purple connections. This

mercurial