Open Bug 1473764 Opened 6 years ago Updated 2 years ago

Query spatial boundaries for double- and higher-order clicks from Windows in a DPI-aware manner

Categories

(Core :: Widget: Win32, enhancement)

All
Windows
enhancement

Tracking

()

Tracking Status
firefox63 --- affected

People

(Reporter: henrik.hank, Unassigned)

Details

Attachments

(1 file)

In `nsWindow.cpp` for Windows, besides `GetDoubleClickTime()` there are spatial boundaries which 2 clicks must meet to be grouped together. `GetSystemMetrics()` is not DPI-aware, so we must use `GetSystemMetricsForDpi()`, if available, to query the values `SM_CXDOUBLECLK` and `SM_CYDOUBLECLK`.
Attachment #8990161 - Flags: review?(masayuki)
Comment on attachment 8990161 [details] Bug 1473764 - DPI-aware spatial boundaries for double- and higher-order clicks https://reviewboard.mozilla.org/r/255174/#review262098 Looks good to me but I'm not familiar with HiDPI nor per-monitor DPI code. Perhaps, jimm? ::: commit-message-6c0fa:3 (Diff revision 1) > +Also discussed in review of this bug: > +https://bugzilla.mozilla.org/show_bug.cgi?id=550528 Please explain *why* this change is necessary and the points of this change which is hard to read from the code instead of pointing URL because when other developers investigate the reason of this change, it should be explained by the commit message.
Attachment #8990161 - Flags: review?(masayuki)
Comment on attachment 8990161 [details] Bug 1473764 - DPI-aware spatial boundaries for double- and higher-order clicks jimm: Are you familiar with HiDPI and per-monitor DPI code? Or Jonathan Kew or emk-san is better reviewer for this?
Attachment #8990161 - Flags: review?(jmathies)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 8990161 [details] Bug 1473764 - DPI-aware spatial boundaries for double- and higher-order clicks https://reviewboard.mozilla.org/r/255174/#review263502 This looks correct to me. Lets fix the commit and resubmit for an r+. ::: commit-message-6c0fa:3 (Diff revision 1) > +Also discussed in review of this bug: > +https://bugzilla.mozilla.org/show_bug.cgi?id=550528 yeah lets clean this up.
Attachment #8990161 - Flags: review?(jmathies) → review-
Comment on attachment 8990161 [details] Bug 1473764 - DPI-aware spatial boundaries for double- and higher-order clicks I changed the commit message.
Attachment #8990161 - Flags: review?(jmathies)
Bump.
Comment on attachment 8990161 [details] Bug 1473764 - DPI-aware spatial boundaries for double- and higher-order clicks https://reviewboard.mozilla.org/r/255174/#review266790 ::: widget/windows/WinUtils.cpp:1047 (Diff revision 3) > return info.mOutWnd; > } > > /* static */ > +gfx::IntSize > +WinUtils::GetSpatialDoubleClickBoundaries(float aDpi) { nit - other methods push the paren to ther next line. ::: widget/windows/WinUtils.cpp:1053 (Diff revision 3) > + gfx::IntSize boundaries; > + > + if (sGetSystemMetricsForDpi) { > + int32_t dpi = NSToIntRound(aDpi); > + boundaries = gfx::IntSize( > + sGetSystemMetricsForDpi(SM_CXDOUBLECLK, dpi), I wonder how often this new api fails? Don't think we need a check but lets add a debug assert on a zero result to be safe.
Attachment #8990161 - Flags: review?(jmathies) → review+
Hey Jim, I fixed your issues. It it okay this way?
Flags: needinfo?(jmathies)
(In reply to h-h from comment #13) > Hey Jim, > > I fixed your issues. It it okay this way? Sure, you should post the latest patch and ask for a review.
Flags: needinfo?(jmathies)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: