Commit 3b6318bf authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x. Add

2003-11-01  Manish Singh  <yosh@gimp.org>

        * configure.in: Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x.
        Add -DGDK_MULTIHEAD_SAFE.

        * app/config/test-config.c: use guints for strlen()

        * app/gui/gui.c
        * app/gui/info-window.c
        * app/gui/menus.c
        * app/widgets/gimpcontainerview.c
        * app/widgets/gimpcursor.c
        * app/widgets/gimpdevices.c
        * app/widgets/gimpdevicestatus.c
        * app/widgets/gimpimagedock.c
        * app/widgets/gimpitemfactory.c
        * app/widgets/gimpnavigationpreview.c
        * app/widgets/gimptoolbox.c
        * app/widgets/gimptooloptionseditor.c
        * app/widgets/gimpwidgets-utils.c
        * libgimp/gimpbrushmenu.c
        * libgimp/gimppatternmenu.c
        * libgimp/gimpui.c
        * plug-ins/FractalExplorer/Dialogs.c
        * plug-ins/FractalExplorer/FractalExplorer.c
        * plug-ins/common/screenshot.c
        * plug-ins/gimpressionist/gimpressionist.c: more GDK_MULTIHEAD_SAFE
        fixes.

        * plug-ins/common/wmf.c: #undef GDK_MULTIHEAD_SAFE.. this plug-in
        is going away anyway.

        * app/widgets/gimpcursor.h: add #warning about needing a proper
        multihead safe API.

        * app/gui/vectors-commands.c: s/clipoard/clipboard/
