membrane

Dan Maltbie 2021-10-19T03:39:39.146700Z

I tried running the membrane.example.todo/-main example and got the following error

Syntax error (UnsatisfiedLinkError) compiling at (membrane/skia.clj:582:5).
Error looking up function 'skia_font_metrics': /home/parallels/.cache/JNA/temp/jna502396494449745697.tmp: undefined symbol: skia_font_metrics
This was on branch 0.9.29.0-beta. The same code runs on branch 0.9.27.5-betabut the focus area for labels with :mouse-down event is extremely narrow and misaligned for rows below the first. Any suggestions for which version to use?

👀 1
phronmophobic 2021-10-19T03:40:57.147100Z

Let me take a look. one sec.

🙏 1
phronmophobic 2021-10-19T03:49:06.147800Z

what skialib dependency are you using?

Dan Maltbie 2021-10-26T22:43:21.002500Z

How can I observe the position of the focus point from repl? Is this in skia or somewhere else?

phronmophobic 2021-10-26T22:52:39.002700Z

what do you mean by focus point? Is that the component that is accepting key presses or something else?

Dan Maltbie 2021-10-27T00:46:53.002900Z

where the mouse arrow is pointing [x, y]

phronmophobic 2021-10-27T01:37:38.003200Z

It kinda depends on what you're trying to do. You can wrap your component in a :mouse-move event handler. For example:

(defn wrap-mouse-move [elem]
  ;; wrap to pass mouse-move events on to child components
  (ui/wrap-on
   :mouse-move
   (fn [handler pos]
     (prn "move: " pos)
     (handler pos))
   [;; mouse move only fires when on top of component
    ;; artifically make the component bigger
    (ui/spacer 600 600)
    elem]))
;; usage
(backend/run
  (constantly
   (wrap-mouse-move (ui/label "hi"))))

Dan Maltbie 2021-10-27T01:52:12.003400Z

Thanks! I'll try this out and see what it says.

Dan Maltbie 2021-10-19T20:37:53.154500Z

