[ctwm] [rt.lp.se #135] Bugfix for ctwm

From: tim.edwards_at_multigig.com via RT <tim.edwards_at_multigig.com>
Date: Thu, 10 Jul 2008 19:21:40 +0200

Dear Richard,

   I encountered an integer overflow error in ctwm when using it on a
rather large 30" display (nice display, though!). The error is in
the calculation of the OpaqueResizeThreshold boundary. For large
root window sizes, Scr->rootw * Scr->rooth * Scr->OpaqueResizeThreshold
overflows a 32 bit signed integer. This could be solved in a number of
ways; I took the simple step of balancing the equation so that neither
side multiplies three numbers together.

ctwm-3.8a, file menus.c, lines 2322 and following:

        if (tmp_win->OpaqueResize) {
            int sw, ss;

            sw = tmp_win->frame_width * tmp_win->frame_height;
            ss = Scr->rootw * Scr->rooth;
            if ((sw / Scr->OpaqueResizeThreshold) > (ss / 100))
                Scr->OpaqueResize = FALSE;
            else
                Scr->OpaqueResize = TRUE;
        }

Making sw and ss (unsigned int) would also give some extra margin.
Thanks for maintaining ctwm!
By the way, I've been playing around recently with the "freetype"
font rendering in X11. Would you like a ctwm patch for antialiased
freetype fonts?

                                        Regards,
                                        Tim

+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim) | email: tim.edwards_at_multigig.com |
| MultiGiG, Inc. | web: http://www.multigig.com |
| 100 Enterprise Way, Suite A-3 | phone: (831) 621-3283 |
| Scotts Valley, CA 95066 | cell: (240) 401-0616 |
+--------------------------------+-------------------------------------+
Received on Thu Jul 10 2008 - 19:21:48 CEST

This archive was generated by hypermail 2.2.0 : Wed Sep 03 2008 - 06:45:01 CEST