[xiph-cvs] cvs commit: snatch libsnatch.c x11.c

Monty xiphmont at xiph.org
Mon Nov 5 00:49:55 PST 2001



xiphmont    01/11/05 00:49:54

  Modified:    .        libsnatch.c x11.c
  Log:
  Grrrr.  RealPlayer's XEvent handling is unstable.
  Non-well-definedness mean sending a character to a stray focus that
  hasn't fully initialized yet == boom.

Revision  Changes    Path
1.5       +0 -2      snatch/libsnatch.c

Index: libsnatch.c
===================================================================
RCS file: /usr/local/cvsroot/snatch/libsnatch.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- libsnatch.c	2001/11/05 05:39:38	1.4
+++ libsnatch.c	2001/11/05 08:49:54	1.5
@@ -583,8 +583,6 @@
 }
 
 ssize_t write(int fd, const void *buf,size_t count){
-  initialize();
-
   if(fd==X_fd){
     ProcessBuffer(&clientCS,(void *)buf,count,DataToServer);
     return(count);

1.7       +14 -15    snatch/x11.c

Index: x11.c
===================================================================
RCS file: /usr/local/cvsroot/snatch/x11.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- x11.c	2001/11/05 07:04:08	1.6
+++ x11.c	2001/11/05 08:49:54	1.7
@@ -92,15 +92,19 @@
 
   XSendEvent(Xdisplay,(Window)window,0,0,(XEvent *)&event);
 
-  event.type=3; /* key up */
+  /* Don't send the keyups; RP doesn't care and a 'return' or 'space'
+     can close a window... resulting in sending a keyup to a drawable
+     that doesn't exist. */
 
-  XSendEvent(Xdisplay,(Window)window,0,0,(XEvent *)&event);
+  //event.type=3; /* key up */
+
+  //XSendEvent(Xdisplay,(Window)window,0,0,(XEvent *)&event);
 
 }
 
 static void FakeKeySym(int keysym, int modmask, unsigned long window){
   KeyCode c=XKeysymToKeycode(Xdisplay,keysym);
-  
+
   if(XKeycodeToKeysym(Xdisplay,c,0)==keysym){
     FakeKeycode(c,modmask,window);
   }else{
@@ -111,18 +115,7 @@
 
 void FakeButton1(unsigned long window){
   XButtonEvent event;
-  XCrossingEvent enter;
 
-  memset(&enter,0,sizeof(enter));
-  enter.type=7;
-  enter.display=Xdisplay;
-  enter.window=window;
-  enter.root=root_window;
-  enter.mode=0;
-  enter.detail=3;
-  enter.same_screen=1;
-  XSendEvent(Xdisplay,(Window)window,0,0,(XEvent *)&enter);
-
   memset(&event,0,sizeof(event));
   event.display=Xdisplay;
   event.type=4; /* button down */
@@ -212,7 +205,13 @@
 
   if(location)
     FakeTypeString(location,rploc_entry);
-  FakeTypeString(" ",rploc_ok);
+  fprintf(stderr,"rploc_ok %lx\n",rploc_ok);
+  
+
+  FakeKeySym(XStringToKeysym("Tab"),0,rploc_ok);
+  FakeKeySym(XStringToKeysym("space"),0,rploc_ok);
+
+  //FakeTypeString(" ",rploc_ok);
 
   rploc_shell=0;
   rploc_main=0;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list