rpms/xfce-mcs-plugins/devel xfce-mcs-plugins-4.4.2-mouse.patch, NONE, 1.1

Kevin Fenzi (kevin) fedora-extras-commits at redhat.com
Wed Dec 19 03:05:31 UTC 2007


Author: kevin

Update of /cvs/extras/rpms/xfce-mcs-plugins/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15436

Added Files:
	xfce-mcs-plugins-4.4.2-mouse.patch 
Log Message:
Add patch for mouse button crash (fixes #425925)


xfce-mcs-plugins-4.4.2-mouse.patch:

--- NEW FILE xfce-mcs-plugins-4.4.2-mouse.patch ---
diff -Nur xfce-mcs-plugins-4.4.2.orig/plugins/mouse_plugin/mouse_plugin.c xfce-mcs-plugins-4.4.2/plugins/mouse_plugin/mouse_plugin.c
--- xfce-mcs-plugins-4.4.2.orig/plugins/mouse_plugin/mouse_plugin.c	2007-11-17 12:31:23.000000000 -0700
+++ xfce-mcs-plugins-4.4.2/plugins/mouse_plugin/mouse_plugin.c	2007-12-17 17:51:03.000000000 -0700
@@ -174,7 +174,7 @@
     unsigned char *buttons;
     gint n_buttons, n_devices, i;
     gint idx_1 = 0, idx_3 = 1;
-    gsize buttons_capacity = 16;
+    gsize buttons_capacity = DEFAULT_PTR_MAP_SIZE;
 
     device_info = XListInputDevices (GDK_DISPLAY (), &n_devices);
 
@@ -204,11 +204,12 @@
             continue;
         }
 
-        n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, DEFAULT_PTR_MAP_SIZE);
-        if (n_buttons > DEFAULT_PTR_MAP_SIZE)
+	n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, buttons_capacity);
+	if (n_buttons > buttons_capacity)
         {
-            buttons = g_alloca (n_buttons);
-            n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, n_buttons);
+		buttons = g_realloc (buttons, n_buttons);
+		buttons_capacity = n_buttons;
+		n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY (), device, buttons, buttons_capacity);
         }
 
         for (i = 0; i < n_buttons; i++)




More information about the fedora-extras-commits mailing list