rpms/plib/devel plib-1.8.4-autorepeat.patch, NONE, 1.1 plib.spec, 1.15, 1.16

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Fri Oct 6 14:23:17 UTC 2006


Author: jwrdegoede

Update of /cvs/extras/rpms/plib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1141

Modified Files:
	plib.spec 
Added Files:
	plib-1.8.4-autorepeat.patch 
Log Message:
* Fri Oct  6 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 1.8.4-8
- Fix keypresses sometimes getting lost by alternative (better) keyboard
  autorepeat support
- Cleanup specfile


plib-1.8.4-autorepeat.patch:

--- NEW FILE plib-1.8.4-autorepeat.patch ---
--- plib-1.8.4/src/pw/pwX11.cxx.key	2006-10-05 19:56:42.000000000 +0200
+++ plib-1.8.4/src/pw/pwX11.cxx	2006-10-05 20:04:19.000000000 +0200
@@ -117,11 +117,19 @@
 static XTextProperty *titlePropertyPtr = NULL;
 
 static bool autoRepeat = false ;
+static bool haveFocus = false ;
 
 static void getEvents ();
 
 void pwSetAutoRepeatKey ( bool enable )
 {
+  if ( (autoRepeat != enable) && haveFocus )
+  {
+    if ( enable )
+      XAutoRepeatOn ( currDisplay ) ;
+    else
+      XAutoRepeatOff ( currDisplay ) ;
+  }
   autoRepeat = enable ;
 }
 
@@ -351,7 +359,7 @@
                        KeyPressMask        | KeyReleaseMask       |
 		       EnterWindowMask     | LeaveWindowMask      |
                        PointerMotionMask   | ButtonMotionMask     |
-                       VisibilityChangeMask ;
+                       VisibilityChangeMask| FocusChangeMask;
 
   attribs.background_pixmap = None ;
   attribs.background_pixel  = 0    ;
@@ -405,6 +413,10 @@
   XMapWindow       ( currDisplay, wmWindow ) ;
   glXMakeCurrent   ( currDisplay, currHandle, currContext ) ;
 
+  haveFocus = true;
+  if (!autoRepeat)
+    XAutoRepeatOff ( currDisplay ) ;
+
   pwSetCursor ( PW_CURSOR_LEFT ) ;
 
 #ifdef GL_MULTISAMPLE_FILTER_HINT_NV
@@ -717,8 +729,6 @@
 
 static void getEvents ()
 {
-  bool repeating = false ;
-  char keyflags [ 32 ] ;
   XEvent event ;
 
   insideCallback = true ;
@@ -770,6 +780,18 @@
           (*mpCB) ( event.xmotion.x, event.xmotion.y ) ;
         break ;
 
+      case FocusIn:
+        if ( !haveFocus && !autoRepeat )
+          XAutoRepeatOff ( currDisplay ) ;
+        haveFocus = true;
+        break;
+
+      case FocusOut:
+        if ( haveFocus && !autoRepeat )
+          XAutoRepeatOn ( currDisplay ) ;
+        haveFocus = false;
+        break;
+
       case ButtonRelease   :
         updown = PW_UP ;
         /* FALLTHROUGH */
@@ -792,23 +814,9 @@
 
       case KeyRelease      :
         updown = PW_UP ;
-
-        XQueryKeymap ( currDisplay, keyflags ) ;
-
-        repeating = ( ( keyflags [ event.xkey.keycode >> 3 ] &
-                          ( 1 << ( event.xkey.keycode & 7 ) ) ) != 0 ) ;
-
         /* FALLTHROUGH */
 
       case KeyPress        :
-        /*
-          Only generate a key up callback if the key is actually up
-          and not repeating.
-        */
-
-        if ( ! autoRepeat && repeating )
-          break ;
-
         XComposeStatus composeStatus ;
         char           asciiCode [ 32 ] ;
         KeySym         keySym ;
@@ -1021,10 +1029,14 @@
   if ( fsWindow != None )
     pwSetWindowed ( ) ;
 
+  if ( haveFocus && !autoRepeat )
+    XAutoRepeatOn ( currDisplay ) ;
+
   glXDestroyContext ( currDisplay, currContext ) ;
   XDestroyWindow    ( currDisplay, currHandle  ) ;
   XDestroyWindow    ( currDisplay, wmWindow    ) ;
   XCloseDisplay     ( currDisplay ) ;
+  haveFocus = false;
   currDisplay = NULL;
 }
 


