[gtk-vnc-devel] nevermind... my mod screwed up scaling...



I found out what I did that messed up the scaling in the widget. I was trying to get the widget to work properly when it's created and scaling is set during the gtk main loop, which, by the way, causes it to crash because the GL scaling expects the vncdisplay.c priv->image pointer to be valid. If it isn't, the program crashes. Suppose you create the widget in response to a user action, and set scaling immediately, then the program will crash. I was trying to make the program not crash, and in so doing screwed up scaling... but now I've found a happy medium by adding the following (in bold for those who support it):



static void rescale_display(VncDisplay *obj, gint width, gint height)
{
       VncDisplayPrivate *priv = obj->priv;

       if (*(priv->image || priv->gl_enabled) &&* priv->allow_scaling &&
           (priv->fb.height != width ||
            priv->fb.height != height))
               scale_display(obj, width, height);
       else if (priv->gl_enabled) {
               void *data;
               priv->gl_enabled = 0;
/* and so on */


Where I screwed up was I had only added the priv->image and didn't check to see if gl_enabled was set... That caused it to do some pretty odd stuff.

Regards,

Rob Stoddard
Telanetix




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]