[gtk-osx] Add patch, correct patch href from previous commit.



commit e01a33aeee4d2e0ec506bfc5b2510ccc6fa64709
Author: John Ralls <jralls ceridwen us>
Date:   Sun Dec 30 09:22:52 2018 -0800

    Add patch, correct patch href from previous commit.

 modulesets-stable/gtk-osx.modules      |   2 +-
 patches/gtk3-quartz-3-24-2-fixes.patch | 216 +++++++++++++++++++++++++++++++++
 2 files changed, 217 insertions(+), 1 deletion(-)
---
diff --git a/modulesets-stable/gtk-osx.modules b/modulesets-stable/gtk-osx.modules
index a619db7..52176b1 100644
--- a/modulesets-stable/gtk-osx.modules
+++ b/modulesets-stable/gtk-osx.modules
@@ -236,7 +236,7 @@
              autogenargs="--enable-quartz-backend --enable-quartz-relocation">
     <branch module="gtk+/3.24/gtk+-3.24.2.tar.xz" version="3.24.2"
             hash="sha256:5b3b05e427cc928d103561ed2e91b2b2881fe88b1f167b0b1c9990da6aac8892">
-      <patch 
file="file:///Users/john/Development/GTK-OSX/gtk-osx-build/patches/gtk3-quartz-3-24-2-fixes.patch" strip="1"/>
+      <patch 
file="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master//patches/gtk3-quartz-3-24-2-fixes.patch"; strip="1"/>
     </branch>
     <dependencies>
       <dep package="glib"/>
