Skip to content

Commit e1c2c78

Browse files
authored
Merge pull request #13094 from brave/pr13072_rewards-fix-drag-image-linux-captcha_1.38.x
Fix incorrect CAPTCHA drag image on scaled Linux display (uplift to 1.38.x)
2 parents 521c98c + 846032b commit e1c2c78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/brave_rewards/resources/rewards_panel/components/grant_captcha_challenge.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ export function GrantCaptchaChallenge (props: Props) {
3939
x: (rect.width / 2) - (event.clientX - rect.left),
4040
y: (rect.height / 2) - (event.clientY - rect.top)
4141
})
42+
43+
// Work around Linux-specific upstream bug by explicitly setting the drag
44+
// image offset when initiating the drag
45+
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1297990
46+
if (window.navigator.userAgent.includes('Linux') && devicePixelRatio > 1) {
47+
event.dataTransfer.setDragImage(
48+
target,
49+
event.clientX - rect.left,
50+
event.clientY - rect.top)
51+
}
4252
}
4353

4454
function onDragOver (event: React.DragEvent) {

0 commit comments

Comments
 (0)