Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ public void setData(String key, Object value) {
if (autoScaleDisabled) {
this.nativeZoom = 100;
} else {
this.nativeZoom = (int) getData(DATA_SHELL_ZOOM);
this.nativeZoom = getShellZoom();
}
}
}
Expand Down Expand Up @@ -4817,6 +4817,13 @@ int getZoom() {
return super.getZoom();
}

int getShellZoom() {
if (getData(DATA_SHELL_ZOOM) instanceof Integer shellZoom) {
return shellZoom;
}
return nativeZoom;
}

abstract TCHAR windowClass ();

abstract long windowProc ();
Expand Down Expand Up @@ -5503,7 +5510,7 @@ LRESULT WM_SETCURSOR (long wParam, long lParam) {
if (control == null) return null;
Cursor cursor = control.findCursor ();
if (cursor != null) {
OS.SetCursor (Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
OS.SetCursor (Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getShellZoom())));
return LRESULT.ONE;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ LRESULT WM_SETCURSOR (long wParam, long lParam) {
RECT rect = new RECT ();
OS.GetClientRect (handle, rect);
if (OS.PtInRect (rect, pt)) {
OS.SetCursor (Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
OS.SetCursor (Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getShellZoom())));
switch (msg) {
case OS.WM_LBUTTONDOWN:
case OS.WM_RBUTTONDOWN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public void setCursor(Cursor newCursor) {
checkWidget();
clientCursor = newCursor;
if (newCursor != null) {
if (inEvent) OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
if (inEvent) OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(parent != null ? parent.getShellZoom() : getNativeZoom())));
}
}

Expand Down Expand Up @@ -892,7 +892,7 @@ long transparentProc (long hwnd, long msg, long wParam, long lParam) {
break;
case OS.WM_SETCURSOR:
if (clientCursor != null) {
OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(parent != null ? parent.getShellZoom() : getNativeZoom())));
return 1;
}
if (resizeCursor != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4665,7 +4665,7 @@ void setCursor () {
* is IDC_ARROW.
*/
Cursor cursor = findCursor ();
long hCursor = cursor == null ? OS.LoadCursor (0, OS.IDC_ARROW) : Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom()));
long hCursor = cursor == null ? OS.LoadCursor (0, OS.IDC_ARROW) : Cursor.win32_getHandle(cursor, DPIUtil.getZoomForAutoscaleProperty(getShellZoom()));
OS.SetCursor (hCursor);
}

Expand Down
Loading