[g-a-devel]patch to at-spi
- From: Bill Haneman <bill haneman sun com>
- To: gnome-accessibility-devel gnome org
- Subject: [g-a-devel]patch to at-spi
- Date: 13 Sep 2002 14:19:13 +0100
FYI:
I just applied the following patch to at-spi. It fixes a memory leak
and other minor idiocy in registryd/deviceeventcontroller.c. I also
removed some redundant listeners from event-listener-test.
regards,
Bill
Index: deviceeventcontroller.c
===================================================================
RCS file: /cvs/gnome/at-spi/registryd/deviceeventcontroller.c,v
retrieving revision 1.43
diff -u -r1.43 deviceeventcontroller.c
--- deviceeventcontroller.c 26 Jun 2002 18:55:11 -0000 1.43
+++ deviceeventcontroller.c 13 Sep 2002 13:00:27 -0000
@@ -161,19 +161,13 @@
unsigned int mask_return;
gchar event_name[24];
Display *display = spi_get_display ();
- if (last_mouse_pos == NULL) {
- last_mouse_pos = g_new0 (GdkPoint, 1);
- last_mouse_pos->x = 0;
- last_mouse_pos->y = 0;
- e.type = g_strdup ("mouse:abs");
- } else {
- e.type = g_strdup ("mouse:rel");
- }
+
if (display != NULL)
XQueryPointer(display, DefaultRootWindow (display),
&root_return, &child_return,
&x, &y,
&win_x_return, &win_y_return, &mask_return);
+
if ((mask_return & mouse_button_mask) != mouse_button_state) {
int button_number = 0;
if (!(mask_return & Button1Mask) &&
@@ -206,23 +200,32 @@
Accessibility_Registry_notifyEvent (BONOBO_OBJREF (registry),
&e,
&ev);
+ g_free (e.type);
}
mouse_button_state = mask_return & mouse_button_mask;
}
+ if (last_mouse_pos == NULL) {
+ last_mouse_pos = g_new0 (GdkPoint, 1);
+ last_mouse_pos->x = 0;
+ last_mouse_pos->y = 0;
+ e.type = g_strdup ("mouse:abs");
+ } else {
+ e.type = g_strdup ("mouse:rel");
+ }
if (x != last_mouse_pos->x || y != last_mouse_pos->y) {
e.source = BONOBO_OBJREF (registry->desktop);
e.detail1 = x - last_mouse_pos->x;
e.detail2 = y - last_mouse_pos->y;
CORBA_exception_init (&ev);
- if (last_mouse_pos == NULL)
- last_mouse_pos = g_new0 (GdkPoint, 1);
last_mouse_pos->x = x;
last_mouse_pos->y = y;
Accessibility_Registry_notifyEvent (BONOBO_OBJREF (registry),
&e,
&ev);
+ g_free (e.type);
return TRUE;
}
+ g_free (e.type);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]