acidanthera / bugtracker

Acidanthera Bugtracker
385 stars 44 forks source link

Opencanopy: left click selection sometimes doesn't work - Custom theme - Because of transparent icons? #1679

Closed 82ghost82 closed 3 years ago

82ghost82 commented 3 years ago

I'm running opencore DBG-071-2021-06-09. I made a custom theme, following a screenshot with some icons: opencanopy

It happens that sometimes the left click of the mouse doesn't work, it seems it happens randomly, example: 1- boot to opencanopy 2- apple icon is preselected 3- single left click on reset NVRAM --> the selection stays on the apple icon

When I click on an icon and the selection doesn't work, if I click again and again and again in the same x,y the selection still doesn't work.

I noticed that this happens mostly with the nvram icon and with the recovery icon (attached). icons.zip

The icons have transparent area. I asked in the forum if the expected behavior is if the icon is clicked on a transparent area inside the icon, the icon is selected or not, answer was that in opencanopy the icon should be selected: and in fact sometimes, when I click on a transparent area the icon is selected.

Just to test, I replaced all the icons with square solid ones (a square 256x256@144 + 128x128@72), I booted into opencanopy, clicked one time on each icon several time, and the issue doesn't show (and I don't remember any issue with mouse click with the Acidanthera themes), so I suspect this may be due to icon transparency.

The driver I'm using for the mouse inside opencanopy is UsbMouseDxe.efi (I'm running mac os in qemu 6.0.0).

Andrey1970AppleLife commented 3 years ago

Your icons contain empty areas. Add opacity of 1% for empty areas.

82ghost82 commented 3 years ago

Please see the attached video which explains better the issue. Note that I changed the nvram icon by adding a transparent squared background: with that background I cannot reproduce the issue on the nvram icon. Increase the volume to hear the click of the mouse.

https://user-images.githubusercontent.com/18054052/121683639-f734e280-cabd-11eb-95f5-2d2b0b645932.mov

82ghost82 commented 3 years ago

Thanks Andrey! So there must be always some background, not 0% opacity, but even 1%?

Thank you

Andrey1970AppleLife commented 3 years ago

Yes, the click on a hole won't be accepted.

mikebeaton commented 3 years ago

Thanks for the bug report @82ghost82 - I worked with @mhaeuser to confirm that there was indeed a bug in click detection in transparent icons - the clickable parts were basically offset from where they should be. Your example icons were good at showing it up. https://github.com/acidanthera/OpenCorePkg/commit/02b994933c851211c623df503705fac70316e52c should resolve the problem.

mikebeaton commented 3 years ago

Btw, your icons should work fine without modification after the fix - as long as you don't expect them to accept clicks in the holes? That's a separate issue! Or rather, that bit is as intended. If you do want the inner holes clickable then yes, should should still add a tiny amount of opacity there as @Andrey1970AppleLife correctly stated. The bug fix ensures that the clicks or non-clicks will now be in the right place, rather than somewhat offset.

82ghost82 commented 3 years ago

Thanks @MikeBeaton and @mhaeuser I was going to reopen this, since I noticed that not detected clicks were in zones with opacity, but you were faster, as usual! Yes, there was something strange because the click detection wasn't working in an icon with 0% opacity in the middle, but with the click in a zone with opacity (see for example in the video, the latest clicks on the tools icon, which are in opacity zone but they aren't detected). I modified the icons but I have a backup of the old icons, I will try soon and report. I will use the opacity fix in the icons since I (we) want to have the clicks detected also in "holes", but I will try the old icons just to see if the fix is ok (I'm 100% sure it's fixed, but hey I have some spare time ahah). Thanks for the fix!

Update: perfect, I confirm clicks behave correctly after the fix.

Andrey1970AppleLife commented 3 years ago

Thanks for the bug report @82ghost82 - I worked with @mhaeuser to confirm that there was indeed a bug in click detection in transparent icons - the clickable parts were basically offset from where they should be. Your example icons were good at showing it up. acidanthera/OpenCorePkg@02b9949 should resolve the problem.

It not a bug, it was known initially @mhaeuser and @vit9696.

mhaeuser commented 3 years ago

@Andrey1970AppleLife It was a bug. There were two components, non-clickable transparency (expected), and displacement of the click position (bug).

mikebeaton commented 3 years ago

@82ghost82 - btw are your icons + background (I know it's only a blurred Big Sur background, but still!) downloadable? :)

82ghost82 commented 3 years ago

@MikeBeaton I did some modifications recently, squared pictures backgrounds, so to cover more resolutions, and all 1% opacity for fake transparent zone: did you mean this package or the oldest one? Anyway, here there is the latest package with default background at uiscale 1 1920px (width), and additional zip with other resolutions: Backgrounds-BigSurFlat.zip Opencanopy-BigSurFlat-Theme.zip

mikebeaton commented 3 years ago

Thx! We were trying to encourage people to make themes available - though obviously it's up to you. Idk if you already have a theme page, or if you put your work e.g. on InsanelyMac themes thread? (Or is it all a bit more low key than that?!)

82ghost82 commented 3 years ago

I posted it on insanelymac in the opencanopy icons thread, on macrumors and on another forum dedicated to virtual machines in libvirt+qemu where there's a quite active thread about optimization of "hackintosh" machines in qemu. On github also: https://github.com/82ghost82/BigSurFlat Thanks