thdwb icon indicating copy to clipboard operation
thdwb copied to clipboard

Epileptic bug on MacOS

Open ronangaillard opened this issue 3 years ago • 9 comments

I cloned your project and run make and I was left with this epileptic bug :

Apr-20-2021 12-23-23

Maybe this has something to do with high DPI screens ?

Commit I used : 532f88c

System info :

image

ronangaillard avatar Apr 20 '21 10:04 ronangaillard

I was seeing a similar issue in Linux/X11 with an intel card.

I changed the hi-dpi value in settings.json to false, and was able to avoid the issue.

  "hiDPI": false,

equalsraf avatar Apr 20 '21 12:04 equalsraf

Screen Shot 1442-09-09 at 6 03 27 PANGERAN

my settings.json:

{
  "homepage":"thdwb://homepage/",
  "windowWidth": 1600,
  "windowHeight": 900,

  "hiDPI": false,

  "experimentalHTML": false,
  "experimentalLayout": false
}

dyaskur avatar Apr 20 '21 23:04 dyaskur

Also got this issue on Mac OS.

"hiDPI": false makes the window a little larger but still a small portion of the total window size.

montyanderson avatar Apr 21 '21 01:04 montyanderson

At least on MacOS it seems that when using hiDPI the scale is reversed. I.e. in https://github.com/danfragoso/thdwb/blob/master/mustard/window.go#L35:

window := &Window{ title: title, width: int(float32(width) / xscale), height: int(float32(height) / yscale), hiDPI: hiDPI, it should really be:

width: int(float32(width) * xscale), height: int(float32(height) * yscale),

That makes the window content fill the window (but then it goes back to small with flicker on resize, so I think the same needs to be done wherever the window resize code is).

raff avatar Apr 22 '21 04:04 raff

I got this issue on Mac OS, too.

bigwhite avatar Apr 22 '21 05:04 bigwhite

@raff That seems plausible for the scale issue. The resize callback is here: https://github.com/danfragoso/thdwb/blob/master/mustard/window.go#L139 I pushed the fix to my branch if anyone cares to try it? https://github.com/ajzaff/thdwb/tree/feature-content-scale-23

FWIW hiDPI did not work well on my chromebook even with my fix.

ajzaff avatar Apr 27 '21 16:04 ajzaff

Hi, sorry for the delay, I've been really busy with work this couple of weeks. I fixed the scaling issue on linux with commit 088ec74, can you guys try it again?

@ronangaillard @dyaskur @montyanderson @raff @bigwhite @ajzaff

danfragoso avatar Apr 27 '21 19:04 danfragoso

On my mac still has same result

Screen Shot 1442-09-16 at 2 29 18 PANGERAN

dyaskur avatar Apr 27 '21 19:04 dyaskur

@dyaskur, if you applied https://github.com/ajzaff/thdwb/tree/feature-content-scale-23, make sure you have hiDPI=true in settings.json.

The fix is still not perfect (on resizes there are cases depending on the window size where the screen goes white) but mostly works.

raff avatar Apr 27 '21 20:04 raff