Use more gdk_window_ accessors instead of gdk_drawable_ accessors

This fixes compile-time warnings and crashes on 64-bit systems.
This commit is contained in:
Jürg Billeter 2010-11-10 09:09:38 -05:00 committed by Matthias Clasen
parent 75a1102901
commit 4773148f1a
7 changed files with 21 additions and 19 deletions

View File

@ -1908,7 +1908,7 @@ _gtk_clipboard_handle_event (GdkEventOwnerChange *event)
GdkDisplay *display;
GtkClipboard *clipboard;
display = gdk_drawable_get_display (event->window);
display = gdk_window_get_display (event->window);
clipboard = clipboard_peek (display, event->selection, TRUE);
if (clipboard)

View File

@ -1064,7 +1064,7 @@ gtk_drag_finish (GdkDragContext *context,
if (target != GDK_NONE)
{
GtkWidget *selection_widget = gtk_drag_get_ipc_widget_for_screen (gdk_drawable_get_screen (context->source_window));
GtkWidget *selection_widget = gtk_drag_get_ipc_widget_for_screen (gdk_window_get_screen (context->source_window));
g_object_ref (context);
@ -1115,7 +1115,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,
@ -2129,7 +2130,7 @@ gtk_drag_dest_motion (GtkWidget *widget,
{
gdk_drag_find_window_for_screen (info->proxy_source->context,
NULL,
gdk_drawable_get_screen (current_event->dnd.window),
gdk_window_get_screen (current_event->dnd.window),
current_event->dnd.x_root,
current_event->dnd.y_root,
&dest_window, &proto);
@ -2251,7 +2252,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
{
gdk_drag_find_window_for_screen (info->proxy_source->context,
NULL,
gdk_drawable_get_screen (current_event->dnd.window),
gdk_window_get_screen (current_event->dnd.window),
current_event->dnd.x_root,
current_event->dnd.y_root,
&dest_window, &proto);
@ -3130,7 +3131,7 @@ set_icon_stock_pixbuf (GdkDragContext *context,
g_return_if_fail (pixbuf != NULL || stock_id != NULL);
g_return_if_fail (pixbuf == NULL || stock_id == NULL);
screen = gdk_drawable_get_screen (context->source_window);
screen = gdk_window_get_screen (context->source_window);
/* Push a NULL colormap to guard against gtk_widget_push_colormap() */
gtk_widget_push_colormap (NULL);
@ -3159,7 +3160,7 @@ set_icon_stock_pixbuf (GdkDragContext *context,
else
g_object_ref (pixbuf);
display = gdk_drawable_get_display (context->source_window);
display = gdk_window_get_display (context->source_window);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
@ -3273,10 +3274,11 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context,
screen = gdk_colormap_get_screen (colormap);
g_return_if_fail (gdk_drawable_get_screen (pixmap) == screen);
g_return_if_fail (!mask || gdk_drawable_get_screen (mask) == screen);
g_return_if_fail (gdk_window_get_screen (pixmap) == screen);
g_return_if_fail (!mask || gdk_window_get_screen (mask) == screen);
gdk_drawable_get_size (pixmap, &width, &height);
width = gdk_window_get_width (pixmap);
height = gdk_window_get_height (pixmap);
gtk_widget_push_colormap (colormap);
@ -3332,7 +3334,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

@ -115,7 +115,7 @@ static void
xembed_set_info (GdkWindow *window,
unsigned long flags)
{
GdkDisplay *display = gdk_drawable_get_display (window);
GdkDisplay *display = gdk_window_get_display (window);
unsigned long buffer[2];
Atom xembed_info_atom = gdk_x11_get_xatom_by_name_for_display (display, "_XEMBED_INFO");
@ -202,7 +202,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
GdkEvent *event,
gpointer data)
{
GdkScreen *screen = gdk_drawable_get_screen (event->any.window);
GdkScreen *screen = gdk_window_get_screen (event->any.window);
GdkDisplay *display = gdk_screen_get_display (screen);
GtkPlug *plug = GTK_PLUG (data);
XEvent *xevent = (XEvent *)gdk_xevent;

View File

@ -2524,7 +2524,7 @@ _gtk_selection_incr_event (GdkWindow *window,
g_message ("PropertyDelete, property %ld", event->atom);
#endif
selection_max_size = GTK_SELECTION_MAX_SIZE (gdk_drawable_get_display (window));
selection_max_size = GTK_SELECTION_MAX_SIZE (gdk_window_get_display (window));
/* Now find the appropriate ongoing INCR */
tmp_list = current_incrs;

View File

@ -128,7 +128,7 @@ _gtk_socket_windowing_send_key_event (GtkSocket *socket,
gboolean mask_key_presses)
{
XKeyEvent xkey;
GdkScreen *screen = gdk_drawable_get_screen (socket->plug_window);
GdkScreen *screen = gdk_window_get_screen (socket->plug_window);
memset (&xkey, 0, sizeof (xkey));
xkey.type = (gdk_event->type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
@ -294,7 +294,7 @@ xembed_get_info (GdkWindow *window,
unsigned long *version,
unsigned long *flags)
{
GdkDisplay *display = gdk_drawable_get_display (window);
GdkDisplay *display = gdk_window_get_display (window);
Atom xembed_info_atom = gdk_x11_get_xatom_by_name_for_display (display, "_XEMBED_INFO");
Atom type;
int format;

View File

@ -147,7 +147,7 @@ _gtk_xembed_send_message (GdkWindow *recipient,
g_return_if_fail (GDK_IS_WINDOW (recipient));
display = gdk_drawable_get_display (recipient);
display = gdk_window_get_display (recipient);
GTK_NOTE (PLUGSOCKET,
g_message ("Sending %s", _gtk_xembed_message_name (message)));

View File

@ -495,7 +495,7 @@ get_im (GdkWindow *client_window,
{
GSList *tmp_list;
GtkXIMInfo *info;
GdkScreen *screen = gdk_drawable_get_screen (client_window);
GdkScreen *screen = gdk_window_get_screen (client_window);
info = NULL;
tmp_list = open_ims;
@ -716,7 +716,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
KeySym keysym;
Status status;
gboolean result = FALSE;
GdkWindow *root_window = gdk_screen_get_root_window (gdk_drawable_get_screen (event->window));
GdkWindow *root_window = gdk_screen_get_root_window (gdk_window_get_screen (event->window));
XKeyPressedEvent xevent;