diff options
author | Sravan Kumar Lakkimsetti | 2016-03-07 12:07:09 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2016-03-07 12:07:09 +0000 |
commit | 6c9e513009c0ac3103601e9cd15716a96b33b02e (patch) | |
tree | c379fe914cd5c16729529a45ffbb61ecaff3e7a0 | |
parent | 59865c852950ec30c4f4810ed364fd994fbe46f2 (diff) | |
download | eclipse.platform.swt-6c9e513009c0ac3103601e9cd15716a96b33b02e.tar.gz eclipse.platform.swt-6c9e513009c0ac3103601e9cd15716a96b33b02e.tar.xz eclipse.platform.swt-6c9e513009c0ac3103601e9cd15716a96b33b02e.zip |
Bug 399786 - Fixed snippet 120
Change-Id: I899b6cba8c0ae59e2b7a841b64f5e3f5778d02e4
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index df3b102a3d..e7e36e75b5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -2018,7 +2018,7 @@ Rectangle getWorkArea() { public Monitor [] getMonitors () { checkDevice (); Monitor [] monitors = null; - Rectangle workArea = getWorkArea (); + Rectangle workArea = DPIUtil.autoScaleDown (getWorkArea ()); long /*int*/ screen = OS.gdk_screen_get_default (); if (screen != 0) { int monitorCount = OS.gdk_screen_get_n_monitors (screen); @@ -2029,19 +2029,19 @@ public Monitor [] getMonitors () { OS.gdk_screen_get_monitor_geometry (screen, i, dest); Monitor monitor = new Monitor (); monitor.handle = i; - monitor.x = dest.x; - monitor.y = dest.y; - monitor.width = dest.width; - monitor.height = dest.height; + monitor.x = DPIUtil.autoScaleDown (dest.x); + monitor.y = DPIUtil.autoScaleDown (dest.y); + monitor.width = DPIUtil.autoScaleDown (dest.width); + monitor.height = DPIUtil.autoScaleDown (dest.height); if (OS.GTK_VERSION >= OS.VERSION (3, 4, 0)) { // workarea was defined in GTK 3.4. If present, it will return the best results // since it takes into account per-monitor trim OS.gdk_screen_get_monitor_workarea (screen, i, dest); - monitor.clientX = dest.x; - monitor.clientY = dest.y; - monitor.clientWidth = dest.width; - monitor.clientHeight = dest.height; + monitor.clientX = DPIUtil.autoScaleDown (dest.x); + monitor.clientY = DPIUtil.autoScaleDown (dest.y); + monitor.clientWidth = DPIUtil.autoScaleDown (dest.width); + monitor.clientHeight = DPIUtil.autoScaleDown (dest.height); } else { // If we're on an older version of gtk without the workarea function, see if we can use // the getWorkArea function. In the case of multi-monitors, this will return something that @@ -2075,7 +2075,7 @@ public Monitor [] getMonitors () { if (monitors == null) { /* No multimonitor support detected, default to one monitor */ Monitor monitor = new Monitor (); - Rectangle bounds = getBoundsInPixels (); + Rectangle bounds = getBounds (); monitor.x = bounds.x; monitor.y = bounds.y; monitor.width = bounds.width; |