Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2018-07-23 08:11:46 +0000
committerNiraj Modi2018-07-23 08:11:46 +0000
commit0aa92e62e6bfa1b054314f9a94b90c49428a789e (patch)
tree905870b1e344246ddf6bc9f354cf9e48d7aae87b
parent011230192a79a3be1c615f6b452cb57cefb93c8c (diff)
downloadeclipse.platform.swt-0aa92e62e6bfa1b054314f9a94b90c49428a789e.tar.gz
eclipse.platform.swt-0aa92e62e6bfa1b054314f9a94b90c49428a789e.tar.xz
eclipse.platform.swt-0aa92e62e6bfa1b054314f9a94b90c49428a789e.zip
Bug 537273 - [HiDPI][Win32] SWT on start to pick OS zoom updated without
logoff - SWT now picks primary monitor zoom level. Change-Id: Id3942f95559a3177aa857be4a13568b8cafd8be0 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 3499e184b5..419143571b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1627,6 +1627,22 @@ public static Display getDefault () {
}
}
+/**
+ * @since 3.108
+ */
+@Override
+protected int getDeviceZoom() {
+ /*
+ * Win8.1 and above we should pick zoom for the primary monitor which always
+ * reflects the latest OS zoom value, for more details refer bug 537273.
+ */
+ if (OS.WIN32_VERSION >= OS.VERSION (6, 3)) {
+ return getPrimaryMonitor().getZoom();
+ }
+ /* Otherwise return Windows zoom level, as set during session login. */
+ return super.getDeviceZoom();
+}
+
static boolean isValidClass (Class<?> clazz) {
String name = clazz.getName ();
int index = name.lastIndexOf ('.');

Back to the top