Use gdk_window_ accessors instead of gdk_drawable_ accessors if possible

The gdk_drawable_ accessors were deprecated.  Removes a lot of
compile-time warnings and eventually also makes things work again
on Mac (miscompile due to the missing prototypes).
This commit is contained in:
Kristian Rietveld 2010-10-19 10:37:15 +02:00
parent 51dcd09950
commit 3258af741e
26 changed files with 119 additions and 86 deletions

View File

@ -615,7 +615,7 @@ popup_grab_on_window (GdkWindow *window,
return TRUE;
else
{
gdk_display_pointer_ungrab (gdk_drawable_get_display (window),
gdk_display_pointer_ungrab (gdk_window_get_display (window),
activate_time);
return FALSE;
}

View File

@ -368,7 +368,8 @@ gtk_drag_highlight_expose (GtkWidget *widget,
{
x = 0;
y = 0;
gdk_drawable_get_size (widget->window, &width, &height);
width = gdk_window_get_width (widget->window);
height = gdk_window_get_height (widget->window);
}
gtk_paint_shadow (widget->style, widget->window,
@ -715,7 +716,8 @@ gtk_drag_find_widget (GtkWidget *widget,
{
GdkRectangle window_rect = { 0, 0, 0, 0 };
gdk_drawable_get_size (window, &window_rect.width, &window_rect.height);
window_rect.width = gdk_window_get_width (window);
window_rect.height = gdk_window_get_height (window);
gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation);
@ -1782,7 +1784,7 @@ gtk_drag_set_icon_name (GdkDragContext *context,
g_return_if_fail (context->is_source);
g_return_if_fail (icon_name != NULL);
screen = gdk_drawable_get_screen (context->source_window);
screen = gdk_window_get_screen (context->source_window);
g_return_if_fail (screen != NULL);
settings = gtk_settings_get_for_screen (screen);

View File

@ -3220,7 +3220,8 @@ draw_icon (GtkWidget *widget,
if (icon_info->pixbuf == NULL)
return;
gdk_drawable_get_size (icon_info->window, &width, &height);
width = gdk_window_get_width (icon_info->window);
height = gdk_window_get_height (icon_info->window);
/* size_allocate hasn't been called yet. These are the default values.
*/
@ -3286,7 +3287,8 @@ gtk_entry_draw_frame (GtkWidget *widget,
gboolean state_hint;
GtkStateType state;
gdk_drawable_get_size (widget->window, &width, &height);
width = gdk_window_get_width (widget->window);
height = gdk_window_get_height (widget->window);
/* Fix a problem with some themes which assume that entry->text_area's
* width equals widget->window's width */
@ -3374,7 +3376,8 @@ get_progress_area (GtkWidget *widget,
*x = progress_border.left;
*y = progress_border.top;
gdk_drawable_get_size (widget->window, width, height);
*width = gdk_window_get_width (widget->window);
*height = gdk_window_get_height (widget->window);
*width -= progress_border.left + progress_border.right;
*height -= progress_border.top + progress_border.bottom;
@ -3475,7 +3478,8 @@ gtk_entry_expose (GtkWidget *widget,
{
gint width, height;
gdk_drawable_get_size (entry->text_area, &width, &height);
width = gdk_window_get_width (entry->text_area);
height = gdk_window_get_height (entry->text_area);
gtk_paint_flat_box (widget->style, entry->text_area,
state, GTK_SHADOW_NONE,
@ -3507,7 +3511,8 @@ gtk_entry_expose (GtkWidget *widget,
{
gint width, height;
gdk_drawable_get_size (icon_info->window, &width, &height);
width = gdk_window_get_width (icon_info->window);
height = gdk_window_get_height (icon_info->window);
gtk_paint_flat_box (widget->style, icon_info->window,
gtk_widget_get_state (widget), GTK_SHADOW_NONE,
@ -3854,7 +3859,8 @@ gtk_entry_button_release (GtkWidget *widget,
{
gint width, height;
gdk_drawable_get_size (icon_info->window, &width, &height);
width = gdk_window_get_width (icon_info->window);
height = gdk_window_get_height (icon_info->window);
icon_info->pressed = FALSE;
@ -4007,7 +4013,8 @@ gtk_entry_motion_notify (GtkWidget *widget,
else
{
gint height;
gdk_drawable_get_size (entry->text_area, NULL, &height);
height = gdk_window_get_height (entry->text_area);
if (event->y < 0)
tmp_pos = 0;
@ -5619,7 +5626,8 @@ gtk_entry_draw_text (GtkEntry *entry)
}
else
{
gdk_drawable_get_size (entry->text_area, &width, &height);
width = gdk_window_get_width (entry->text_area);
height = gdk_window_get_height (entry->text_area);
cairo_rectangle (cr, 0, 0, width, height);
cairo_clip (cr);
@ -5697,7 +5705,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
xoffset = inner_border.left - entry->scroll_offset;
gdk_drawable_get_size (entry->text_area, NULL, &text_area_height);
text_area_height = gdk_window_get_height (entry->text_area);
layout = gtk_entry_ensure_layout (entry, TRUE);
text = pango_layout_get_text (layout);
@ -5969,7 +5977,7 @@ gtk_entry_adjust_scroll (GtkEntry *entry)
_gtk_entry_effective_inner_border (entry, &inner_border);
gdk_drawable_get_size (entry->text_area, &text_area_width, NULL);
text_area_width = gdk_window_get_width (entry->text_area);
text_area_width -= inner_border.left + inner_border.right;
if (text_area_width < 0)
text_area_width = 0;
@ -8641,7 +8649,7 @@ popup_position_func (GtkMenu *menu,
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
gtk_widget_size_request (entry->popup_menu, &menu_req);
gdk_drawable_get_size (entry->text_area, NULL, &height);
height = gdk_window_get_height (entry->text_area);
gtk_entry_get_cursor_locations (entry, CURSOR_STANDARD, &strong_x, NULL);
_gtk_entry_effective_inner_border (entry, &inner_border);

View File

@ -908,7 +908,7 @@ set_invisible_mouse_cursor (GdkWindow *window)
GdkDisplay *display;
GdkCursor *cursor;
display = gdk_drawable_get_display (window);
display = gdk_window_get_display (window);
cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
gdk_window_set_cursor (window, cursor);

View File

@ -885,7 +885,8 @@ gtk_handle_box_paint (GtkWidget *widget,
handle_position = effective_handle_position (hb);
gdk_drawable_get_size (hb->bin_window, &width, &height);
width = gdk_window_get_width (hb->bin_window);
height = gdk_window_get_height (hb->bin_window);
if (!event)
gtk_paint_box (widget->style,
@ -1083,7 +1084,8 @@ gtk_handle_box_button_press (GtkWidget *widget,
gtk_widget_get_screen (GTK_WIDGET (hb)));
gdk_window_get_deskrelative_origin (hb->bin_window, &desk_x, &desk_y);
gdk_window_get_origin (hb->bin_window, &root_x, &root_y);
gdk_drawable_get_size (hb->bin_window, &width, &height);
width = gdk_window_get_width (hb->bin_window);
height = gdk_window_get_height (hb->bin_window);
private->orig_x = event->x_root;
private->orig_y = event->y_root;
@ -1099,7 +1101,8 @@ gtk_handle_box_button_press (GtkWidget *widget,
if (gdk_window_is_viewable (widget->window))
{
gdk_window_get_origin (widget->window, &root_x, &root_y);
gdk_drawable_get_size (widget->window, &width, &height);
width = gdk_window_get_width (widget->window);
height = gdk_window_get_height (widget->window);
hb->attach_allocation.x = root_x;
hb->attach_allocation.y = root_y;
@ -1276,7 +1279,8 @@ gtk_handle_box_motion (GtkWidget *widget,
{
gint width, height;
gdk_drawable_get_size (hb->float_window, &width, &height);
width = gdk_window_get_width (hb->float_window);
height = gdk_window_get_height (hb->float_window);
new_x += hb->deskoff_x;
new_y += hb->deskoff_y;

View File

@ -829,7 +829,7 @@ gtk_hsv_button_release (GtkWidget *widget,
} else
g_assert_not_reached ();
gdk_display_pointer_ungrab (gdk_drawable_get_display (event->window),
gdk_display_pointer_ungrab (gdk_window_get_display (event->window),
event->time);
return TRUE;
}

View File

@ -4467,8 +4467,8 @@ gtk_icon_view_scroll_to_item (GtkIconView *icon_view,
"focus-line-width", &focus_width,
NULL);
gdk_drawable_get_size (GDK_DRAWABLE (icon_view->priv->bin_window),
&width, &height);
width = gdk_window_get_width (icon_view->priv->bin_window);
height = gdk_window_get_height (icon_view->priv->bin_window);
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
if (y + item->y - focus_width < 0)

View File

@ -669,7 +669,7 @@ beep_window (GdkWindow *window)
}
else
{
GdkScreen *screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
GdkScreen *screen = gdk_window_get_screen (window);
gboolean beep;
g_object_get (gtk_settings_get_for_screen (screen),
@ -744,7 +744,7 @@ is_hex_keyval (guint keyval)
static guint
canonical_hex_keyval (GdkEventKey *event)
{
GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_drawable_get_display (event->window));
GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_window_get_display (event->window));
guint keyval;
guint *keyvals = NULL;
gint n_vals = 0;

View File

@ -684,7 +684,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
*/
if (GDK_IS_DRAWABLE (client_window))
{
screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window));
screen = gdk_window_get_screen (client_window);
settings = gtk_settings_get_for_screen (screen);
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
if (tmp)

View File

@ -277,7 +277,7 @@ gtk_im_multicontext_set_client_window (GtkIMContext *context,
if (window)
{
screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
screen = gdk_window_get_screen (window);
settings = gtk_settings_get_for_screen (screen);
connected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (settings),

View File

@ -1438,7 +1438,7 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_MOTION_NOTIFY:
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
display = gdk_drawable_get_display (event->proximity.window);
display = gdk_window_get_display (event->proximity.window);
if (!gdk_pointer_grab_info_libgtk_only (display, &grab_window, &owner_events) ||
!owner_events)
return NULL;
@ -1446,7 +1446,7 @@ rewrite_event_for_grabs (GdkEvent *event)
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
display = gdk_drawable_get_display (event->key.window);
display = gdk_window_get_display (event->key.window);
if (!gdk_keyboard_grab_info_libgtk_only (display, &grab_window, &owner_events) ||
!owner_events)
return NULL;

View File

@ -1350,7 +1350,8 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu)
menu->tearoff_active = FALSE;
menu->saved_scroll_offset = menu->scroll_offset;
gdk_drawable_get_size (menu->tearoff_window->window, &width, &height);
width = gdk_window_get_width (menu->tearoff_window->window);
height = gdk_window_get_height (menu->tearoff_window->window);
pixmap = gdk_pixmap_new (menu->tearoff_window->window,
width,
@ -1391,7 +1392,7 @@ popup_grab_on_window (GdkWindow *window,
return TRUE;
else
{
gdk_display_pointer_ungrab (gdk_drawable_get_display (window),
gdk_display_pointer_ungrab (gdk_window_get_display (window),
activate_time);
return FALSE;
}
@ -2054,7 +2055,9 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
menu->tearoff_hbox = gtk_hbox_new (FALSE, FALSE);
gtk_container_add (GTK_CONTAINER (menu->tearoff_window), menu->tearoff_hbox);
gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height);
width = gdk_window_get_width (GTK_WIDGET (menu)->window);
height = gdk_window_get_height (GTK_WIDGET (menu)->window);
menu->tearoff_adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0,
0,
@ -2079,7 +2082,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
gtk_menu_reparent (menu, menu->tearoff_hbox, FALSE);
gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, NULL);
width = gdk_window_get_width (GTK_WIDGET (menu)->window);
/* Update menu->requisition
*/
@ -2714,7 +2717,8 @@ get_arrows_visible_area (GtkMenu *menu,
border->x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness + horizontal_padding;
border->y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness + vertical_padding;
gdk_drawable_get_size (widget->window, &border->width, &border->height);
border->width = gdk_window_get_width (widget->window);
border->height = gdk_window_get_height (widget->window);
switch (arrow_placement)
{
@ -3206,7 +3210,8 @@ definitely_within_item (GtkWidget *widget,
GdkWindow *window = GTK_MENU_ITEM (widget)->event_window;
int w, h;
gdk_drawable_get_size (window, &w, &h);
w = gdk_window_get_width (window);
h = gdk_window_get_height (window);
return
check_threshold (widget, 0, 0, x, y) &&
@ -3294,7 +3299,8 @@ gtk_menu_motion_notify (GtkWidget *widget,
menu_shell->ignore_enter = FALSE;
gdk_drawable_get_size (event->window, &width, &height);
width = gdk_window_get_width (event->window);
height = gdk_window_get_height (event->window);
if (event->x >= 0 && event->x < width &&
event->y >= 0 && event->y < height)
{
@ -3375,7 +3381,8 @@ gtk_menu_scroll_by (GtkMenu *menu,
if ((menu->scroll_offset >= 0) && (offset < 0))
offset = 0;
gdk_drawable_get_size (widget->window, &view_width, &view_height);
view_width = gdk_window_get_width (widget->window);
view_height = gdk_window_get_height (widget->window);
if (menu->scroll_offset == 0 &&
view_height >= widget->requisition.height)
@ -3517,7 +3524,8 @@ get_arrows_sensitive_area (GtkMenu *menu,
gint scroll_arrow_height;
GtkArrowPlacement arrow_placement;
gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height);
width = gdk_window_get_width (GTK_WIDGET (menu)->window);
height = gdk_window_get_height (GTK_WIDGET (menu)->window);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
@ -4081,12 +4089,14 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
event_widget = gtk_get_event_widget ((GdkEvent*) event);
gdk_window_get_origin (menu_item->submenu->window, &submenu_left, &submenu_top);
gdk_drawable_get_size (menu_item->submenu->window, &width, &height);
width = gdk_window_get_width (menu_item->submenu->window);
height = gdk_window_get_height (menu_item->submenu->window);
submenu_right = submenu_left + width;
submenu_bottom = submenu_top + height;
gdk_drawable_get_size (event_widget->window, &width, &height);
width = gdk_window_get_width (event_widget->window);
height = gdk_window_get_height (event_widget->window);
if (event->x >= 0 && event->x < width)
{
@ -4659,7 +4669,8 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell,
gboolean double_arrows;
y = menu->scroll_offset;
gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height);
width = gdk_window_get_width (GTK_WIDGET (menu)->window);
height = gdk_window_get_height (GTK_WIDGET (menu)->window);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,

View File

@ -2327,8 +2327,8 @@ gtk_notebook_expose (GtkWidget *widget,
cairo_paint (cr);
cairo_destroy (cr);
gdk_drawable_get_size (priv->drag_window,
&area.width, &area.height);
area.width = gdk_window_get_width (priv->drag_window);
area.height = gdk_window_get_height (priv->drag_window);
gtk_notebook_draw_tab (notebook,
notebook->cur_page,
&area);
@ -3046,7 +3046,8 @@ get_pointer_position (GtkNotebook *notebook)
return POINTER_BETWEEN;
gdk_window_get_position (notebook->event_window, &wx, &wy);
gdk_drawable_get_size (GDK_DRAWABLE (notebook->event_window), &width, &height);
width = gdk_window_get_width (notebook->event_window);
height = gdk_window_get_height (notebook->event_window);
if (notebook->tab_pos == GTK_POS_TOP ||
notebook->tab_pos == GTK_POS_BOTTOM)
@ -3127,7 +3128,8 @@ check_threshold (GtkNotebook *notebook,
dnd_threshold *= DND_THRESHOLD_MULTIPLIER;
gdk_window_get_position (notebook->event_window, &rectangle.x, &rectangle.y);
gdk_drawable_get_size (GDK_DRAWABLE (notebook->event_window), &rectangle.width, &rectangle.height);
rectangle.width = gdk_window_get_width (notebook->event_window);
rectangle.height = gdk_window_get_height (notebook->event_window);
rectangle.x -= dnd_threshold;
rectangle.width += 2 * dnd_threshold;

View File

@ -18,6 +18,8 @@
* Alexander Larsson <alexl@redhat.com>
*/
#undef GDK_DISABLE_DEPRECATED /* We need gdk_drawable_get_size() */
#include "gtkoffscreenwindow.h"
#include "gtkalias.h"

View File

@ -351,7 +351,8 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
if (gtk_widget_get_realized (widget))
{
gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &w, &h);
w = gdk_window_get_width (widget->window);
h = gdk_window_get_height (widget->window);
gdk_window_reparent (widget->window, plug->socket_window, -w, -h);
}

View File

@ -29,6 +29,8 @@
#include <math.h>
#include <string.h>
#undef GDK_DISABLE_DEPRECATED /* We need gdk_drawable_get_size() */
#include "gtkorientable.h"
#include "gtkruler.h"
#include "gtkprivate.h"

View File

@ -1943,7 +1943,7 @@ _gtk_settings_handle_event (GdkEventSetting *event)
GParamSpec *pspec;
guint property_id;
settings = gtk_settings_get_for_screen (gdk_drawable_get_screen (event->window));
settings = gtk_settings_get_for_screen (gdk_window_get_screen (event->window));
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), event->name);
if (pspec)

View File

@ -752,7 +752,8 @@ gtk_spin_button_expose (GtkWidget *widget,
else
state = GTK_STATE_NORMAL;
gdk_drawable_get_size (spin->panel, &width, &height);
width = gdk_window_get_width (spin->panel);
height = gdk_window_get_height (spin->panel);
gtk_paint_box (widget->style, spin->panel,
state, shadow_type,

View File

@ -4046,7 +4046,7 @@ set_invisible_cursor (GdkWindow *window)
GdkDisplay *display;
GdkCursor *cursor;
display = gdk_drawable_get_display (window);
display = gdk_window_get_display (window);
cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
gdk_window_set_cursor (window, cursor);
@ -6078,7 +6078,8 @@ drag_scan_timeout (gpointer data)
text_view = GTK_TEXT_VIEW (data);
get_iter_at_pointer (text_view, &newplace, &x, &y);
gdk_drawable_get_size (text_view->text_window->bin_window, &width, &height);
width = gdk_window_get_width (text_view->text_window->bin_window);
height = gdk_window_get_height (text_view->text_window->bin_window);
gtk_text_buffer_move_mark (get_buffer (text_view),
text_view->dnd_mark,
@ -8148,7 +8149,7 @@ text_window_realize (GtkTextWindow *win,
if (gtk_widget_is_sensitive (widget))
{
/* I-beam cursor */
cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (widget->window),
cursor = gdk_cursor_new_for_display (gdk_window_get_display (widget->window),
GDK_XTERM);
gdk_window_set_cursor (win->bin_window, cursor);
gdk_cursor_unref (cursor);

View File

@ -1181,7 +1181,7 @@ gtk_tool_item_group_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
display = gdk_drawable_get_display (widget->window);
display = gdk_window_get_display (widget->window);
if (gdk_display_supports_composite (display))
gdk_window_set_composited (widget->window, TRUE);

View File

@ -621,7 +621,7 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
cairo_t *cr;
guint i;
display = gdk_drawable_get_display (widget->window);
display = gdk_window_get_display (widget->window);
if (!gdk_display_supports_composite (display))
return FALSE;

View File

@ -1298,7 +1298,7 @@ tooltips_enabled (GdkWindow *window)
GdkScreen *screen;
GtkSettings *settings;
screen = gdk_drawable_get_screen (window);
screen = gdk_window_get_screen (window);
settings = gtk_settings_get_for_screen (screen);
g_object_get (settings,
@ -1323,7 +1323,7 @@ _gtk_tooltip_handle_event (GdkEvent *event)
/* Returns coordinates relative to has_tooltip_widget's allocation. */
has_tooltip_widget = find_topmost_widget_coords_from_event (event, &x, &y);
display = gdk_drawable_get_display (event->any.window);
display = gdk_window_get_display (event->any.window);
current_tooltip = g_object_get_data (G_OBJECT (display),
"gdk-display-current-tooltip");

View File

@ -2282,9 +2282,8 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget,
if (column == tree_view->priv->drag_column)
{
GtkAllocation drag_allocation;
gdk_drawable_get_size (tree_view->priv->drag_window,
&(drag_allocation.width),
&(drag_allocation.height));
drag_allocation.width = gdk_window_get_width (tree_view->priv->drag_window);
drag_allocation.height = gdk_window_get_height (tree_view->priv->drag_window);
drag_allocation.x = 0;
drag_allocation.y = 0;
gtk_widget_size_allocate (tree_view->priv->drag_column->button,
@ -3027,7 +3026,7 @@ gtk_tree_view_button_release_column_resize (GtkWidget *widget,
GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE);
gtk_grab_remove (widget);
gdk_display_pointer_ungrab (gdk_drawable_get_display (event->window),
gdk_display_pointer_ungrab (gdk_window_get_display (event->window),
event->time);
return TRUE;
}
@ -4184,7 +4183,8 @@ invalidate_empty_focus (GtkTreeView *tree_view)
area.x = 0;
area.y = 0;
gdk_drawable_get_size (tree_view->priv->bin_window, &area.width, &area.height);
area.width = gdk_window_get_width (tree_view->priv->bin_window);
area.height = gdk_window_get_height (tree_view->priv->bin_window);
gdk_window_invalidate_rect (tree_view->priv->bin_window, &area, FALSE);
}
@ -4200,7 +4200,8 @@ draw_empty_focus (GtkTreeView *tree_view, GdkRectangle *clip_area)
if (!gtk_widget_has_focus (widget))
return;
gdk_drawable_get_size (tree_view->priv->bin_window, &w, &h);
w = gdk_window_get_width (tree_view->priv->bin_window);
h = gdk_window_get_height (tree_view->priv->bin_window);
w -= 2;
h -= 2;
@ -4377,8 +4378,8 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
if (new_y < 0)
new_y = 0;
y_offset = -_gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node);
gdk_drawable_get_size (tree_view->priv->bin_window,
&bin_window_width, &bin_window_height);
bin_window_width = gdk_window_get_width (tree_view->priv->bin_window);
bin_window_height = gdk_window_get_height (tree_view->priv->bin_window);
if (tree_view->priv->height < bin_window_height)
{
@ -4882,8 +4883,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
if (tree == NULL)
break;
gdk_drawable_get_size (tree_view->priv->bin_window,
&width, NULL);
width = gdk_window_get_width (tree_view->priv->bin_window);
if (row_ending_details)
gtk_paint_focus (widget->style,
@ -4938,8 +4938,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
(flags & GTK_CELL_RENDERER_INSENSITIVE ? GTK_STATE_INSENSITIVE :
GTK_STATE_NORMAL));
gdk_drawable_get_size (tree_view->priv->bin_window,
&width, NULL);
width = gdk_window_get_width (tree_view->priv->bin_window);
if (draw_hgrid_lines)
{
@ -9315,7 +9314,7 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view,
{
gint width;
gdk_drawable_get_size (tree_view->priv->header_window, &width, NULL);
width = gdk_window_get_width (tree_view->priv->header_window);
reorder->right_align = width + TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view);
}
}
@ -9409,7 +9408,8 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
gdk_window_show (tree_view->priv->drag_window);
gdk_window_get_origin (tree_view->priv->header_window, &x, &y);
gdk_drawable_get_size (tree_view->priv->header_window, &width, &height);
width = gdk_window_get_width (tree_view->priv->header_window);
height = gdk_window_get_height (tree_view->priv->header_window);
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
while (gtk_events_pending ())
@ -13793,8 +13793,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
background_area.y = y;
background_area.height = ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node));
gdk_drawable_get_size (tree_view->priv->bin_window,
&bin_window_width, NULL);
bin_window_width = gdk_window_get_width (tree_view->priv->bin_window);
drawable = gdk_pixmap_new (tree_view->priv->bin_window,
bin_window_width + 2,
@ -14235,7 +14234,7 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
gint tree_x, tree_y;
gint tree_width, tree_height;
GdkWindow *tree_window = GTK_WIDGET (tree_view)->window;
GdkScreen *screen = gdk_drawable_get_screen (tree_window);
GdkScreen *screen = gdk_window_get_screen (tree_window);
GtkRequisition requisition;
gint monitor_num;
GdkRectangle monitor;
@ -14246,9 +14245,8 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view,
gtk_widget_realize (search_dialog);
gdk_window_get_origin (tree_window, &tree_x, &tree_y);
gdk_drawable_get_size (tree_window,
&tree_width,
&tree_height);
tree_width = gdk_window_get_width (tree_window);
tree_height = gdk_window_get_height (tree_window);
gtk_widget_size_request (search_dialog, &requisition);
if (tree_x + tree_width > gdk_screen_get_width (screen))

View File

@ -1293,7 +1293,7 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
GDK_POINTER_MOTION_HINT_MASK |
GDK_KEY_PRESS_MASK);
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
attr.cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (tree_view->priv->header_window),
attr.cursor = gdk_cursor_new_for_display (gdk_window_get_display (tree_view->priv->header_window),
GDK_SB_H_DOUBLE_ARROW);
attr.y = 0;
attr.width = TREE_VIEW_DRAG_WIDTH;

View File

@ -3644,7 +3644,8 @@ gtk_widget_queue_draw_area (GtkWidget *widget,
x -= wx - widget->allocation.x;
y -= wy - widget->allocation.y;
gdk_drawable_get_size (widget->window, &wwidth, &wheight);
wwidth = gdk_window_get_width (widget->window);
wheight = gdk_window_get_height (widget->window);
if (x + width <= 0 || y + height <= 0 ||
x >= wwidth || y >= wheight)
@ -8957,7 +8958,7 @@ _gtk_widget_set_pointer_window (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
GdkScreen *screen = gdk_drawable_get_screen (widget->window);
GdkScreen *screen = gdk_window_get_screen (widget->window);
g_object_set_qdata (G_OBJECT (screen), quark_pointer_window,
pointer_window);
@ -8978,7 +8979,7 @@ _gtk_widget_get_pointer_window (GtkWidget *widget)
if (gtk_widget_get_realized (widget))
{
GdkScreen *screen = gdk_drawable_get_screen (widget->window);
GdkScreen *screen = gdk_window_get_screen (widget->window);
return g_object_get_qdata (G_OBJECT (screen), quark_pointer_window);
}
@ -9554,9 +9555,8 @@ expose_window (GdkWindow *window)
event.expose.count = 0;
event.expose.area.x = 0;
event.expose.area.y = 0;
gdk_drawable_get_size (GDK_DRAWABLE (window),
&event.expose.area.width,
&event.expose.area.height);
event.expose.area.width = gdk_window_get_width (window);
event.expose.area.height = gdk_window_get_height (window);
event.expose.region = gdk_region_rectangle (&event.expose.area);
/* If this is not double buffered, force a double buffer so that
@ -9657,7 +9657,8 @@ gtk_widget_get_snapshot (GtkWidget *widget,
continue;
windows = g_list_prepend (windows, subwin);
gdk_window_get_position (subwin, &wx, &wy);
gdk_drawable_get_size (subwin, &ww, &wh);
ww = gdk_window_get_width (subwin);
wh = gdk_window_get_height (subwin);
/* grow snapshot rectangle by extra widget sub window */
if (wx < x)
{

View File

@ -3110,7 +3110,7 @@ get_pixmap_and_mask (GdkWindow *window,
GdkPixmap **pmap_return,
GdkBitmap **mask_return)
{
GdkScreen *screen = gdk_drawable_get_screen (window);
GdkScreen *screen = gdk_window_get_screen (window);
ScreenIconInfo *default_icon_info = get_screen_icon_info (screen);
GdkPixbuf *best_icon;
GList *tmp_list;
@ -4101,8 +4101,8 @@ gtk_window_get_size (GtkWindow *window,
if (gtk_widget_get_mapped (GTK_WIDGET (window)))
{
gdk_drawable_get_size (GTK_WIDGET (window)->window,
&w, &h);
w = gdk_window_get_width (GTK_WIDGET (window)->window);
h = gdk_window_get_height (GTK_WIDGET (window)->window);
}
else
{