Update of /cvsroot/xine/xine-ui/src/xitk/xine-toolkit
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7046

Modified Files:
        xitk.c 
Log Message:
ConfigureNotify handler:
  Call Xlib functions only if really needed for callback. This also fixes the
  BadWindow error upon fullscreen toggle, worked around in r1.152: The video
  window has no related callback; the error occurred because the event handler,
  and so the fx, for the previous video window is kept beyond destroying it
  (in order to not loose pending events).
Event handler loop:
  Moved getting next fx before eventually destroying current fx, as destroying
  advances itself to next fx (unless it's the last, see list.c); otherwise,
  next fx would be skipped.


Index: xitk.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/xitk.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -r1.156 -r1.157
--- xitk.c      1 Nov 2006 01:06:03 -0000       1.156
+++ xitk.c      22 Nov 2006 23:33:26 -0000      1.157
@@ -1183,7 +1183,6 @@
        *key = 0; 
        
        __fx_destroy(fx, 1);
-       fx = NULL;
        MUTUNLOCK();
        return;
       }
@@ -1255,7 +1254,7 @@
  * at register time, it will be called.
  */
 void xitk_xevent_notify(XEvent *event) {
-  __gfx_t  *fx;
+  __gfx_t  *fx, *fxd;
      
   if(!(fx = (__gfx_t *) xitk_list_first_content(gXitk->gfx)))
     return;
@@ -1508,10 +1507,8 @@
            }
          }
          
-         if(fx->destroy) {
+         if(fx->destroy)
            __fx_destroy(fx, 0);
-           fx = NULL;
-         }
          else
            FXUNLOCK(fx);
 
@@ -1697,7 +1694,6 @@
        case ConfigureNotify: {
          XWindowAttributes wattr;
          Status            err;
-         int               xerr;
 
          if(fx->widget_list && fx->widget_list->l) {
            xitk_widget_t *w = (xitk_widget_t *) 
xitk_list_first_content(fx->widget_list->l);
@@ -1710,21 +1706,21 @@
            }
          }
 
-         XLOCK(gXitk->display);
-         xerr = xitk_install_x_error_handler();
-         err = XGetWindowAttributes(gXitk->display, fx->window, &wattr);
-         if (xerr) xitk_uninstall_x_error_handler();
-         XUNLOCK(gXitk->display);
-
-         if(err != BadDrawable && err != BadWindow) {
-           fx->width = wattr.width;
-           fx->height = wattr.height;
-         }
          /* Inform application about window movement. */
-         if(fx->newpos_callback)
+         if(fx->newpos_callback) {
+
+           XLOCK(gXitk->display);
+           err = XGetWindowAttributes(gXitk->display, fx->window, &wattr);
+           XUNLOCK(gXitk->display);
+
+           if(err != BadDrawable && err != BadWindow) {
+             fx->width = wattr.width;
+             fx->height = wattr.height;
+           }
            fx->newpos_callback(event->xconfigure.x,
                                event->xconfigure.y,
                                fx->width, fx->height);
+         }
        }
        break;
 
@@ -1741,16 +1737,16 @@
       }
     }
     
-    if(fx->destroy) {
-      __fx_destroy(fx, 0);
-      fx = NULL;
-    }
+    fxd = fx;
+    fx = (__gfx_t *) xitk_list_next_content(gXitk->gfx);
+
+    if(fxd->destroy)
+      __fx_destroy(fxd, 0);
     else
-      FXUNLOCK(fx);
+      FXUNLOCK(fxd);
     
 #warning FIXME
     if(gXitk->modalw != None) {
-      fx = (__gfx_t *) xitk_list_next_content(gXitk->gfx);
 
       /* Flush remain fxs */
       while(fx && (fx->window != gXitk->modalw)) {
@@ -1759,19 +1755,18 @@
        if(fx->xevent_callback && (fx->window != None && event->type != 
KeyRelease))
          fx->xevent_callback(event, fx->user_data);
        
-       if(fx->destroy) {
-         __fx_destroy(fx, 0);
-         fx = NULL;
-       }
-       else
-         FXUNLOCK(fx);
-       
+       fxd = fx;
        fx = (__gfx_t *) xitk_list_next_content(gXitk->gfx);
+
+       if(fxd->destroy)
+         __fx_destroy(fxd, 0);
+       else
+         FXUNLOCK(fxd);
       }
       return;
     }
 
-    if((fx = (__gfx_t *) xitk_list_next_content(gXitk->gfx)))
+    if(fx)
       FXLOCK(fx);
   }
 }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to