Index: plib.spec
===================================================================
RCS file: /cvs/extras/rpms/plib/devel/plib.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- plib.spec	29 Aug 2006 05:58:00 -0000	1.15
+++ plib.spec	6 Oct 2006 14:23:16 -0000	1.16
@@ -1,18 +1,18 @@
-Summary: Set of portable libraries especially useful for games
-Name: plib
-Version: 1.8.4
-Release: 7%{?dist}
-License: LGPL
-Group: System Environment/Libraries
-URL: http://plib.sourceforge.net/
-Source: http://plib.sourceforge.net/dist/plib-%{version}.tar.gz
-Patch0: plib-1.8.4-extraqualif.patch
-Patch1: plib-1.8.4-fullscreen.patch
-Patch2: plib-1.8.4-js.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: gcc-c++, freeglut-devel, libpng-devel
-BuildRequires: libXext-devel, libXi-devel, libXmu-devel, libSM-devel
-Buildrequires: libXxf86vm-devel libXt-devel
+Name:           plib
+Version:        1.8.4
+Release:        8%{?dist}
+Summary:        Set of portable libraries especially useful for games
+Group:          System Environment/Libraries
+License:        LGPL
+URL:            http://plib.sourceforge.net/
+Source:         http://plib.sourceforge.net/dist/plib-%{version}.tar.gz
+Patch0:         plib-1.8.4-extraqualif.patch
+Patch1:         plib-1.8.4-fullscreen.patch
+Patch2:         plib-1.8.4-js.patch
+Patch3:         plib-1.8.4-autorepeat.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires:  freeglut-devel libpng-devel libXext-devel libXi-devel
+Buildrequires:  libXmu-devel libSM-devel libXxf86vm-devel
 
 %description
 This is a set of OpenSource (LGPL) libraries that will permit programmers
@@ -23,10 +23,10 @@
 
 
 %package devel
-Summary: Set of portable libraries especially useful for games
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-Requires: libGL-devel
+Summary:        Development files for %{name}
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+Requires:       libGL-devel
 
 %description devel
 This package contains the header files and libraries needed to write
@@ -38,13 +38,14 @@
 %patch0 -p1 -b .extraqualif
 %patch1 -p1 -b .fs
 %patch2 -p1 -b .js
+%patch3 -p1 -b .autorepeat
 # for some reason this file has its x permission sets, which makes rpmlint cry
 chmod -x src/sg/sgdIsect.cxx
 
 
 %build
-%configure CXXFLAGS="%{optflags} -fPIC -DXF86VIDMODE"
-%{__make} %{?_smp_mflags} 
+%configure CXXFLAGS="$RPM_OPT_FLAGS -fPIC -DXF86VIDMODE"
+make %{?_smp_mflags} 
 # and below is a somewhat dirty hack inspired by debian to build shared libs
 # instead of static. Notice that the adding of -fPIC to CXXFLAGS above is part
 # of the hack.
@@ -75,16 +76,16 @@
 
 
 %install
-%{__rm} -rf %{buildroot}
-%{__make} install DESTDIR=%{buildroot}
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
 # we don't want the static libs
-%{__rm} %{buildroot}%{_libdir}/*.a
+rm $RPM_BUILD_ROOT%{_libdir}/*.a
 # instead do a DIY install of the shared libs we created
-%{__cp} -a `find . -name "libplib*.so*"` %{buildroot}%{_libdir}
+cp -a `find . -name "libplib*.so*"` $RPM_BUILD_ROOT%{_libdir}
 
 
 %clean
-%{__rm} -rf %{buildroot}
+rm -rf $RPM_BUILD_ROOT
 
 
 %post -p /sbin/ldconfig
@@ -93,17 +94,22 @@
 
 
 %files
-%defattr(-, root, root, -)
+%defattr(-,root,root,-)
 %doc AUTHORS COPYING ChangeLog NOTICE README
 %{_libdir}/libplib*.so.%{version}
 
 %files devel
-%defattr(-, root, root, -)
+%defattr(-,root,root,-)
 %{_includedir}/*
 %{_libdir}/libplib*.so
 
 
 %changelog
+* Fri Oct  6 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 1.8.4-8
+- Fix keypresses sometimes getting lost by alternative (better) keyboard
+  autorepeat support
+- Cleanup specfile
+
 * Tue Aug 29 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 1.8.4-7
 - FE6 Rebuild
 




More information about the scm-commits mailing list