diff --git a/patches/gtk3-quartz-3-24-2-fixes.patch b/patches/gtk3-quartz-3-24-2-fixes.patch
new file mode 100644
index 0000000..b9d33d3
--- /dev/null
+++ b/patches/gtk3-quartz-3-24-2-fixes.patch
@@ -0,0 +1,216 @@
+diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
+index 6c8f233..89f42e7 100644
+--- a/gdk/quartz/GdkQuartzNSWindow.c
++++ b/gdk/quartz/GdkQuartzNSWindow.c
+@@ -379,22 +379,46 @@
+ 
+   initialPositionKnown = NO;
+ }
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
++
+ - (NSPoint)convertPointToScreen:(NSPoint)point
+ {
+-  NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
+-  NSRect outrect = [self convertRectToScreen: inrect];
+-  return (NSPoint)((CGRect)outrect).origin;
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
++  if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
++    {
++      return [super convertPointToScreen: point];
++    }
++#endif
++  if (gdk_quartz_osx_version () >= GDK_OSX_LION)
++    {
++      NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
++      NSRect outrect = [self convertRectToScreen: inrect];
++      return (NSPoint)((CGRect)outrect).origin;
++    }
+ 
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
++  return [self convertBaseToScreen:point];
++#endif
+ }
+ 
+ - (NSPoint)convertPointFromScreen:(NSPoint)point
+ {
+-  NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
+-  NSRect outrect = [self convertRectFromScreen: inrect];
+-  return (NSPoint)((CGRect)outrect).origin;
+-}
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
++  if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
++    {
++      return [super convertPointFromScreen: point];
++    }
++#endif
++  if (gdk_quartz_osx_version () >= GDK_OSX_LION)
++    {
++      NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
++      NSRect outrect = [self convertRectFromScreen: inrect];
++      return (NSPoint)((CGRect)outrect).origin;
++    }
++
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
++  return [self convertScreenToBase:point];
+ #endif
++}
+ 
+ - (BOOL)trackManualMove
+ {
+@@ -407,11 +431,8 @@
+ 
+   if (!inManualMove)
+     return NO;
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  currentLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+-#else
++
+   currentLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
+-#endif
+   newOrigin.x = currentLocation.x - initialMoveLocation.x;
+   newOrigin.y = currentLocation.y - initialMoveLocation.y;
+ 
+@@ -442,11 +463,7 @@
+ 
+   inManualMove = YES;
+ 
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  initialMoveLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+-#else
+   initialMoveLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
+-#endif
+   initialMoveLocation.x -= frame.origin.x;
+   initialMoveLocation.y -= frame.origin.y;
+ }
+@@ -462,12 +479,7 @@
+     return NO;
+ 
+   inTrackManualResize = YES;
+-
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  mouse_location = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+-#else
+   mouse_location = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
+-#endif
+   mdx = initialResizeLocation.x - mouse_location.x;
+   mdy = initialResizeLocation.y - mouse_location.y;
+ 
+@@ -552,12 +564,7 @@
+   resizeEdge = edge;
+ 
+   initialResizeFrame = [self frame];
+-
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  initialResizeLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+-#else
+   initialResizeLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
+-#endif
+ }
+ 
+ 
+@@ -690,13 +697,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
+ - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
+ {
+   NSPoint point = [sender draggingLocation];
+-  NSPoint screen_point;
+-
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  screen_point = [self convertBaseToScreen:point];
+-#else
+-  screen_point = [self convertPointToScreen:point];
+-#endif
++  NSPoint screen_point = [self convertPointToScreen:point];
+   GdkEvent *event;
+   int gx, gy;
+ 
+@@ -724,13 +725,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
+ - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+ {
+   NSPoint point = [sender draggingLocation];
+-  NSPoint screen_point;
+-
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-    screen_point = [self convertBaseToScreen:point];
+-#else
+-  screen_point = [self convertPointToScreen:point];
+-#endif
++  NSPoint screen_point = [self convertPointToScreen:point];
+   GdkEvent *event;
+   int gy, gx;
+ 
+diff --git a/gdk/quartz/GdkQuartzNSWindow.h b/gdk/quartz/GdkQuartzNSWindow.h
+index 45d1d67..081d5d8 100644
+--- a/gdk/quartz/GdkQuartzNSWindow.h
++++ b/gdk/quartz/GdkQuartzNSWindow.h
+@@ -53,10 +53,8 @@
+ #ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+ -(void)setStyleMask:(NSUInteger)styleMask;
+ #endif
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
+ - (NSPoint)convertPointToScreen:(NSPoint)point;
+ - (NSPoint)convertPointFromScreen:(NSPoint)point;
+-#endif
+ @end
+ 
+ 
+diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
+index a342b88..165e92b 100644
+--- a/gdk/quartz/gdkdisplay-quartz.c
++++ b/gdk/quartz/gdkdisplay-quartz.c
+@@ -252,7 +252,12 @@ configure_monitor (GdkMonitor *monitor)
+   monitor->width_mm = width;
+   monitor->height_mm = height;
+   monitor->geometry = disp_geometry;
+-  monitor->scale_factor = 1;
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
++  if (gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
++    monitor->scale_factor = CGDisplayModeGetPixelWidth (mode) / CGDisplayModeGetWidth (mode);
++  else
++#endif
++    monitor->scale_factor = 1;
+   monitor->refresh_rate = refresh_rate;
+   monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
+   CGDisplayModeRelease (mode);
+diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
+index 952d4a8..74f59b1 100644
+--- a/gdk/quartz/gdkevents-quartz.c
++++ b/gdk/quartz/gdkevents-quartz.c
+@@ -379,12 +379,7 @@ get_window_point_from_screen_point (GdkWindow *window,
+   GdkQuartzNSWindow *nswindow;
+ 
+   nswindow = (GdkQuartzNSWindow*)(((GdkWindowImplQuartz *)window->impl)->toplevel);
+-
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+-  point = [nswindow convertScreenToBase:screen_point];
+-#else
+   point = [nswindow convertPointFromScreen:screen_point];
+-#endif
+   *x = point.x;
+   *y = window->height - point.y;
+ }
+@@ -460,12 +455,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
+         }
+       else
+         {
+-          if (gdk_quartz_osx_version () >= GDK_OSX_LION)
+-            *screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
+-#if MAC_OS_X_VERSION_MIN_REQUIRED < 10700
+-          else
+-            *screen_point = [[nsevent window] convertBaseToScreen:point];
+-#endif
++        *screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
+           *x = point.x;
+           *y = toplevel->height - point.y;
+         }
+@@ -1551,8 +1541,10 @@ gdk_event_translate (GdkEvent *event,
+           grab = _gdk_display_get_last_device_grab (_gdk_display,
+                                                     gdk_seat_get_pointer (seat));
+         }
+-      return_val = TRUE;
+     }
++
++  return_val = TRUE;
++
+   switch (event_type)
+     {
+     case GDK_QUARTZ_LEFT_MOUSE_DOWN:


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