[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-ui.cpp,1.162,1.163 plugin.cpp,1.247,1.248 plugin.h
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2005-10-21 17:46:42
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13773/Source Modified Files: plugin-ui.cpp plugin.cpp plugin.h Log Message: Fixed crash when you have two players on a page and browser window closed Index: plugin.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.h,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** plugin.h 20 Oct 2005 01:22:55 -0000 1.87 --- plugin.h 21 Oct 2005 17:46:31 -0000 1.88 *************** *** 202,206 **** --- 202,208 ---- #ifdef GTK_ENABLED + gulong delete_signal_id; GtkWidget *gtkwidget; + GtkWidget *button_window; GtkWidget *gtkplug; GtkWidget *image; Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.247 retrieving revision 1.248 diff -C2 -d -r1.247 -r1.248 *** plugin.cpp 20 Oct 2005 01:22:55 -0000 1.247 --- plugin.cpp 21 Oct 2005 17:46:31 -0000 1.248 *************** *** 375,381 **** if (threadsetup == 1) { ! Quit(); ! /* Quit is faster than this code ! if (paused == 1) --- 375,381 ---- if (threadsetup == 1) { ! // Quit(); ! // Quit is faster than this code, but this code works if we use Quit it crashes when we have two players up ! // Only difference is that Quit locks control_mutex if (paused == 1) *************** *** 385,389 **** pthread_cancel(player_thread); js_state = JS_STATE_UNDEFINED; ! */ } --- 385,389 ---- pthread_cancel(player_thread); js_state = JS_STATE_UNDEFINED; ! } *************** *** 414,418 **** gtk_widget_destroy(conf_window); } ! if (GTK_IS_WIDGET(gtkwidget)) gtk_widget_destroy(gtkwidget); --- 414,422 ---- gtk_widget_destroy(conf_window); } ! if (targetplayer != 0) { ! g_signal_handler_disconnect(GTK_OBJECT(gtkwidget) , delete_signal_id); ! if (GTK_IS_WIDGET(button_window)) ! gtk_widget_destroy(button_window); ! } if (GTK_IS_WIDGET(gtkwidget)) gtk_widget_destroy(gtkwidget); *************** *** 425,428 **** --- 429,434 ---- #ifdef GTK1_ENABLED if (controlwindow == 0) { + if (targetplayer != 0) + gtk_signal_disconnect(GTK_OBJECT(gtkwidget) , delete_signal_id); if (GTK_IS_WIDGET(gtkwidget)) gtk_widget_destroy(gtkwidget); *************** *** 681,689 **** gtkwidget = gtk_window_new(GTK_WINDOW_TOPLEVEL); #ifdef GTK2_ENABLED ! g_signal_connect(GTK_OBJECT(gtkwidget), "delete_event", G_CALLBACK(target_hide_callback), this); #endif #ifdef GTK1_ENABLED ! gtk_signal_connect(GTK_OBJECT(gtkwidget), "delete_event", GTK_SIGNAL_FUNC(target_hide_callback), --- 687,695 ---- gtkwidget = gtk_window_new(GTK_WINDOW_TOPLEVEL); #ifdef GTK2_ENABLED ! delete_signal_id = g_signal_connect(GTK_OBJECT(gtkwidget), "delete_event", G_CALLBACK(target_hide_callback), this); #endif #ifdef GTK1_ENABLED ! delete_signal_id = gtk_signal_connect(GTK_OBJECT(gtkwidget), "delete_event", GTK_SIGNAL_FUNC(target_hide_callback), Index: plugin-ui.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-ui.cpp,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** plugin-ui.cpp 20 Oct 2005 16:04:43 -0000 1.162 --- plugin-ui.cpp 21 Oct 2005 17:46:31 -0000 1.163 *************** *** 2434,2438 **** gboolean result; GtkWidget *fixed_button_container; - GtkWidget *button_window; if (DEBUG) --- 2434,2437 ---- *************** *** 2470,2480 **** gtk_widget_show(instance->src_event_box); } else { ! button_window = gtk_window_new(GTK_WINDOW_POPUP); ! gtk_widget_set_size_request(button_window, instance->window_width, instance->window_height); ! gtk_widget_add_events(button_window, GDK_BUTTON_PRESS_MASK); ! gtk_widget_realize(button_window); instance->src_event_box = gtk_event_box_new(); instance->image_src = --- 2469,2479 ---- gtk_widget_show(instance->src_event_box); } else { ! instance->button_window = gtk_window_new(GTK_WINDOW_POPUP); ! gtk_widget_set_size_request(instance->button_window, instance->window_width, instance->window_height); ! gtk_widget_add_events(instance->button_window, GDK_BUTTON_PRESS_MASK); ! gtk_widget_realize(instance->button_window); instance->src_event_box = gtk_event_box_new(); instance->image_src = *************** *** 2486,2490 **** G_CALLBACK(load_href_callback), instance); fixed_button_container = gtk_fixed_new(); ! gtk_container_add(GTK_CONTAINER(button_window), fixed_button_container); gtk_fixed_put(GTK_FIXED(fixed_button_container), --- 2485,2489 ---- G_CALLBACK(load_href_callback), instance); fixed_button_container = gtk_fixed_new(); ! gtk_container_add(GTK_CONTAINER(instance->button_window), fixed_button_container); gtk_fixed_put(GTK_FIXED(fixed_button_container), *************** *** 2493,2501 **** gtk_widget_show(instance->src_event_box); gtk_widget_show(fixed_button_container); ! gtk_widget_show(button_window); ! XReparentWindow(GDK_WINDOW_XDISPLAY(button_window->window), ! GDK_WINDOW_XWINDOW(button_window->window), instance->window, 0, 0); ! gtk_widget_map(button_window); g_idle_add(gtkgui_draw, instance); --- 2492,2500 ---- gtk_widget_show(instance->src_event_box); gtk_widget_show(fixed_button_container); ! gtk_widget_show(instance->button_window); ! XReparentWindow(GDK_WINDOW_XDISPLAY(instance->button_window->window), ! GDK_WINDOW_XWINDOW(instance->button_window->window), instance->window, 0, 0); ! gtk_widget_map(instance->button_window); g_idle_add(gtkgui_draw, instance); |