deno-windowing / dwm

Deno Window Manager: Cross-platform window creation and management
https://deno.land/x/dwm
Apache License 2.0
155 stars 11 forks source link

getPrimaryMonitor not found #10

Closed nhrones closed 1 year ago

nhrones commented 1 year ago

Seems to be a problem with "https://deno.land/x/dwm@0.1.0/mod.ts";

dwm repo mod.ts seems not === x/dwm@0.1.0/mod.ts

Can't run cube demo with it.

error "https://deno.land/x/dwm@0.1.0/mod.ts"' has no exported member 'getPrimaryMonitor'

see simple repo below

https://github.com/nhrones/BrokenCube

I need this to test retina pixelRatio issue!

DjDeveloperr commented 1 year ago

It was not in 0.1.0 but now in 0.2.0. Try that version instead.

nhrones commented 1 year ago

That created a new error.

//deps.ts

export * from "https://deno.land/x/dwm@0.2.0/mod.ts"
export * from "https://deno.land/x/skia_canvas@0.4.1/mod.ts";

Error: Module "https://deno.land/x/dwm@0.2.0/mod.ts" has already exported a member named 'Rect'. Consider explicitly re-exporting to resolve the ambiguity.deno-ts(2308)

nhrones commented 1 year ago

I tried updating to https://deno.land/x/skia_canvas@0.5.0/mod.ts, and that has broken everything in all my DWM apps and widgets? Chasing down why right now. I'll let you know.

Are there min ver requirements for this set of libs to run with?

DjDeveloperr commented 1 year ago

Well yeah can’t export everything from both deps since they both have separate Rect interfaces.

And what exactly has broken? Can you send some code and errors?

No min version requirements right now but you should try to run on latest version until it is stabilized.

nhrones commented 1 year ago

Fixed. I have a deps.ts with

export * from "https://deno.land/x/dwm@0.2.0/mod.ts"
export * from "https://deno.land/x/skia_canvas@0.5.0/mod.ts"
export type {Rect} from "https://deno.land/x/skia_canvas@0.5.0/mod.ts"

and in another file I had referenced import * from "https://deno.land/x/skia_canvas@0.4.1/mod.ts" directly instead of from deps. All working now, and I get the monitor correctly. Thanks. I'll send you a link to a repo with a quick retina test.