Commit f3f016d0 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Add gdk_drag_find_window_for_screen(), so that we can interpret x_root /

Mon Oct  7 15:48:44 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
        gdk_drag_find_window_for_screen(), so that we can
        interpret x_root / y_root relative to the correct screen.

        * gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
        gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
        Move gdk_drag_find_window(), gdk_drag_get_protocol() here.

        * gtk/gtkdnd.c: Handle drags between screens; use
        a fallback icon for icons set as windows/pixmaps,
        move the drag icon between displays for icons set as
        pixbufs.

        * gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
        loop from last change.
parent 253458ec
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
Mon Oct 7 15:48:44 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.[ch] gdk/x11/gdkdnd-x11.c: Add
gdk_drag_find_window_for_screen(), so that we can
interpret x_root / y_root relative to the correct screen.
* gdk/gdkdnd.c Makefile.am gdk/x11/gdkdnd-x11.c
gdk/fb/gdkdnd-fb.c gdk/win32/gdkdnd-win32.c: New file.
Move gdk_drag_find_window(), gdk_drag_get_protocol() here.
* gtk/gtkdnd.c: Handle drags between screens; use
a fallback icon for icons set as windows/pixmaps,
move the drag icon between displays for icons set as
pixbufs.
* gdk/x11/gdkkeys-x11.c (update_keymaps): Fix infinite
loop from last change.
Mon Oct 7 15:10:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkinternals.h
......
......@@ -129,6 +129,7 @@ gdk_c_sources = @STRIP_BEGIN@ \
gdkcolor.c \
gdkcursor.c \
gdkdisplay.c \
gdkdnd.c \
gdkdraw.c \
gdkevents.c \
gdkfont.c \
......
......@@ -102,20 +102,28 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context);
GdkDragContext * gdk_drag_begin (GdkWindow *window,
GList *targets);
guint32 gdk_drag_get_protocol_for_display (GdkDisplay *display,
guint32 xid,
GdkDragProtocol *protocol);
guint32 gdk_drag_get_protocol_for_display (GdkDisplay *display,
guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
#ifndef GDK_MULTIHEAD_SAFE
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
#endif /* GDK_MULTIHEAD_SAFE */
void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
gboolean gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
......
......@@ -378,8 +378,9 @@ gdk_drag_begin (GdkWindow *window,
}
guint32
gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol)
gdk_drag_get_protocol_for_display (GdkDisplay *display,
guint32 xid,
GdkDragProtocol *protocol)
{
GdkWindow *window;
......@@ -444,12 +445,13 @@ get_toplevel_window_at (GdkWindow *ignore,
void
gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
GdkWindow *dest;
......
......@@ -1298,8 +1298,9 @@ gdk_drag_begin (GdkWindow *window,
}
guint32
gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol)
gdk_drag_get_protocol_for_display (GdkDisplay *display,
guint32 xid,
GdkDragProtocol *protocol)
{
GdkWindow *window;
......@@ -1317,12 +1318,13 @@ gdk_drag_get_protocol (guint32 xid,
}
void
gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
HWND recipient;
POINT pt;
......
......@@ -83,7 +83,7 @@ struct _GdkDragContextPrivateX11 {
guint motif_targets_set : 1; /* Whether we've already set motif initiator info */
guint drag_status : 4; /* current status of drag */
GdkWindowCache *window_cache;
GSList *window_caches;
};
#define PRIVATE_DATA(context) ((GdkDragContextPrivateX11 *) GDK_DRAG_CONTEXT (context)->windowing_data)
......@@ -188,6 +188,7 @@ gdk_drag_context_finalize (GObject *object)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
GSList *tmp_list;
g_list_free (context->targets);
......@@ -202,9 +203,10 @@ gdk_drag_context_finalize (GObject *object)
if (context->dest_window)
g_object_unref (context->dest_window);
if (private->window_cache)
gdk_window_cache_destroy (private->window_cache);
for (tmp_list = private->window_caches; tmp_list; tmp_list = tmp_list->next)
gdk_window_cache_destroy (tmp_list->data);
g_slist_free (private->window_caches);
contexts = g_list_remove (contexts, context);
......@@ -2840,22 +2842,38 @@ gdk_drag_get_protocol_for_display (GdkDisplay *display,
return None;
}
guint32
gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol)
static GdkWindowCache *
drag_context_find_window_cache (GdkDragContext *context,
GdkScreen *screen)
{
return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol);
GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
GSList *tmp_list;
GdkWindowCache *cache;
for (tmp_list = private->window_caches; tmp_list; tmp_list = tmp_list->next)
{
cache = tmp_list->data;
if (cache->screen == screen)
return cache;
}
cache = gdk_window_cache_new (screen);
private->window_caches = g_slist_prepend (private->window_caches, cache);
return cache;
}
void
gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
GdkWindowCache *window_cache;
GdkDisplay *display;
Window dest;
......@@ -2863,10 +2881,9 @@ gdk_drag_find_window (GdkDragContext *context,
display = GDK_WINDOW_DISPLAY (context->source_window);
if (!private->window_cache)
private->window_cache = gdk_window_cache_new (gdk_drawable_get_screen (context->source_window));
window_cache = drag_context_find_window_cache (context, screen);
dest = get_client_window_at_coords (private->window_cache,
dest = get_client_window_at_coords (window_cache,
drag_window ?
GDK_DRAWABLE_XID (drag_window) : None,
x_root, y_root);
......
......@@ -303,7 +303,7 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
*/
if (mask == GDK_CONTROL_MASK || mask == GDK_SHIFT_MASK ||
mask == GDK_LOCK_MASK || mask == GDK_MOD1_MASK)
continue;
goto next;
while (j < keymap_x11->keysyms_per_keycode)
{
......@@ -318,7 +318,8 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
++j;
}
}
next:
++i;
}
}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment