[gtk/wip/chergert/quartz4u] macos: silence some warnings and fix deprecations



commit ee02813d0e6e3c6aa5066f182b07684159ae4bd3
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 5 10:42:16 2020 -0700

    macos: silence some warnings and fix deprecations

 gdk/macos/GdkMacosWindow.c            |  8 ++++----
 gdk/macos/gdkmacosdisplay-translate.c | 10 +++++-----
 gdk/macos/gdkmacoskeymap.c            |  2 +-
 gdk/macos/gdkmacospopupsurface.c      |  4 ----
 4 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index bed7734e37..c25c31cf0f 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -325,7 +325,7 @@
   if (!inManualMove)
     return NO;
 
-  currentLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+  currentLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
   newOrigin.x = currentLocation.x - initialMoveLocation.x;
   newOrigin.y = currentLocation.y - initialMoveLocation.y;
 
@@ -358,7 +358,7 @@
 
   inManualMove = YES;
 
-  initialMoveLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+  initialMoveLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
   initialMoveLocation.x -= frame.origin.x;
   initialMoveLocation.y -= frame.origin.y;
 }
@@ -375,7 +375,7 @@
 
   inTrackManualResize = YES;
 
-  mouse_location = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+  mouse_location = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
   mdx = initialResizeLocation.x - mouse_location.x;
   mdy = initialResizeLocation.y - mouse_location.y;
 
@@ -460,7 +460,7 @@
   resizeEdge = edge;
 
   initialResizeFrame = [self frame];
-  initialResizeLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
+  initialResizeLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
 }
 
 -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index cf2991fcc3..c4211c3a75 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -210,7 +210,7 @@ fill_button_event (GdkMacosDisplay *display,
   state = get_keyboard_modifiers_from_ns_event (nsevent) |
          _gdk_macos_display_get_current_mouse_modifiers (display);
 
-  switch ([nsevent type])
+  switch ((int)[nsevent type])
     {
     case NSEventTypeLeftMouseDown:
     case NSEventTypeRightMouseDown:
@@ -254,7 +254,7 @@ synthesize_crossing_event (GdkMacosDisplay *display,
   GdkModifierType state;
   GdkSeat *seat;
 
-  switch ([nsevent type])
+  switch ((int)[nsevent type])
     {
     case NSEventTypeMouseEntered:
       event_type = GDK_ENTER_NOTIFY;
@@ -352,7 +352,7 @@ fill_pinch_event (GdkMacosDisplay *display,
    * PINCH(STARTED) event.
    */
 
-  switch ([nsevent phase])
+  switch ((int)[nsevent phase])
     {
     case NSEventPhaseBegan:
       switch (last_state)
@@ -407,7 +407,7 @@ fill_pinch_event (GdkMacosDisplay *display,
       break;
     }
 
-  switch ([nsevent type])
+  switch ((int)[nsevent type])
     {
     case NSEventTypeMagnify:
       last_scale *= [nsevent magnification] + 1.0;
@@ -570,7 +570,7 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
            GDK_SURFACE (surface)->height);
 #endif
 
-  switch (event_type)
+  switch ((int)event_type)
     {
     case NSEventTypeLeftMouseDown:
     case NSEventTypeRightMouseDown:
diff --git a/gdk/macos/gdkmacoskeymap.c b/gdk/macos/gdkmacoskeymap.c
index 641612b968..26899a7f6e 100644
--- a/gdk/macos/gdkmacoskeymap.c
+++ b/gdk/macos/gdkmacoskeymap.c
@@ -791,7 +791,7 @@ _gdk_macos_keymap_get_event_type (NSEvent *event)
   unsigned short keycode;
   unsigned int flags;
 
-  switch ([event type])
+  switch ((int)[event type])
     {
     case NSEventTypeKeyDown:
       return GDK_KEY_PRESS;
diff --git a/gdk/macos/gdkmacospopupsurface.c b/gdk/macos/gdkmacospopupsurface.c
index 7b15d193da..77501ef70c 100644
--- a/gdk/macos/gdkmacospopupsurface.c
+++ b/gdk/macos/gdkmacospopupsurface.c
@@ -58,8 +58,6 @@ _gdk_macos_popup_surface_get_property (GObject    *object,
                                        GValue     *value,
                                        GParamSpec *pspec)
 {
-  GdkMacosPopupSurface *self = GDK_MACOS_POPUP_SURFACE (object);
-
   switch (prop_id)
     {
     case LAST_PROP + GDK_POPUP_PROP_PARENT:
@@ -79,8 +77,6 @@ _gdk_macos_popup_surface_set_property (GObject      *object,
                                        const GValue *value,
                                        GParamSpec   *pspec)
 {
-  GdkMacosPopupSurface *self = GDK_MACOS_POPUP_SURFACE (object);
-
   switch (prop_id)
     {
     case LAST_PROP + GDK_POPUP_PROP_PARENT:


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