connect to the user context's "display_changed" and to the image context's
1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de> * app/context_manager.c: connect to the user context's "display_changed" and to the image context's "remove" signal to avoid dangling references and to set the menu sensitivity on display change. * app/disp_callbacks.c * app/file_new_dialog.c * app/fileops.c * app/gdisplay.c * app/gdisplay_ops.c * app/gimpcontext.c * app/interface.[ch]: entirely moved the active display stuff to the user context: - The active display is set by any event in the display shell, by File/New and File/Open. - gdisplay_delete() resets the active display to NULL if we deleted the active display. - Reduced gdisplay_active() to a single statement returning the context's active display. Should replace it by a macro. - gdisplay_flush_whenever() sets the menu sensitivity for the active display. - Removed global variable popup_shell since it was only set all the time but never used. I guess it's original job is now done by the context anyway. - gdisplay_set_menu_sensitivity() works with gdisp == NULL. - There are mysterious Gdk-CRITICALs if both <Image> and one of it's sub-menus are teared-off. Probably a gtk+ bug. To do all this stuff at a central place, there needs to be a GimpSet of displays (and ideally, GDisplay should be a GtkObject). * app/commands.c * app/lc_dialog.c: fixed segfaults happening with teared-off menus.
This commit is contained in:
committed by
Michael Natterer
parent
1446497832
commit
a72dbe86b4
@ -1027,6 +1027,8 @@ tools_select_cmd_callback (GtkWidget *widget,
|
||||
{
|
||||
GDisplay * gdisp;
|
||||
|
||||
gdisp = gdisplay_active ();
|
||||
|
||||
if (!tool_info[callback_action].init_func)
|
||||
{
|
||||
/* Activate the approriate widget */
|
||||
@ -1035,16 +1037,14 @@ tools_select_cmd_callback (GtkWidget *widget,
|
||||
else
|
||||
{
|
||||
/* if the tool_info has an init_func */
|
||||
gdisp = gdisplay_active ();
|
||||
|
||||
gtk_widget_activate (tool_info[callback_action].tool_widget);
|
||||
|
||||
(* tool_info[callback_action].init_func) (gdisp);
|
||||
if (gdisp)
|
||||
(* tool_info[callback_action].init_func) (gdisp);
|
||||
}
|
||||
|
||||
gdisp = gdisplay_active ();
|
||||
|
||||
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
if (gdisp)
|
||||
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user