GLX apps and 8.15

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GLX apps and 8.15

Richmond Mathewson via use-livecode
Hi, just decided to return to a project after a few months and launched it in 8.15rc2.
It bombed out into the debugger after launching the main stackfile.
The error is thrown from the glxapp_framework stack.
"on preopencard" to be exact.
After playing around it seems this handler throws an error whenever I change cards so it is not to do with a specific card but the window management in the GLX framework.
I tried this in both Indy and business version.
Before pulling my hair out as I tried to work out what I had done wrong I thought I would try previous builds of my app. Ones that I know worked before.
These too gave the same error.
So I tried previous LC releases.
The error only occurs in LC8.15rc1 or rc2.
LC8.14 works fine and the error is not thrown.

So something seems to have changed between 8.14 and 8.15 which is not liked by the GLX framework.

Has anyone else had this?
If so, have you fixed it?

James

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GLX apps and 8.15

Richmond Mathewson via use-livecode
Yes something _has_ changed.

https://github.com/livecode/livecode/pull/5456

The issue is really in GLX and can be fixed two ways:

Code your stack to handle all the GLX managed window messages or change the GLX ThrowError front script handler to something like this:

private command ThrowError pError
    ## used to throw errors that are not the result of ViewInitialize, viewOpen, etc. not being in the message path
    if pError is empty or \
         (item 1 of line 1 of pError is 573 and \
         (the number of lines of pError is 1 or \
         (the number of lines of pError is 2 and \
         item 1 of line 2 of pError is 241))) then
       exit ThrowError
   end if
   throw pError
end ThrowError

There’s probably more robust patches involving checking the handler name in item 4 of line 1 of the error string against the handler that was sent and not handled but the above should at least get people out of hot water.

Cheers

Monte

> On 27 Jun 2017, at 1:58 pm, james--- via use-livecode <[hidden email]> wrote:
>
> Hi, just decided to return to a project after a few months and launched it in 8.15rc2.
> It bombed out into the debugger after launching the main stackfile.
> The error is thrown from the glxapp_framework stack.
> "on preopencard" to be exact.
> After playing around it seems this handler throws an error whenever I change cards so it is not to do with a specific card but the window management in the GLX framework.
> I tried this in both Indy and business version.
> Before pulling my hair out as I tried to work out what I had done wrong I thought I would try previous builds of my app. Ones that I know worked before.
> These too gave the same error.
> So I tried previous LC releases.
> The error only occurs in LC8.15rc1 or rc2.
> LC8.14 works fine and the error is not thrown.
>
> So something seems to have changed between 8.14 and 8.15 which is not liked by the GLX framework.
>
> Has anyone else had this?
> If so, have you fixed it?
>
> James
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GLX apps and 8.15

Richmond Mathewson via use-livecode
On Mon, Jun 26, 2017 at 11:39 PM, Monte Goulding via use-livecode <
[hidden email]> wrote:

> Yes something _has_ changed.
>
> https://github.com/livecode/livecode/pull/5456
>
> The issue is really in GLX and can be fixed two ways:
>
> Code your stack to handle all the GLX managed window messages or change
> the GLX ThrowError front script handler to something like this:
>
> private command ThrowError pError
>     ## used to throw errors that are not the result of ViewInitialize,
> viewOpen, etc. not being in the message path
>     if pError is empty or \
>          (item 1 of line 1 of pError is 573 and \
>          (the number of lines of pError is 1 or \
>          (the number of lines of pError is 2 and \
>          item 1 of line 2 of pError is 241))) then
>        exit ThrowError
>    end if
>    throw pError
> end ThrowError
>
> There’s probably more robust patches involving checking the handler name
> in item 4 of line 1 of the error string against the handler that was sent
> and not handled but the above should at least get people out of hot water.
>

I think another solution would be to change all instances of `send` in the
glxappManagedEngineMessages frontscript to use `dispatch` instead. That way
no error will be throw if the handler isn't declared. For example, this
(around line 138):

```
try
    send "PreOpenView" && window_isCardInit() to the target
  catch e
    ThrowError e
  end TRY
```

can be changed to this:

```
   dispatch "PreOpenView" to the target with window_isCardInit()
```

--
Trevor DeVore
ScreenSteps
www.screensteps.com
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GLX apps and 8.15

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Hi Monte,

Thank you so much for that quick response and solution.

I modified the frontscript mainly because my knowledge of GLX's inner workings is limited.

Down the track I might venture into the window management routines (to see if I really need them) or even consider moving to Levure, although that might be a too big ask.

However would it be possible to spell out in a bit more detail why the mentioned pull request blew this up?

I would really like to know.


James




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GLX apps and 8.15

Richmond Mathewson via use-livecode

> On 27 Jun 2017, at 3:47 pm, James Hale via use-livecode <[hidden email]> wrote:
>
> However would it be possible to spell out in a bit more detail why the mentioned pull request blew this up?

The reason is because the send command first tries to send a message and if it’s not found it tries to do the message as a script snippet in the context of the target object. Previously errors in this second stage weren’t being kept on the error stack so the caller wasn’t notified correctly of the errors. Now they are but this change is a side effect in the specific case of a handler that isn’t found. Trevor is completely correct that dispatch is the better solution for this use case and I should have thought of that!

Cheers

Monte
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...