use gtk_widget_get_screen() instead of gdk_screen_get_default().

2003-11-08  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimptooloptionseditor.c
	(gimp_tool_options_editor_get_preview): use
	gtk_widget_get_screen() instead of gdk_screen_get_default().

	* app/widgets/gimpdatafactoryview.[ch]: added "GtkWidget *parent"
	to GimpDataEditFunc.

	* app/gui/dialogs-constructors.[ch]
	(dialogs_edit_brush,gradient,palette_func): use the passed parent
	widget for finding the right screen instead of
	gdk_screen_get_deafault().

	* app/gui/gui.c: minor cleanup.
This commit is contained in:
Michael Natterer 2003-11-08 18:16:25 +00:00 committed by Michael Natterer
parent c947f0b297
commit 4d095af4db
9 changed files with 55 additions and 35 deletions

View File

@ -1,3 +1,19 @@
2003-11-08 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptooloptionseditor.c
(gimp_tool_options_editor_get_preview): use
gtk_widget_get_screen() instead of gdk_screen_get_default().
* app/widgets/gimpdatafactoryview.[ch]: added "GtkWidget *parent"
to GimpDataEditFunc.
* app/gui/dialogs-constructors.[ch]
(dialogs_edit_brush,gradient,palette_func): use the passed parent
widget for finding the right screen instead of
gdk_screen_get_deafault().
* app/gui/gui.c: minor cleanup.
2003-11-08 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpitemfactory.[ch]: remember the "create_tearoff"

View File

@ -904,10 +904,11 @@ dialogs_brush_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_brush_func (GimpData *data)
dialogs_edit_brush_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-brush-editor",
-1);
@ -934,10 +935,11 @@ dialogs_gradient_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_gradient_func (GimpData *data)
dialogs_edit_gradient_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-gradient-editor",
-1);
@ -964,10 +966,11 @@ dialogs_palette_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_palette_func (GimpData *data)
dialogs_edit_palette_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-palette-editor",
-1);

View File

@ -159,17 +159,20 @@ GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_brush_func (GimpData *data);
void dialogs_edit_brush_func (GimpData *data,
GtkWidget *parent);
GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_gradient_func (GimpData *data);
void dialogs_edit_gradient_func (GimpData *data,
GtkWidget *parent);
GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_palette_func (GimpData *data);
void dialogs_edit_palette_func (GimpData *data,
GtkWidget *parent);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */

View File

@ -904,10 +904,11 @@ dialogs_brush_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_brush_func (GimpData *data)
dialogs_edit_brush_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-brush-editor",
-1);
@ -934,10 +935,11 @@ dialogs_gradient_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_gradient_func (GimpData *data)
dialogs_edit_gradient_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-gradient-editor",
-1);
@ -964,10 +966,11 @@ dialogs_palette_editor_get (GimpDialogFactory *factory,
}
void
dialogs_edit_palette_func (GimpData *data)
dialogs_edit_palette_func (GimpData *data,
GtkWidget *parent)
{
gimp_dialog_factory_dialog_raise (global_dock_factory,
gdk_screen_get_default (),
gtk_widget_get_screen (parent),
"gimp-palette-editor",
-1);

View File

@ -159,17 +159,20 @@ GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_brush_func (GimpData *data);
void dialogs_edit_brush_func (GimpData *data,
GtkWidget *parent);
GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_gradient_func (GimpData *data);
void dialogs_edit_gradient_func (GimpData *data,
GtkWidget *parent);
GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
void dialogs_edit_palette_func (GimpData *data);
void dialogs_edit_palette_func (GimpData *data,
GtkWidget *parent);
#endif /* __DIALOGS_CONSTRUCTORS_H__ */

View File

@ -313,15 +313,12 @@ gui_restore_callback (Gimp *gimp,
GimpInitStatusFunc status_callback,
gboolean restore_session)
{
GimpDisplayConfig *display_config;
GimpGuiConfig *gui_config;
GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (gimp->config);
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (gimp->config);
if (gimp->be_verbose)
g_print ("INIT: gui_restore_callback\n");
display_config = GIMP_DISPLAY_CONFIG (gimp->config);
gui_config = GIMP_GUI_CONFIG (gimp->config);
gui_vtable_init (gimp);
image_disconnect_handler_id =
@ -373,13 +370,11 @@ gui_restore_after_callback (Gimp *gimp,
GimpInitStatusFunc status_callback,
gboolean restore_session)
{
GimpGuiConfig *gui_config;
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (gimp->config);
if (gimp->be_verbose)
g_print ("INIT: gui_restore_after_callback\n");
gui_config = GIMP_GUI_CONFIG (gimp->config);
gimp->message_handler = GIMP_MESSAGE_BOX;
if (gui_config->restore_accels)
@ -412,7 +407,7 @@ static gboolean
gui_exit_callback (Gimp *gimp,
gboolean kill_it)
{
GimpGuiConfig *gui_config;
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (gimp->config);
if (gimp->be_verbose)
g_print ("EXIT: gui_exit_callback\n");
@ -443,8 +438,6 @@ gui_exit_callback (Gimp *gimp,
gimp->message_handler = GIMP_CONSOLE;
gui_config = GIMP_GUI_CONFIG (gimp->config);
if (gui_config->save_session_info)
session_save (gimp);
@ -500,9 +493,7 @@ gui_really_quit_callback (GtkWidget *button,
gboolean quit,
gpointer data)
{
Gimp *gimp;
gimp = GIMP (data);
Gimp *gimp = GIMP (data);
if (quit)
{

View File

@ -284,7 +284,7 @@ gimp_data_factory_view_edit_clicked (GtkWidget *widget,
gimp_container_have (view->factory->container,
GIMP_OBJECT (data)))
{
view->data_edit_func (data);
view->data_edit_func (data, GTK_WIDGET (view));
}
}

View File

@ -26,7 +26,8 @@
#include "gimpcontainereditor.h"
typedef void (* GimpDataEditFunc) (GimpData *data);
typedef void (* GimpDataEditFunc) (GimpData *data,
GtkWidget *parent);
#define GIMP_TYPE_DATA_FACTORY_VIEW (gimp_data_factory_view_get_type ())

View File

@ -242,7 +242,7 @@ gimp_tool_options_editor_get_preview (GimpDocked *docked,
gint width;
gint height;
screen = gdk_screen_get_default ();
screen = gtk_widget_get_screen (GTK_WIDGET (docked));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
size, &width, &height);