[gtk/wip.win32.fixes: 54/57] gdk[drag|drop]-win32.c: Don't unnecessarily compute scale
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes: 54/57] gdk[drag|drop]-win32.c: Don't unnecessarily compute scale
- Date: Thu, 1 Jul 2021 10:35:20 +0000 (UTC)
commit 6c7027c4c9c3a8e817f77eb61b44d1f1ef685fe5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Jun 22 17:06:03 2021 +0800
gdk[drag|drop]-win32.c: Don't unnecessarily compute scale
The GdkWin32Display object already did that when we created it, so just
use whatever that is stored in there.
gdk/win32/gdkdrag-win32.c | 7 +------
gdk/win32/gdkdrop-win32.c | 6 +-----
2 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c
index 419889ebe1..b82c8b5d82 100644
--- a/gdk/win32/gdkdrag-win32.c
+++ b/gdk/win32/gdkdrag-win32.c
@@ -805,11 +805,7 @@ gdk_drag_new (GdkDisplay *display,
drag = GDK_DRAG (drag_win32);
- if (win32_display->has_fixed_scale)
- drag_win32->scale = win32_display->surface_scale;
- else
- drag_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL);
-
+ drag_win32->scale = win32_display->surface_scale;
drag_win32->protocol = protocol;
return drag;
@@ -2160,7 +2156,6 @@ gdk_win32_drag_drop_done (GdkDrag *drag,
if (success)
{
gdk_surface_hide (drag_win32->drag_surface);
-
return;
}
diff --git a/gdk/win32/gdkdrop-win32.c b/gdk/win32/gdkdrop-win32.c
index bd41e82ef7..77ed742ee6 100644
--- a/gdk/win32/gdkdrop-win32.c
+++ b/gdk/win32/gdkdrop-win32.c
@@ -186,11 +186,7 @@ gdk_drop_new (GdkDisplay *display,
"surface", surface,
NULL);
- if (win32_display->has_fixed_scale)
- drop_win32->scale = win32_display->surface_scale;
- else
- drop_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL);
-
+ drop_win32->scale = win32_display->surface_scale;
drop_win32->protocol = protocol;
return GDK_DROP (drop_win32);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]