[gtk/wip/chergert/gdk-macos-gl-renderer: 11/26] macos: remove layer scaling when resizing




commit 6052aea8281e31ff96256a3bfe07b236049e7e95
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 27 10:26:18 2020 -0700

    macos: remove layer scaling when resizing
    
    With the default values, the contents would scale as the window is
    resized meaning things look rather jittery. This fixes that by keeping
    the position fixed to the top-left. Note that we use BottomLeft because
    the coordinates are flipped.

 gdk/macos/GdkMacosGLView.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gdk/macos/GdkMacosGLView.c b/gdk/macos/GdkMacosGLView.c
index cab8c66638..8f64a91097 100644
--- a/gdk/macos/GdkMacosGLView.c
+++ b/gdk/macos/GdkMacosGLView.c
@@ -139,7 +139,11 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       _openGLContext = context;
 
       if (_openGLContext != nil)
-        [_openGLContext setView:self];
+        {
+          [_openGLContext setView:self];
+          [self setWantsLayer:YES];
+          [self.layer setContentsGravity:kCAGravityBottomLeft];
+        }
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]