error in process sentinel: Could not start nREPL server: Could not find artifact com.phronemophobic.membrane:skialib-macosx-x86-64:jar:0.9.29.1-beta in central (https://repo1.maven.org/maven2/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-x86-64:jar:0.9.29.1-beta in clojars (https://repo.clojars.org/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-x86-64:jar:0.9.29.1-beta in sonatype-oss-public (https://oss.sonatype.org/content/groups/public/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-x86-64:jar:0.9.29.1-beta in space-maven (https://packages.jetbrains.team/maven/p/skija/maven) Could not find artifact com.phronemophobic.membrane:skialib-linux-x86-64:jar:0.9.29.1-beta in central (https://repo1.maven.org/maven2/) Could not find artifact com.phronemophobic.membrane:skialib-linux-x86-64:jar:0.9.29.1-beta in clojars (https://repo.clojars.org/) Could not find artifact com.phronemophobic.membrane:skialib-linux-x86-64:jar:0.9.29.1-beta in sonatype-oss-public (https://oss.sonatype.org/content/groups/public/) Could not find artifact com.phronemophobic.membrane:skialib-linux-x86-64:jar:0.9.29.1-beta in space-maven (https://packages.jetbrains.team/maven/p/skija/maven) Could not find artifact com.phronemophobic.membrane:skialib-macosx-aarch64:jar:0.9.29.1-beta in central (https://repo1.maven.org/maven2/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-aarch64:jar:0.9.29.1-beta in clojars (https://repo.clojars.org/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-aarch64:jar:0.9.29.1-beta in sonatype-oss-public (https://oss.sonatype.org/content/groups/public/) Could not find artifact com.phronemophobic.membrane:skialib-macosx-aarch64:jar:0.9.29.1-beta in space-maven (https://packages.jetbrains.team/maven/p/skija/maven) This could be due to a typo in :dependencies, file system permissions, or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.

phronmophobic 2021-10-19T20:46:35.154700Z

did you pull the latest? It should be referring to 0.9.30.0

Dan Maltbie 2021-10-19T21:18:10.154900Z

(defproject com.phronemophobic/membrane "0.9.30.0-beta"

phronmophobic 2021-10-19T21:20:35.155100Z

are you on git commit 7ece0c6717ad1e535804e94bd1b13c5320dd3f5a?

Dan Maltbie 2021-10-19T21:20:41.155400Z

:repositories {"sonatype-oss-public" ""
                  "space-maven" ""}

Dan Maltbie 2021-10-19T21:23:09.155600Z

not sure. This is what magit is showing for history:

7adcc2a * v0.9.30.0 release-1357578724 v0.9.30.0 Bumping version.
3c3087e * updating lein deps.
00bafb6 * adding glfw libs to skialib projects.
e33a678 * Bump version.
cd53c6b * fix images on java2d.

phronmophobic 2021-10-19T21:23:31.155800Z

yea, that's one commit behind

Dan Maltbie 2021-10-19T21:30:07.156Z

7ece0c6 * master membrane/master Updating lein skialib dependency version.

Dan Maltbie 2021-10-19T21:34:48.156200Z

Ok. Now I can get examples.todo/-main to display the window but I'm still seeing that the focus point is not congruent with the element (e.g., need to :mouse-down well above the checkbox).

phronmophobic 2021-10-19T21:36:34.156400Z

do you have a screenshot?

phronmophobic 2021-10-19T21:43:20.156600Z

I'm struggling to come up with a theory for why that might happen

Dan Maltbie 2021-10-19T21:44:01.156800Z

need to :mouse-down at exactly where the arrow-head points to change the checkbox for first

phronmophobic 2021-10-19T21:44:33.157200Z

are all the hitboxes messed up or just the checkboxes?

Dan Maltbie 2021-10-19T21:46:14.157400Z

All boxes. the first row button and textbox seem to work fine. It's as if all of the elements are starting from [0,n] instead of their top-left corner. I can try some of the other examples and see if I find a difference.

👍 1
Dan Maltbie 2021-10-22T13:00:59.001400Z

Test Results

# lein run -m membrane.example.kitchen-sink |& tee -a output.txt

## Common for all tests
*FAIL cursor focus geometry is off for all elements.
 The y-position is about 10 points too short (appears above area of interest).
 The x-position seems correct.
!no exception failures on any of the tests.
*anomaly in font size change

## textarea
ok
## button
ok
## scrollview
!ok
## textarea-light
ok
## checkbox
ok
## image
!ok
## label-using-default-font
ok
## label-using-specified-font
!ok
## label-using-specified-font-color
ok
## label-using-default-font-change-size
ok? font size didn't change
## layout-vertical
!ok (works as expected)
## rectangle-stroked
ok
## rectangle-specified-color
ok
## rectangle
ok
## rectangle-rounded-stroke
ok
## rectangle-rounded-specified-color
ok
## scissor-view
!ok
## with-image-scaling
!ok
## with-stroke
!ok

Dan Maltbie 2021-10-22T13:04:16.001600Z

Not sure how to isolate the focus point mis-alignment issue. Any suggestions? Build VM with minimal config? Other tests? Observe state with REPL?

phronmophobic 2021-10-21T19:06:10.000100Z

It's asking me to request access.

Dan Maltbie 2021-10-21T19:23:01.000300Z

I inadvertently deleted that folder. try this https://drive.google.com/drive/folders/11iNZBMcBF_10iAQc_2AKm-LKqW8u87Yf?usp=sharing.

phronmophobic 2021-10-21T19:36:45.000500Z

👍 . Ok cool. I see the problem now

phronmophobic 2021-10-21T19:46:21.000700Z

🙏 Thanks!

😁 1
phronmophobic 2021-10-21T22:44:35.001Z

ok, just pushed a new commit, 5475620, that shouldn't crash on any of the image related examples: • scissor-view • with-image-scaling • image • scrollview I'm still not sure why with-stroke would crash and I couldn't find the stack trace for that one. The label-with-specified-font still won't work. I have some general label fixes planned and I'll fix that at the same time. You can still pass the path to a font file to use a different font, but Menlo.ttc won't exist on linux. I'm still not sure why checkboxes would have nonsensical hitboxes.

Dan Maltbie 2021-10-21T23:17:39.001200Z

Thanks for the update!! I'll give it a spin later tonight.

Dan Maltbie 2021-10-20T07:00:24.157700Z

I am able to get example.todo to work but am seeing this error when I try other examples. Requires restart of the REPL to get todo to work again. I built a fresh Linux VM to try this test (ubuntu 20.04 + emacs + lein) and membrane master branch.

  Show: Project-Only All 
  Hide: Clojure Java REPL Tooling Duplicates  (13 frames hidden)

1. Unhandled java.lang.IllegalArgumentException
   No implementation of method: :put! of protocol:
   #'clojure.core.async.impl.protocols/WritePort found for class:
   clojure.core.async.impl.channels.ManyToManyChannel

          core_deftype.clj:  583  clojure.core/-cache-protocol-fn
          core_deftype.clj:  575  clojure.core/-cache-protocol-fn
             protocols.clj:   18  clojure.core.async.impl.protocols/eval24227/fn/G
                 async.clj:  143  clojure.core.async/>!!
                 async.clj:  138  clojure.core.async/>!!
                  skia.clj: 1749  membrane.skia/run-sync
                  skia.clj: 1706  membrane.skia/run-sync
                  skia.clj: 1740  membrane.skia/run-sync
                  skia.clj: 1706  membrane.skia/run-sync
          kitchen_sink.clj:  348  membrane.example.kitchen-sink/-main
          kitchen_sink.clj:  347  membrane.example.kitchen-sink/-main
               RestFn.java:  397  clojure.lang.RestFn/invoke
                      REPL:   53  membrane.example.kitchen-sink/eval51126
                      REPL:   53  membrane.example.kitchen-sink/eval51126
             Compiler.java: 7177  clojure.lang.Compiler/eval
             Compiler.java: 7132  clojure.lang.Compiler/eval
                  core.clj: 3216  clojure.core/eval
                  core.clj: 3212  clojure.core/eval
    interruptible_eval.clj:   82  nrepl.middleware.interruptible-eval/evaluate/fn/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  665  clojure.core/apply
                  core.clj: 1975  clojure.core/with-bindings*
                  core.clj: 1975  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   82  nrepl.middleware.interruptible-eval/evaluate/fn
                  main.clj:  437  clojure.main/repl/read-eval-print/fn
                  main.clj:  437  clojure.main/repl/read-eval-print
                  main.clj:  458  clojure.main/repl/fn
                  main.clj:  458  clojure.main/repl
                  main.clj:  368  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   79  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   56  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  145  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  202  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  201  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  829  java.lang.Thread/run

Dan Maltbie 2021-10-20T07:02:00.157900Z

Also, when I load an example into REPL, there is a long delay (15 seconds) with spinning busy wheel cursor.

phronmophobic 2021-10-20T07:07:59.158200Z

that error seems pretty bizarre. how are you running the example?

phronmophobic 2021-10-20T07:12:37.158400Z

The kitchen sink example uses the same function ( membrane.skia/run-sync) to start the UI as the todo example

phronmophobic 2021-10-20T07:13:58.158600Z

If you run the commands as listed in the https://github.com/phronmophobic/membrane/blob/master/src/membrane/example/README.md, does that work?

phronmophobic 2021-10-20T07:16:48.158800Z

for example, lein run -m membrane.example.kitchen-sink

Dan Maltbie 2021-10-20T17:36:36.159Z

my results from running this command

lein run -m membrane.example.kitchen-sink |& tee -a stack-trace
## textarea ok ## button ok ## scrollview FAIL {crash on select} - stack-trace: testing/scrollview-fail-1
Oct 20, 2021 10:09:54 AM com.sun.jna.Native$1 uncaughtException
   WARNING: JNA: Callback membrane.skia.MouseButtonCallback@62e2fc61 threw the following exception
   java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
## textarea-light ok ## checkbox ok ## image FAIL {crash on select} - stack-trace: testing/image-fail-1
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
## label-using-default-font ok ## label-using-specified-font FAIL {font Menlo.tcc missing} ## label-using-specified-font-color ok ## label-using-default-font-change-size ok ## layout-vertical FAIL {checkbox does not respond to :mouse-down} ## rectangle-stroked ok ## rectangle-specified-color ok ## rectangle ok ## rectangle-rounded-stroke ok ## rectangle-rounded-specified-color ok ## scissor-view FAIL {crash on select} - stack-trace: testing/scissor-view-fail-1
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
## with-image-scaling FAIL {crash on select}
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
## with-stroke
## with-stroke FAIL {crash on select}
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so

phronmophobic 2021-10-20T17:48:35.159400Z

interesting

phronmophobic 2021-10-20T17:51:05.159600Z

> layout-vertical That example isn't supposed to respond to events

✅ 1
phronmophobic 2021-10-20T17:51:55.159800Z

it seems weird that it would attempt to load libawt_xawt.so

phronmophobic 2021-10-20T17:53:40.160Z

is there more to the stack trace?

phronmophobic 2021-10-20T17:54:37.160200Z

sometimes it creates a log that looks like hs_err_pid36675.log

Dan Maltbie 2021-10-20T20:29:04.160400Z

I saved the stacktrace. Didn't want to clog the slack channel with it. I will post a link to it shortly.

phronmophobic 2021-10-20T20:33:41.160700Z

Thanks!

Dan Maltbie 2021-10-20T20:48:42.160900Z

here's the link to https://drive.google.com/file/d/1H3HmJBLIWxii7sXu-Xk3KlTAzwEl1K3H/view?usp=sharing

phronmophobic 2021-10-24T20:07:28.002300Z

Yea, the best way to debug would be to observe the state with repl. If you I could reproduce it locally, it wouldn't be too hard to figure out the issue with a few simple tests. It's a little more difficult trying to isolate the issue from afar

Dan Maltbie 2021-10-19T03:56:54.149900Z

I'm running with lein

Dan Maltbie 2021-10-19T03:58:00.150100Z

I look in the project.clj file for membrane 0.9.29.0-beta and it has

;; skia
[com.phronemophobic.membrane/skialib-macosx "0.9.27-beta"]
[com.phronemophobic.membrane/skialib-linux "0.9.27-beta"]

Dan Maltbie 2021-10-19T03:58:25.150300Z

or is somewhere else?

phronmophobic 2021-10-19T03:58:32.150500Z

yea

phronmophobic 2021-10-19T03:58:36.150700Z

those would need to be updated

Dan Maltbie 2021-10-19T03:58:54.150900Z

got it. let me try it.

phronmophobic 2021-10-19T03:58:57.151100Z

I switched over to the clojure cli at some point and haven't been keeping lein up to date

phronmophobic 2021-10-19T03:59:23.151300Z

the dependency name has also changed to include the architecture (eg. aarch64, x86-64)

phronmophobic 2021-10-19T03:59:44.151500Z

;; one of
[com.phronemophobic.membrane/skialib-macosx-x86-64 "0.9.29.0-beta"]
[com.phronemophobic.membrane/skialib-linux-x86-64 "0.9.29.0-beta"]
[com.phronemophobic.membrane/skialib-macosx-aarch64 "0.9.29.0-beta"]

phronmophobic 2021-10-19T04:00:02.151700Z

you can just include all 3 and nothing bad will happen

👍 1
phronmophobic 2021-10-19T04:02:05.152100Z

> the focus area for labels with :mouse-down event is extremely narrow and misaligned for rows below the first. I'm not sure what is causing that. Do you have a screenshot? Which OS are you running?

Dan Maltbie 2021-10-19T04:02:49.152300Z

got this error
Execution error (AssertionError) at membrane.skia/run-sync (skia.clj:1746).
Assert failed: Could not run because glfw could not be loaded.

Dan Maltbie 2021-10-19T04:04:17.152500Z

## java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
## lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename: focal ## uname -a
Linux parallels 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
## Parallels
17.0.1 Pro Edition

Dan Maltbie 2021-10-19T04:05:08.152700Z

project.clj has

[org.lwjgl/lwjgl "3.2.3"]
[org.lwjgl/lwjgl "3.2.3" :classifier "natives-macos"]
[org.lwjgl/lwjgl-glfw "3.2.3"]
[org.lwjgl/lwjgl-glfw "3.2.3"  :classifier "natives-macos"]
[org.lwjgl/lwjgl-opengl "3.2.3"]
[org.lwjgl/lwjgl-opengl "3.2.3"  :classifier "natives-macos"]]}}