parent 8e8c2176
2003-11-01 Manish Singh <yosh@gimp.org>
* configure.in: Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x.
Add -DGDK_MULTIHEAD_SAFE.
* app/config/test-config.c: use guints for strlen()
* app/gui/gui.c
* app/gui/info-window.c
* app/gui/menus.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpcursor.c
* app/widgets/gimpdevices.c
* app/widgets/gimpdevicestatus.c
* app/widgets/gimpimagedock.c
* app/widgets/gimpitemfactory.c
* app/widgets/gimpnavigationpreview.c
* app/widgets/gimptoolbox.c
* app/widgets/gimptooloptionseditor.c
* app/widgets/gimpwidgets-utils.c
* libgimp/gimpbrushmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/common/screenshot.c
* plug-ins/gimpressionist/gimpressionist.c: more GDK_MULTIHEAD_SAFE
fixes.
* plug-ins/common/wmf.c: #undef GDK_MULTIHEAD_SAFE.. this plug-in
is going away anyway.
* app/widgets/gimpcursor.h: add #warning about needing a proper
multihead safe API.
* app/gui/vectors-commands.c: s/clipoard/clipboard/
2003-11-01 Sven Neumann <sven@gimp.org>
* app/composite/Makefile.am (EXTRA_PROGRAMS): removed
......@@ -196,7 +196,7 @@ vectors_copy_cmd_callback (GtkWidget *widget,
return_if_no_vectors (gimage, active_vectors, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......@@ -208,7 +208,7 @@ vectors_paste_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......
......@@ -164,7 +164,7 @@ main (int argc,
return EXIT_FAILURE;
}
g_print ("OK (%d bytes)\n", result ? strlen (result) : 0);
g_print ("OK (%u bytes)\n", result ? (guint) strlen (result) : 0);
}
g_free (result);
......
......@@ -535,7 +535,11 @@ info_window_update (GimpDisplay *gdisp)
}
{
GdkVisual *visual = gdk_rgb_get_visual ();
GdkScreen *screen;
GdkVisual *visual;
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
visual = gdk_screen_get_rgb_visual (screen);
/* visual class */
g_snprintf (iwd->visual_class_str, MAX_BUF, "%s",
......
......@@ -185,7 +185,8 @@ gui_init (Gimp *gimp,
gboolean no_splash,
gboolean no_splash_image)
{
GimpInitStatusFunc status_callback = NULL;
GimpInitStatusFunc status_callback = NULL;
GdkScreen *screen;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (the_gui_gimp == NULL, NULL);
......@@ -197,7 +198,8 @@ gui_init (Gimp *gimp,
gdk_rgb_set_min_colors (CLAMP (gimp->config->min_colors, 27, 256));
gdk_rgb_set_install (gimp->config->install_cmap);
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
screen = gdk_screen_get_default ();
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
if (! no_splash)
{
......
......@@ -535,7 +535,11 @@ info_window_update (GimpDisplay *gdisp)
}
{
GdkVisual *visual = gdk_rgb_get_visual ();
GdkScreen *screen;
GdkVisual *visual;
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
visual = gdk_screen_get_rgb_visual (screen);
/* visual class */
g_snprintf (iwd->visual_class_str, MAX_BUF, "%s",
......
......@@ -516,7 +516,7 @@ menus_last_opened_reorder (GimpContainer *container,
static void
menu_can_change_accels (GimpGuiConfig *config)
{
g_object_set (gtk_settings_get_default (),
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
"gtk-can-change-accels", config->can_change_accels,
NULL);
}
......@@ -196,7 +196,7 @@ vectors_copy_cmd_callback (GtkWidget *widget,
return_if_no_vectors (gimage, active_vectors, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......@@ -208,7 +208,7 @@ vectors_paste_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......
......@@ -516,7 +516,7 @@ menus_last_opened_reorder (GimpContainer *container,
static void
menu_can_change_accels (GimpGuiConfig *config)
{
g_object_set (gtk_settings_get_default (),
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
"gtk-can-change-accels", config->can_change_accels,
NULL);
}
......@@ -786,6 +786,7 @@ gimp_container_view_get_preview (GimpDocked *docked,
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (docked);
GtkWidget *preview;
GdkScreen *screen;
gint width;
gint height;
gint border_width = 1;
......@@ -793,7 +794,9 @@ gimp_container_view_get_preview (GimpDocked *docked,
g_return_val_if_fail (view->container != NULL, NULL);
gtk_icon_size_lookup (size, &width, &height);
screen = gtk_widget_get_screen (GTK_WIDGET (view));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
size, &width, &height);
prop_name = gimp_context_type_to_prop_name (view->container->children_type);
......
......@@ -440,7 +440,7 @@ gimp_cursor_new (GimpCursorType cursor_type,
g_return_val_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY, NULL);
if (cursor_type <= GDK_LAST_CURSOR)
return gdk_cursor_new (cursor_type);
return gdk_cursor_new_for_display (gdk_display_get_default (), cursor_type);
g_return_val_if_fail (cursor_type >= GIMP_MOUSE_CURSOR, NULL);
......
......@@ -19,6 +19,9 @@
#ifndef __GIMP_CURSOR_H__
#define __GIMP_CURSOR_H__
#ifdef __GNUC__
#warning FIXME: need a new API that passes a display for gimp_cursor_new()
#endif
GdkCursor * gimp_cursor_new (GimpCursorType curtype,
GimpToolCursorType tool_cursor,
......
......@@ -67,11 +67,13 @@ gimp_devices_init (Gimp *gimp,
GdkDevice *device;
GimpDeviceInfo *device_info;
GList *list;
GdkDisplay *display;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (gimp_device_manager_get (gimp) == NULL);
display = gdk_display_get_default ();
manager = g_new0 (GimpDeviceManager, 1);
g_object_set_data_full (G_OBJECT (gimp),
......@@ -80,11 +82,11 @@ gimp_devices_init (Gimp *gimp,
manager->device_info_list = gimp_list_new (GIMP_TYPE_DEVICE_INFO,
GIMP_CONTAINER_POLICY_STRONG);
manager->current_device = gdk_display_get_core_pointer (gdk_display_get_default ());
manager->current_device = gdk_display_get_core_pointer (display);
manager->change_notify = change_notify;
/* create device info structures for present devices */
for (list = gdk_devices_list (); list; list = g_list_next (list))
for (list = gdk_display_list_devices (display); list; list = list->next)
{
device = (GdkDevice *) list->data;
......
......@@ -130,12 +130,15 @@ gimp_device_status_class_init (GimpDeviceStatusClass *klass)
static void
gimp_device_status_init (GimpDeviceStatus *status)
{
GList *list;
gint i;
GdkDisplay *display;
GList *list;
gint i;
display = gtk_widget_get_display (GTK_WIDGET (status));
status->gimp = NULL;
status->current_device = NULL;
status->num_devices = g_list_length (gdk_devices_list ());
status->num_devices = g_list_length (gdk_display_list_devices (display));
status->entries = g_new0 (GimpDeviceStatusEntry,
status->num_devices);
......@@ -149,9 +152,9 @@ gimp_device_status_init (GimpDeviceStatus *status)
gtk_container_add (GTK_CONTAINER (status), status->table);
gtk_widget_show (status->table);
for (list = gdk_devices_list (), i = 0;
for (list = gdk_display_list_devices (display), i = 0;
list;
list = g_list_next (list), i++)
list = list->next, i++)
{
GimpDeviceInfo *device_info;
GimpContext *context;
......
......@@ -234,6 +234,7 @@ gimp_image_dock_style_set (GtkWidget *widget,
GimpImageDock *image_dock;
gint minimal_width;
GtkIconSize menu_preview_size;
GdkScreen *screen;
gint menu_preview_width = 18;
gint menu_preview_height = 18;
gint focus_line_width;
......@@ -250,9 +251,11 @@ gimp_image_dock_style_set (GtkWidget *widget,
"menu_preview_size", &menu_preview_size,
NULL);
gtk_icon_size_lookup (menu_preview_size,
&menu_preview_width,
&menu_preview_height);
screen = gtk_widget_get_screen (image_dock->menu);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
menu_preview_size,
&menu_preview_width,
&menu_preview_height);
gtk_widget_style_get (image_dock->auto_button,
"focus_line_width", &focus_line_width,
......@@ -385,6 +388,7 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
{
GimpImageDock *image_dock;
GimpContext *context;
GdkScreen *screen;
gint menu_preview_width;
gint menu_preview_height;
......@@ -436,8 +440,11 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
image_dock,
0);
gtk_icon_size_lookup (DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width, &menu_preview_height);
screen = gtk_widget_get_screen (GTK_WIDGET (image_dock));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width,
&menu_preview_height);
image_dock->menu = gimp_container_menu_new (image_container, context,
menu_preview_height, 1);
......
......@@ -528,6 +528,7 @@ gimp_item_factory_set_color (GtkItemFactory *factory,
GtkWidget *widget;
GtkWidget *area = NULL;
GtkWidget *label = NULL;
GdkScreen *screen;
g_return_if_fail (GTK_IS_ITEM_FACTORY (factory));
g_return_if_fail (path != NULL);
......@@ -568,7 +569,9 @@ gimp_item_factory_set_color (GtkItemFactory *factory,
area = gimp_color_area_new (color, GIMP_COLOR_AREA_SMALL_CHECKS, 0);
gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
screen = gtk_widget_get_screen (area);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
GTK_ICON_SIZE_MENU, &width, &height);
gtk_widget_set_size_request (area, width, height);
gtk_box_pack_start (GTK_BOX (hbox), area, FALSE, FALSE, 0);
......
......@@ -234,6 +234,7 @@ gimp_image_dock_style_set (GtkWidget *widget,
GimpImageDock *image_dock;
gint minimal_width;
GtkIconSize menu_preview_size;
GdkScreen *screen;
gint menu_preview_width = 18;
gint menu_preview_height = 18;
gint focus_line_width;
......@@ -250,9 +251,11 @@ gimp_image_dock_style_set (GtkWidget *widget,
"menu_preview_size", &menu_preview_size,
NULL);
gtk_icon_size_lookup (menu_preview_size,
&menu_preview_width,
&menu_preview_height);
screen = gtk_widget_get_screen (image_dock->menu);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
menu_preview_size,
&menu_preview_width,
&menu_preview_height);
gtk_widget_style_get (image_dock->auto_button,
"focus_line_width", &focus_line_width,
......@@ -385,6 +388,7 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
{
GimpImageDock *image_dock;
GimpContext *context;
GdkScreen *screen;
gint menu_preview_width;
gint menu_preview_height;
......@@ -436,8 +440,11 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
image_dock,
0);
gtk_icon_size_lookup (DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width, &menu_preview_height);
screen = gtk_widget_get_screen (GTK_WIDGET (image_dock));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width,
&menu_preview_height);
image_dock->menu = gimp_container_menu_new (image_container, context,
menu_preview_height, 1);
......
......@@ -290,9 +290,10 @@ gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
void
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
{
GtkWidget *widget;
GdkCursor *cursor;
GdkWindow *window;
GtkWidget *widget;
GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *window;
widget = GTK_WIDGET (nav_preview);
......@@ -300,7 +301,8 @@ gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
gtk_grab_add (widget);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
window = GIMP_PREVIEW (nav_preview)->event_window;
......@@ -320,6 +322,7 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
{
GimpNavigationPreview *nav_preview;
gint tx, ty;
GdkDisplay *display;
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
......@@ -344,7 +347,8 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
gimp_navigation_preview_move_to (nav_preview, tx, ty);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
gdk_window_set_cursor (GIMP_PREVIEW (widget)->event_window, cursor);
gdk_cursor_unref (cursor);
}
......@@ -444,7 +448,10 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
if (! nav_preview->has_grab)
{
GdkCursor *cursor;
GdkCursor *cursor;
GdkDisplay *display;
display = gtk_widget_get_display (widget);
if (nav_preview->p_x == 0 &&
nav_preview->p_y == 0 &&
......@@ -459,11 +466,11 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
mevent->x < nav_preview->p_x + nav_preview->p_width &&
mevent->y < nav_preview->p_y + nav_preview->p_height)
{
cursor = gdk_cursor_new (GDK_FLEUR);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
}
else
{
cursor = gdk_cursor_new (GDK_HAND2);
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
gdk_window_set_cursor (preview->event_window, cursor);
......
......@@ -290,9 +290,10 @@ gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
void
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
{
GtkWidget *widget;
GdkCursor *cursor;
GdkWindow *window;
GtkWidget *widget;
GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *window;
widget = GTK_WIDGET (nav_preview);
......@@ -300,7 +301,8 @@ gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
gtk_grab_add (widget);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
window = GIMP_PREVIEW (nav_preview)->event_window;
......@@ -320,6 +322,7 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
{
GimpNavigationPreview *nav_preview;
gint tx, ty;
GdkDisplay *display;
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
......@@ -344,7 +347,8 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
gimp_navigation_preview_move_to (nav_preview, tx, ty);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
gdk_window_set_cursor (GIMP_PREVIEW (widget)->event_window, cursor);
gdk_cursor_unref (cursor);
}
......@@ -444,7 +448,10 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
if (! nav_preview->has_grab)
{
GdkCursor *cursor;
GdkCursor *cursor;
GdkDisplay *display;
display = gtk_widget_get_display (widget);
if (nav_preview->p_x == 0 &&
nav_preview->p_y == 0 &&
......@@ -459,11 +466,11 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
mevent->x < nav_preview->p_x + nav_preview->p_width &&
mevent->y < nav_preview->p_y + nav_preview->p_height)
{
cursor = gdk_cursor_new (GDK_FLEUR);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
}
else
{
cursor = gdk_cursor_new (GDK_HAND2);
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
gdk_window_set_cursor (preview->event_window, cursor);
......
......@@ -428,6 +428,7 @@ gimp_toolbox_new (GimpDialogFactory *dialog_factory,
{
GimpContext *context;
GimpToolbox *toolbox;
GdkDisplay *display;
GList *list;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
......@@ -449,7 +450,8 @@ gimp_toolbox_new (GimpDialogFactory *dialog_factory,
* device would change to that and not change back. So we check
* manually that all devices have a cursor, before establishing the check.
*/
for (list = gdk_devices_list (); list; list = g_list_next (list))
display = gtk_widget_get_display (GTK_WIDGET (toolbox));
for (list = gdk_display_list_devices (display); list; list = list->next)
{
if (! ((GdkDevice *) (list->data))->has_cursor)
break;
......
......@@ -237,11 +237,14 @@ gimp_tool_options_editor_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size)
{
GdkScreen *screen;
GtkWidget *preview;
gint width;
gint height;
gtk_icon_size_lookup (size, &width, &height);
screen = gdk_screen_get_default ();
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
size, &width, &height);
preview = gimp_prop_preview_new (G_OBJECT (context), "tool", height);
GIMP_PREVIEW (preview)->renderer->size = -1;
......
......@@ -422,6 +422,8 @@ gimp_get_icon_size (GtkWidget *widget,
gint max_width;
gint max_height;
GtkIconSize icon_size = GTK_ICON_SIZE_MENU;
GdkScreen *screen;
GtkSettings *settings;
g_return_val_if_fail (GTK_IS_WIDGET (widget), icon_size);
g_return_val_if_fail (stock_id != NULL, icon_size);
......@@ -433,7 +435,11 @@ gimp_get_icon_size (GtkWidget *widget,
if (! icon_set)
return GTK_ICON_SIZE_INVALID;
if (! gtk_icon_size_lookup (max_size, &max_width, &max_height))
screen = gtk_widget_get_screen (widget);
settings = gtk_settings_get_for_screen (screen);
if (! gtk_icon_size_lookup_for_settings (settings, max_size,
&max_width, &max_height))
{
max_width = 1024;
max_height = 1024;
......@@ -446,7 +452,8 @@ gimp_get_icon_size (GtkWidget *widget,
gint icon_width;
gint icon_height;
if (gtk_icon_size_lookup (sizes[i], &icon_width, &icon_height))
if (gtk_icon_size_lookup_for_settings (settings, sizes[i],
&icon_width, &icon_height))
{
if (icon_width <= width &&
icon_height <= height &&
......
......@@ -325,6 +325,8 @@ AC_PATH_XTRA
AM_PATH_GTK_2_0($GTK_REQUIRED_VERSION,,
AC_MSG_ERROR(Test for GTK+ failed. See the file 'INSTALL' for help.))
PKG_CHECK_MODULES(GTK23, gtk+-2.0 >= 2.3.0, have_gtk_2_3=yes, have_gtk_2_3=no)
PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION)
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
......@@ -1206,11 +1208,18 @@ GIMP_MKENUMS="\$(top_srcdir)/tools/gimp-mkenums"
AC_SUBST(GIMP_MKENUMS)
##########################################
# Default to disable deprecated GTK+ stuff
##########################################
####################################################
# Default to disable deprecated GTK+ stuff for 2.2.x
####################################################
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
if test "x$have_gtk_2_3" != "xyes"; then
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
fi
############################
# Require multihead safe API
############################
CPPFLAGS="${CPPFLAGS} -DGDK_MULTIHEAD_SAFE"
##################
......
......@@ -472,6 +472,7 @@ gimp_brush_select_popup_open (BrushSelect *brush_sel,
guchar *b;
gint x_org;
gint y_org;
GdkScreen *screen;
gint scr_w;
gint scr_h;
......@@ -496,8 +497,10 @@ gimp_brush_select_popup_open (BrushSelect *brush_sel,
/* decide where to put the popup */
gdk_window_get_origin (brush_sel->preview->window, &x_org, &y_org);
scr_w = gdk_screen_width ();
scr_h = gdk_screen_height ();
screen = gtk_widget_get_screen (brush_sel->popup);
scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen);
x = x_org + x - (brush_sel->width / 2);
y = y_org + y - (brush_sel->height / 2);
......
......@@ -418,6 +418,7 @@ gimp_pattern_select_popup_open (PatternSelect *pattern_sel,
guchar *buf;
gint x_org;
gint y_org;
GdkScreen *screen;
gint scr_w;
gint scr_h;
......@@ -442,8 +443,10 @@ gimp_pattern_select_popup_open (PatternSelect *pattern_sel,
/* decide where to put the popup */
gdk_window_get_origin (pattern_sel->preview->window, &x_org, &y_org);
scr_w = gdk_screen_width ();
scr_h = gdk_screen_height ();
screen = gtk_widget_get_screen (pattern_sel->popup);
scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen);
x = x_org + x - (pattern_sel->width / 2);
y = y_org + y - (pattern_sel->height / 2);
......
......@@ -63,6 +63,8 @@ gimp_ui_init (const gchar *prog_name,
gchar **argv;
gchar *user_gtkrc;
GdkScreen *screen;
g_return_if_fail (prog_name != NULL);
if (initialized)
......@@ -82,7 +84,8 @@ gimp_ui_init (const gchar *prog_name,
gdk_rgb_set_min_colors (gimp_min_colors ());
gdk_rgb_set_install (gimp_install_cmap ());
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
screen = gdk_screen_get_default ();
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
/* Set the gamma after installing the colormap because
* gtk_preview_set_gamma() initializes GdkRGB if not already done
......
......@@ -376,6 +376,8 @@ static gboolean
preview_leave_notify_event (GtkWidget *widget,
GdkEventButton *event)
{
GdkDisplay *display;
if (oldypos != -1)
{
preview_draw_crosshair (oldxpos, oldypos);
......@@ -385,7 +387,8 @@ preview_leave_notify_event (GtkWidget *widget,
preview_redraw ();
MyCursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
display = gtk_widget_get_display (maindlg);
MyCursor = gdk_cursor_new_for_display (display, GDK_TOP_LEFT_ARROW);
gdk_window_set_cursor (maindlg->window, MyCursor);
return TRUE;
......@@ -395,7 +398,10 @@ static gboolean
preview_enter_notify_event (GtkWidget *widget,
GdkEventButton *event)
{
MyCursor = gdk_cursor_new (GDK_TCROSS);
GdkDisplay *display;
display = gtk_widget_get_display (maindlg);
MyCursor = gdk_cursor_new_for_display (display, GDK_TCROSS);
gdk_window_set_cursor (maindlg->window, MyCursor);
return TRUE;
......
......@@ -1019,7 +1019,7 @@ fractalexplorer_new_pixmap (GtkWidget *list,
GdkBitmap *mask = NULL;
GdkColormap *colormap;
colormap = gtk_widget_get_default_colormap ();
colormap = gdk_screen_get_default_colormap (gtk_widget_get_screen (list));
pixmap = gdk_pixmap_colormap_create_from_xpm_d (list->window,
colormap,
......
......@@ -433,14 +433,20 @@ shoot (void)
}
else
{
GdkDisplay *display;
display = gdk_screen_get_display (cur_screen);
/* single window */
if (shootvals.window_id)
{
window = gdk_window_foreign_new (shootvals.window_id);
window = gdk_window_foreign_new_for_display (display,
shootvals.window_id);
}
else
{
window = gdk_window_foreign_new (selected_native);
window = gdk_window_foreign_new_for_display (display,
selected_native);
}
}
......
......@@ -31,9 +31,11 @@
#ifdef __GNUC__
#warning FIXME: GDK_DISABLE_DEPRECATED
#warning FIXME: GDK_MULTIHEAD_SAFE
#endif