[gtk/wip/chergert/gdk-macos-gl-renderer] macos: tweak gravity during resizes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-gl-renderer] macos: tweak gravity during resizes
- Date: Wed, 28 Oct 2020 00:28:43 +0000 (UTC)
commit dec04dcdeb78351d51d8086b169f4a73df80d8f9
Author: Christian Hergert <chergert redhat com>
Date: Tue Oct 27 17:30:05 2020 -0700
macos: tweak gravity during resizes
This helps avoid some jitter while things resize due to how intermittent
clips work. Until we get frame sync, this helps a bit.
gdk/macos/GdkMacosWindow.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index c4a133afcc..b511233cdf 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -25,6 +25,7 @@
#import "GdkMacosBaseView.h"
#import "GdkMacosCairoView.h"
+#import "GdkMacosGLView.h"
#import "GdkMacosWindow.h"
#include "gdkmacosdisplay-private.h"
@@ -140,6 +141,10 @@
_gdk_macos_display_break_all_grabs (GDK_MACOS_DISPLAY (display), time);
+ /* Reset gravity */
+ if (GDK_IS_MACOS_GL_VIEW ([self contentView]))
+ [[[self contentView] layer] setContentsGravity:kCAGravityBottomLeft];
+
break;
}
@@ -543,6 +548,43 @@
inManualResize = YES;
resizeEdge = edge;
+ if (GDK_IS_MACOS_GL_VIEW ([self contentView]))
+ {
+ CALayerContentsGravity gravity = kCAGravityBottomLeft;
+
+ switch (edge)
+ {
+ default:
+ case GDK_SURFACE_EDGE_NORTH:
+ gravity = kCAGravityTopLeft;
+ break;
+
+ case GDK_SURFACE_EDGE_NORTH_WEST:
+ gravity = kCAGravityTopRight;
+ break;
+
+ case GDK_SURFACE_EDGE_SOUTH_WEST:
+ case GDK_SURFACE_EDGE_WEST:
+ gravity = kCAGravityBottomRight;
+ break;
+
+ case GDK_SURFACE_EDGE_SOUTH:
+ case GDK_SURFACE_EDGE_SOUTH_EAST:
+ gravity = kCAGravityBottomLeft;
+ break;
+
+ case GDK_SURFACE_EDGE_EAST:
+ gravity = kCAGravityBottomLeft;
+ break;
+
+ case GDK_SURFACE_EDGE_NORTH_EAST:
+ gravity = kCAGravityTopLeft;
+ break;
+ }
+
+ [[[self contentView] layer] setContentsGravity:gravity];
+ }
+
initialResizeFrame = [self frame];
initialResizeLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]