x11: Use gdk_x11_window_foreign_new_for_display() unconditionally

gdk_x11_window_lookup_window() calls are done by this function alreayd,
so no need to do them manually.
This commit is contained in:
Benjamin Otte 2011-02-01 16:36:23 +01:00
parent 5441ecd350
commit c2a5d715d5

View File

@ -1729,17 +1729,11 @@ motif_drag_context_new (GdkWindow *dest_window,
context->protocol = GDK_DRAG_PROTO_MOTIF;
context->is_source = FALSE;
context->source_window = gdk_x11_window_lookup_for_display (display, source_window);
if (context->source_window)
g_object_ref (context->source_window);
else
context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window);
if (!context->source_window)
{
context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window);
if (!context->source_window)
{
g_object_unref (context_x11);
return NULL;
}
g_object_unref (context_x11);
return NULL;
}
context->dest_window = dest_window;
@ -2899,17 +2893,11 @@ xdnd_enter_filter (GdkXEvent *xev,
device_manager = gdk_display_get_device_manager (display);
gdk_drag_context_set_device (context, gdk_device_manager_get_client_pointer (device_manager));
context->source_window = gdk_x11_window_lookup_for_display (display, source_window);
if (context->source_window)
g_object_ref (context->source_window);
else
context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window);
if (!context->source_window)
{
context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window);
if (!context->source_window)
{
g_object_unref (context);
return GDK_FILTER_REMOVE;
}
g_object_unref (context);
return GDK_FILTER_REMOVE;
}
context->dest_window = event->any.window;
g_object_ref (context->dest_window);
@ -3332,13 +3320,7 @@ gdk_x11_drag_context_find_window (GdkDragContext *context,
&context_x11->version);
if (recipient != None)
{
dest_window = gdk_x11_window_lookup_for_display (display, recipient);
if (dest_window)
g_object_ref (dest_window);
else
dest_window = gdk_x11_window_foreign_new_for_display (display, recipient);
}
dest_window = gdk_x11_window_foreign_new_for_display (display, recipient);
else
dest_window = NULL;
}