[AD] X11 locking

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I guess I could just read the SF archives, but I don't like the web-
interface much, so I'm just asking here :) Why do we need the _xwin_lock
and _xwin_unlock functions? I get freezes in some of my programs which
work with 4.1.15 - if I replace _xwin_lock/unlock with XLOCK/XUNLOCK,
they work again (didn't investigate much yet - but if there's no reason
the change was made, I suggest undoing it). Maybe this also fixes the
multi-processor issues in X11 that were mentioned (just guessing, as I
said, I didn't investigate anything yet - want to know the reasons for
the change first).

Oh, and while going therough some patches, is the change in xwin.c below
correct?

@@ -2578,32 +2566,33 @@ int _xwin_scroll_screen(int x, int y)
  */
 static void _xwin_private_update_screen(int x, int y, int w, int h)
 {
-   /* Clip updated region.  */
-   if (x >= _xwin.virtual_width)
-      return;
-   if (x < 0) {
-      w += x;
-      x = 0;
-   }
-   if (w >= (_xwin.virtual_width - x))
-      w = _xwin.virtual_width - x;
-   if (w <= 0)
-      return;
-
-   if (y >= _xwin.virtual_height)
-      return;
-   if (y < 0) {
-      h += y;
-      y = 0;
-   }
-   if (h >= (_xwin.virtual_height - y))
-      h = _xwin.virtual_height - y;
-   if (h <= 0)
-      return;
-
    /* Update frame buffer with screen contents.  */
-   if (_xwin.screen_to_buffer != 0)
+   if (_xwin.screen_to_buffer != 0) {
+      /* Clip updated region.  */
+      if (x >= _xwin.virtual_width)
+	 return;
+      if (x < 0) {
+	 w += x;
+	 x = 0;
+      }
+      if (w >= (_xwin.virtual_width - x))
+	 w = _xwin.virtual_width - x;
+      if (w <= 0)
+	 return;
+
+      if (y >= _xwin.virtual_height)
+	 return;
+      if (y < 0) {
+	 h += y;
+	 y = 0;
+      }
+      if (h >= (_xwin.virtual_height - y))
+	 h = _xwin.virtual_height - y;
+      if (h <= 0)
+	 return;
+
       (*(_xwin.screen_to_buffer))(x, y, w, h);
+   }
 
    /* Update window.  */
    (*_xwin_window_redrawer)(x - _xwin.scroll_x, y - _xwin.scroll_y, w,
h);

To me it seems, it now causes a call to (*_xwin_window_redrawer) even if
it should have been clipped away. (I don't know what
_xwin.screen_to_buffer does and why the change was made though, so it
may be right. It just looked strange..)

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/