mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 1264196 - Use the DPI from the parent window, if any, for consistency between popups and their owners when straddling a monitor boundary. r=emk
This commit is contained in:
parent
0dce9cb2f1
commit
91c9694559
@ -145,7 +145,10 @@ public:
|
||||
*/
|
||||
static double LogToPhysFactor(HMONITOR aMonitor);
|
||||
static double LogToPhysFactor(HWND aWnd) {
|
||||
return LogToPhysFactor(::MonitorFromWindow(aWnd, MONITOR_DEFAULTTOPRIMARY));
|
||||
// if there's an ancestor window, we want to share its DPI setting
|
||||
HWND ancestor = ::GetAncestor(aWnd, GA_ROOTOWNER);
|
||||
return LogToPhysFactor(::MonitorFromWindow(ancestor ? ancestor : aWnd,
|
||||
MONITOR_DEFAULTTOPRIMARY));
|
||||
}
|
||||
static double LogToPhysFactor(HDC aDC) {
|
||||
return LogToPhysFactor(::WindowFromDC(aDC));
|
||||
|
Loading…
Reference in New Issue
Block a user