X11: Let the language initialize XEvent structs
From upstream: 1f508530f0
This commit is contained in:
parent
41ebb72276
commit
a491a801bf
26
glfw/x11_window.c
vendored
26
glfw/x11_window.c
vendored
@ -198,10 +198,7 @@ static int translateState(int state)
|
|||||||
static void sendEventToWM(_GLFWwindow* window, Atom type,
|
static void sendEventToWM(_GLFWwindow* window, Atom type,
|
||||||
long a, long b, long c, long d, long e)
|
long a, long b, long c, long d, long e)
|
||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event = { ClientMessage };
|
||||||
memset(&event, 0, sizeof(event));
|
|
||||||
|
|
||||||
event.type = ClientMessage;
|
|
||||||
event.xclient.window = window->x11.handle;
|
event.xclient.window = window->x11.handle;
|
||||||
event.xclient.format = 32; // Data is 32-bit longs
|
event.xclient.format = 32; // Data is 32-bit longs
|
||||||
event.xclient.message_type = type;
|
event.xclient.message_type = type;
|
||||||
@ -842,11 +839,8 @@ static void handleSelectionRequest(XEvent* event)
|
|||||||
{
|
{
|
||||||
const XSelectionRequestEvent* request = &event->xselectionrequest;
|
const XSelectionRequestEvent* request = &event->xselectionrequest;
|
||||||
|
|
||||||
XEvent reply;
|
XEvent reply = { SelectionNotify };
|
||||||
memset(&reply, 0, sizeof(reply));
|
|
||||||
|
|
||||||
reply.xselection.property = writeTargetToProperty(request);
|
reply.xselection.property = writeTargetToProperty(request);
|
||||||
reply.xselection.type = SelectionNotify;
|
|
||||||
reply.xselection.display = request->display;
|
reply.xselection.display = request->display;
|
||||||
reply.xselection.requestor = request->requestor;
|
reply.xselection.requestor = request->requestor;
|
||||||
reply.xselection.selection = request->selection;
|
reply.xselection.selection = request->selection;
|
||||||
@ -1488,10 +1482,7 @@ static void processEvent(XEvent *event)
|
|||||||
}
|
}
|
||||||
else if (_glfw.x11.xdnd.version >= 2)
|
else if (_glfw.x11.xdnd.version >= 2)
|
||||||
{
|
{
|
||||||
XEvent reply;
|
XEvent reply = { ClientMessage };
|
||||||
memset(&reply, 0, sizeof(reply));
|
|
||||||
|
|
||||||
reply.type = ClientMessage;
|
|
||||||
reply.xclient.window = _glfw.x11.xdnd.source;
|
reply.xclient.window = _glfw.x11.xdnd.source;
|
||||||
reply.xclient.message_type = _glfw.x11.XdndFinished;
|
reply.xclient.message_type = _glfw.x11.XdndFinished;
|
||||||
reply.xclient.format = 32;
|
reply.xclient.format = 32;
|
||||||
@ -1524,10 +1515,7 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
_glfwInputCursorPos(window, xpos, ypos);
|
_glfwInputCursorPos(window, xpos, ypos);
|
||||||
|
|
||||||
XEvent reply;
|
XEvent reply = { ClientMessage };
|
||||||
memset(&reply, 0, sizeof(reply));
|
|
||||||
|
|
||||||
reply.type = ClientMessage;
|
|
||||||
reply.xclient.window = _glfw.x11.xdnd.source;
|
reply.xclient.window = _glfw.x11.xdnd.source;
|
||||||
reply.xclient.message_type = _glfw.x11.XdndStatus;
|
reply.xclient.message_type = _glfw.x11.XdndStatus;
|
||||||
reply.xclient.format = 32;
|
reply.xclient.format = 32;
|
||||||
@ -1580,10 +1568,7 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
if (_glfw.x11.xdnd.version >= 2)
|
if (_glfw.x11.xdnd.version >= 2)
|
||||||
{
|
{
|
||||||
XEvent reply;
|
XEvent reply = { ClientMessage };
|
||||||
memset(&reply, 0, sizeof(reply));
|
|
||||||
|
|
||||||
reply.type = ClientMessage;
|
|
||||||
reply.xclient.window = _glfw.x11.xdnd.source;
|
reply.xclient.window = _glfw.x11.xdnd.source;
|
||||||
reply.xclient.message_type = _glfw.x11.XdndFinished;
|
reply.xclient.message_type = _glfw.x11.XdndFinished;
|
||||||
reply.xclient.format = 32;
|
reply.xclient.format = 32;
|
||||||
@ -2896,4 +2881,3 @@ GLFWAPI unsigned long long glfwDBusUserNotify(const char *app_name, const char*
|
|||||||
GLFWAPI void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler) {
|
GLFWAPI void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler) {
|
||||||
glfw_dbus_set_user_notification_activated_handler(handler);
|
glfw_dbus_set_user_notification_activated_handler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user