phronmophobic 2021-10-19T04:06:05.152900Z

yea, I'm seeing the same error when I run with lein as well

phronmophobic 2021-10-19T04:07:30.153100Z

hmm, it might actually be particular skialib version. It's the first version I uploaded via github CI 😳

Dan Maltbie 2021-10-19T04:07:50.153300Z

I've got to crash for the night, but I'm happy to run more tests tomorrow if that would be of help.

phronmophobic 2021-10-19T04:08:22.153500Z

ah. I see the issue. I forgot to include glfw

😋 1
phronmophobic 2021-10-19T04:08:48.153700Z

Sorry about that. I'll fix that tonight. Have a good night. Thanks for giving it a shot.

Dan Maltbie 2021-10-19T04:09:48.154Z

I really want to use your library, so willing to put in some extra to get it to work. --later.

🙏 1
phronmophobic 2021-10-19T04:26:32.154300Z

I think it should work now.

phronmophobic 2021-10-19T03:49:51.148700Z

I split up the dependency on skia+glfw since not everyone will want to use the skia backend, but I haven't updated the docs yet to reflect that dependency change

phronmophobic 2021-10-19T03:51:29.149400Z

you'll need one of: • com.phronemophobic.membrane/skialib-linux-x86-64 {:mvn/version "0.9.29.0-beta"}com.phronemophobic.membrane/skialib-macosx-aarch64 {:mvn/version "0.9.29.0-beta"}com.phronemophobic.membrane/skialib-macosx-x86-64 {:mvn/version "0.9.29.0-beta"}

phronmophobic 2021-10-19T03:56:14.149700Z

are you running the code via the clojure cli or lein?