antfu / broz

A simple, frameless browser for screenshots
842 stars 28 forks source link

win10 drag-dot no hover style #6

Open alexanderniebuhr opened 3 years ago

alexanderniebuhr commented 3 years ago

since setting frameless for win10 is require, all elements with -webkit-app-region:drag;, will not receive any mouse events. :hover styles do not work.

have to find a solution sometime. just add this as tracking and reminder.. Also dragging works, just no hover background only win10

antfu commented 3 years ago

What if we wrap the drag area with a normal dom and let it handle the hover?

alexanderniebuhr commented 3 years ago

maybe that would work.. not quire sure how to wrap it, the dragable area needs to stay the same size also the hover effect.. but if they are on top of each other, it would not work..

antfu commented 3 years ago

Let's say:

<div class="wrapper w-10 h-10 rounded-full hover:bg-gray-400">
  <div class="draggable w-10 h-10"/>
</div>

Would that work?

alexanderniebuhr commented 3 years ago

no that would not work. The div with class draggable is same size, so the div with class wrapper does not get the hover event I know that you can wrap it in electron with js eventlistener onMouseDown or something

my understanding: for elements with -webkit-app-region:drag; there is no order or hirachy, it doesn't matter if it is behind or on top of another element. That area is always blocked to the drag.. The issue is with windows 10 needing frame: false