rpms/tk/devel genericevent.patch, NONE, 1.1 tk.spec, 1.55, 1.56 tk-8.5.3-crash.patch, 1.1, NONE

Marcela Mašláňová (mmaslano) fedora-extras-commits at redhat.com
Mon Aug 4 12:33:40 UTC 2008


Author: mmaslano

Update of /cvs/pkgs/rpms/tk/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4178

Modified Files:
	tk.spec 
Added Files:
	genericevent.patch 
Removed Files:
	tk-8.5.3-crash.patch 
Log Message:
* Mon Aug  4 2008 Marcela Maslanova <mmaslano at redhat.com> - 1:8.5.3-3
- previous bug - remove my patch, add upstream patch
- Problem is updated xorg, which changed behaviour of GenericEvent


genericevent.patch:

--- NEW FILE genericevent.patch ---
Index: generic/tk.h
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tk.h,v
retrieving revision 1.112
diff -u -r1.112 tk.h
--- tk8.5.3/generic/tk.h	19 Jun 2008 19:48:26 -0000	1.112
+++ tk8.5.3/ generic/tk.h	28 Jul 2008 12:38:26 -0000
@@ -627,17 +627,18 @@
  *---------------------------------------------------------------------------
  */
 
-#define VirtualEvent	    (LASTEvent)
-#define ActivateNotify	    (LASTEvent + 1)
-#define DeactivateNotify    (LASTEvent + 2)
-#define MouseWheelEvent     (LASTEvent + 3)
-#define TK_LASTEVENT	    (LASTEvent + 4)
+#if (TK_MAJOR_VERSION > 8)
+#error Maintenance todo: Fix GenericEvent/VirtualEvent clash. [Bug 2010422]
+#endif
+#define VirtualEvent	    (MappingNotify + 1)
+#define ActivateNotify	    (MappingNotify + 2)
+#define DeactivateNotify    (MappingNotify + 3)
+#define MouseWheelEvent     (MappingNotify + 4)
+#define TK_LASTEVENT	    (MappingNotify + 5)
 
 #define MouseWheelMask	    (1L << 28)
-
 #define ActivateMask	    (1L << 29)
 #define VirtualEventMask    (1L << 30)
-#define TK_LASTEVENT	    (LASTEvent + 4)
 
 /*
  * A virtual event shares most of its fields with the XKeyEvent and
Index: generic/tkEvent.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkEvent.c,v
retrieving revision 1.35
diff -u -r1.35 tkEvent.c
--- tk8.5.3/generic/tkEvent.c	26 Mar 2008 19:04:09 -0000	1.35
+++ tk8.5.3/ generic/tkEvent.c	28 Jul 2008 12:38:27 -0000
@@ -75,7 +75,7 @@
  * Array of event masks corresponding to each X event:
  */
 
-static unsigned long eventMasks[TK_LASTEVENT] = {
+static unsigned long realEventMasks[MappingNotify+1] = {
     0,
     0,
     KeyPressMask,			/* KeyPress */
@@ -113,7 +113,10 @@
     0,					/* SelectionNotify */
     ColormapChangeMask,			/* ColormapNotify */
     0,					/* ClientMessage */
-    0,					/* Mapping Notify */
+    0					/* Mapping Notify */
+};
+
+static unsigned long virtualEventMasks[TK_LASTEVENT-VirtualEvent] = {
     VirtualEventMask,			/* VirtualEvents */
     ActivateMask,			/* ActivateNotify */
     ActivateMask,			/* DeactivateNotify */
@@ -489,7 +492,7 @@
  *
  * GetEventMaskFromXEvent --
  *
- *	The event type is looked up in our eventMasks table, and may be
+ *	The event type is looked up in our eventMasks tables, and may be
  *	changed to a different mask depending on the state of the event and
  *	window members.
  *
@@ -506,7 +509,21 @@
 GetEventMaskFromXEvent(
     XEvent *eventPtr)
 {
-    unsigned long mask = eventMasks[eventPtr->xany.type];
+    unsigned long mask;
+
+    /*
+     * Get the event mask from the correct table. Note that there are two
+     * tables here because that means we no longer need this code to rely on
+     * the exact value of VirtualEvent, which has caused us problems in the
+     * past when X11 changed the value of LASTEvent. [Bug ???]
+     */
+
+    if (eventPtr->xany.type <= MappingNotify) {
+	mask = realEventMasks[eventPtr->xany.type];
+    } else if (eventPtr->xany.type >= VirtualEvent
+	    && eventPtr->xany.type<TK_LASTEVENT) {
+	mask = virtualEventMasks[eventPtr->xany.type - VirtualEvent];
+    }
 
     /*
      * Events selected by StructureNotify require special handling. They look
Index: unix/tkUnixEvent.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixEvent.c,v
retrieving revision 1.28
diff -u -r1.28 tkUnixEvent.c
--- tk8.5.3/unix/tkUnixEvent.c	27 Apr 2008 22:39:13 -0000	1.28
+++ tk8.5.3/ unix/tkUnixEvent.c	28 Jul 2008 12:38:28 -0000
@@ -289,6 +289,14 @@
 
     while (QLength(display) > 0) {
 	XNextEvent(display, &event);
+#ifdef GenericEvent
+	if (event.type == GenericEvent) {
+	    xGenericEvent *xgePtr = (xGenericEvent *) &event;
+
+	    Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
+		    xgePtr->extension, xgePtr->evtype);
+	}
+#endif
 	if (event.type != KeyPress && event.type != KeyRelease) {
 	    if (XFilterEvent(&event, None)) {
 		continue;


Index: tk.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tk/devel/tk.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- tk.spec	29 Jul 2008 07:35:26 -0000	1.55
+++ tk.spec	4 Aug 2008 12:33:10 -0000	1.56
@@ -4,7 +4,7 @@
 Summary: The graphical toolkit for the Tcl scripting language
 Name: tk
 Version: %{vers}
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch:   1
 License: TCL
 Group: Development/Languages
@@ -23,7 +23,7 @@
 Provides: tile = 0.8.2
 Patch1: tk8.5-make.patch
 Patch2: tk8.5-conf.patch
-Patch3: tk-8.5.3-crash.patch
+Patch3: genericevent.patch
 
 %description
 When paired with the Tcl scripting language, Tk provides a fast and powerful
@@ -47,7 +47,7 @@
 
 %patch1 -p1 -b .make
 %patch2 -p1 -b .conf
-%patch3 -p1 -b .crash
+%patch3 -p1 -b .crash1
 
 %build
 cd unix
@@ -115,6 +115,10 @@
 %{_mandir}/man3/*
 
 %changelog
+* Mon Aug  4 2008 Marcela Maslanova <mmaslano at redhat.com> - 1:8.5.3-3
+- previous bug - remove my patch, add upstream patch
+- Problem is updated xorg, which changed behaviour of GenericEvent
+
 * Tue Jul 29 2008 Marcela Maslanova <mmaslano at redhat.com> - 1:8.5.3-2
 - fix 456922 - crash gitk resolved
 


--- tk-8.5.3-crash.patch DELETED ---




More information about the fedora-extras-commits mailing list