Commit 8500d945 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Change _gdk_x11_send_xevent_async() to

Tue Jul  8 17:36:21 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
        Change _gdk_x11_send_xevent_async() to
        _gdk_x11_send_client_message_async() avoid using Xlib
        internals that are different on Solaris.
        (#116917, Morten Welinder)
parent 4a8650e9
Tue Jul 8 17:36:21 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
Change _gdk_x11_send_xevent_async() to
_gdk_x11_send_client_message_async() avoid using Xlib
internals that are different on Solaris.
(#116917, Morten Welinder)
2003-07-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition. (#116501, Doug Quale)
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition.
(#116501, Doug Quale)
Tue Jul 8 21:35:22 2003 Soeren Sandmann <sandmann@daimi.au.dk>
......
Tue Jul 8 17:36:21 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
Change _gdk_x11_send_xevent_async() to
_gdk_x11_send_client_message_async() avoid using Xlib
internals that are different on Solaris.
(#116917, Morten Welinder)
2003-07-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition. (#116501, Doug Quale)
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition.
(#116501, Doug Quale)
Tue Jul 8 21:35:22 2003 Soeren Sandmann <sandmann@daimi.au.dk>
......
Tue Jul 8 17:36:21 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
Change _gdk_x11_send_xevent_async() to
_gdk_x11_send_client_message_async() avoid using Xlib
internals that are different on Solaris.
(#116917, Morten Welinder)
2003-07-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition. (#116501, Doug Quale)
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition.
(#116501, Doug Quale)
Tue Jul 8 21:35:22 2003 Soeren Sandmann <sandmann@daimi.au.dk>
......
Tue Jul 8 17:36:21 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
Change _gdk_x11_send_xevent_async() to
_gdk_x11_send_client_message_async() avoid using Xlib
internals that are different on Solaris.
(#116917, Morten Welinder)
2003-07-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition. (#116501, Doug Quale)
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition.
(#116501, Doug Quale)
Tue Jul 8 21:35:22 2003 Soeren Sandmann <sandmann@daimi.au.dk>
......
Tue Jul 8 17:36:21 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c:
Change _gdk_x11_send_xevent_async() to
_gdk_x11_send_client_message_async() avoid using Xlib
internals that are different on Solaris.
(#116917, Morten Welinder)
2003-07-08 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition. (#116501, Doug Quale)
* gtk/gtkcontainer.c (gtk_container_remove): Doc addition.
(#116501, Doug Quale)
Tue Jul 8 21:35:22 2003 Soeren Sandmann <sandmann@daimi.au.dk>
......
......@@ -152,18 +152,59 @@ send_event_handler (Display *dpy,
return False;
}
static void
client_message_to_wire (XClientMessageEvent *ev,
xEvent *event)
{
int i;
event->u.clientMessage.window = ev->window;
event->u.u.type = ev->type;
event->u.u.detail = ev->format;
switch (ev->format)
{
case 8:
event->u.clientMessage.u.b.type = ev->message_type;
for (i = 0; i < 20; i++)
event->u.clientMessage.u.b.bytes[i] = ev->data.b[i];
break;
case 16:
event->u.clientMessage.u.s.type = ev->message_type;
event->u.clientMessage.u.s.shorts0 = ev->data.s[0];
event->u.clientMessage.u.s.shorts1 = ev->data.s[1];
event->u.clientMessage.u.s.shorts2 = ev->data.s[2];
event->u.clientMessage.u.s.shorts3 = ev->data.s[3];
event->u.clientMessage.u.s.shorts4 = ev->data.s[4];
event->u.clientMessage.u.s.shorts5 = ev->data.s[5];
event->u.clientMessage.u.s.shorts6 = ev->data.s[6];
event->u.clientMessage.u.s.shorts7 = ev->data.s[7];
event->u.clientMessage.u.s.shorts8 = ev->data.s[8];
event->u.clientMessage.u.s.shorts9 = ev->data.s[9];
break;
case 32:
event->u.clientMessage.u.l.type = ev->message_type;
event->u.clientMessage.u.l.longs0 = ev->data.l[0];
event->u.clientMessage.u.l.longs1 = ev->data.l[1];
event->u.clientMessage.u.l.longs2 = ev->data.l[2];
event->u.clientMessage.u.l.longs3 = ev->data.l[3];
event->u.clientMessage.u.l.longs4 = ev->data.l[4];
break;
default:
/* client passing bogus data, let server complain */
break;
}
}
void
_gdk_x11_send_xevent_async (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XEvent *event_send,
GdkSendXEventCallback callback,
gpointer data)
_gdk_x11_send_client_message_async (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XClientMessageEvent *event_send,
GdkSendXEventCallback callback,
gpointer data)
{
Display *dpy;
SendEventState *state;
Status status;
dpy = GDK_DISPLAY_XDISPLAY (display);
......@@ -185,24 +226,8 @@ _gdk_x11_send_xevent_async (GdkDisplay *display,
{
register xSendEventReq *req;
xEvent ev;
register Status (**fp)();
/* call through display to find proper conversion routine */
fp = &dpy->wire_vec[event_send->type & 0177];
if (*fp == NULL) *fp = _XEventToWire;
status = (**fp)(dpy, event_send, &ev);
if (!status)
{
g_warning ("Error converting event to wire");
DeqAsyncHandler(dpy, &state->async);
UnlockDisplay(dpy);
SyncHandle();
g_free (state);
return;
}
client_message_to_wire (event_send, &ev);
GetReq(SendEvent, req);
req->destination = window;
......
......@@ -44,17 +44,17 @@ struct _GdkChildInfoX11
guint window_class : 2;
};
void _gdk_x11_send_xevent_async (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XEvent *event_send,
GdkSendXEventCallback callback,
gpointer data);
void _gdk_x11_set_input_focus_safe (GdkDisplay *display,
Window window,
int revert_to,
Time time);
void _gdk_x11_send_client_message_async (GdkDisplay *display,
Window window,
gboolean propagate,
glong event_mask,
XClientMessageEvent *event_send,
GdkSendXEventCallback callback,
gpointer data);
void _gdk_x11_set_input_focus_safe (GdkDisplay *display,
Window window,
int revert_to,
Time time);
gboolean _gdk_x11_get_window_child_info (GdkDisplay *display,
Window window,
......
......@@ -2100,9 +2100,9 @@ xdnd_set_actions (GdkDragContext *context)
}
static void
send_xevent_async_cb (Window window,
gboolean success,
gpointer data)
send_client_message_async_cb (Window window,
gboolean success,
gpointer data)
{
GdkDragContext *context = data;
GDK_NOTE (DND,
......@@ -2151,19 +2151,19 @@ gdk_drag_context_get_display (GdkDragContext *context)
}
static void
send_xevent_async (GdkDragContext *context,
Window window,
gboolean propagate,
glong event_mask,
XEvent *event_send)
send_client_message_async (GdkDragContext *context,
Window window,
gboolean propagate,
glong event_mask,
XClientMessageEvent *event_send)
{
GdkDisplay *display = gdk_drag_context_get_display (context);
g_object_ref (context);
_gdk_x11_send_xevent_async (display, window,
propagate, event_mask, event_send,
send_xevent_async_cb, context);
_gdk_x11_send_client_message_async (display, window,
propagate, event_mask, event_send,
send_client_message_async_cb, context);
}
static gboolean
......@@ -2176,9 +2176,10 @@ xdnd_send_xevent (GdkDragContext *context,
Window xwindow;
glong event_mask;
g_assert (event_send->xany.type == ClientMessage);
/* We short-circuit messages to ourselves */
if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN &&
event_send->xany.type == ClientMessage)
if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
{
gint i;
......@@ -2205,7 +2206,8 @@ xdnd_send_xevent (GdkDragContext *context,
else
event_mask = 0;
send_xevent_async (context, xwindow, propagate, event_mask, event_send);
send_client_message_async (context, xwindow, propagate, event_mask,
&event_send->xclient);
return TRUE;
}
......
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