[gtk/gtk-3-24] [Quartz]Fix some deprecation and unused variable warnings.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24] [Quartz]Fix some deprecation and unused variable warnings.
- Date: Sat, 20 Jun 2020 18:18:08 +0000 (UTC)
commit 04ed7fe7db49e004180baca3f42463a97ec48071
Author: John Ralls <jralls ceridwen us>
Date: Sat Jun 20 11:16:18 2020 -0700
[Quartz]Fix some deprecation and unused variable warnings.
gdk/quartz/gdkevents-quartz.c | 9 ++++++---
gdk/quartz/gdkscreen-quartz.c | 6 ++----
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 3a8e4cc665..0d492c1619 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -644,8 +644,9 @@ find_toplevel_under_pointer (GdkDisplay *display,
if (!(toplevel && WINDOW_IS_TOPLEVEL (toplevel)))
{
gint gdk_x = 0, gdk_y = 0;
+ GdkDevice *pointer = gdk_seat_get_pointer(seat);
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y);
- toplevel = gdk_display_get_window_at_pointer (display, &gdk_x, &gdk_y);
+ toplevel = gdk_device_get_window_at_position (pointer, &gdk_x, &gdk_y);
if (toplevel && ! WINDOW_IS_TOPLEVEL (toplevel))
toplevel = gdk_window_get_toplevel (toplevel);
@@ -1379,16 +1380,18 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void)
GdkModifierType
_gdk_quartz_events_get_current_mouse_modifiers (void)
{
+ NSUInteger buttons = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
if (gdk_quartz_osx_version () >= GDK_OSX_SNOW_LEOPARD)
- return get_mouse_button_modifiers_from_ns_buttons ([NSClassFromString(@"NSEvent") pressedMouseButtons]);
+ buttons = [NSClassFromString(@"NSEvent") pressedMouseButtons];
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
else
#endif
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
- return get_mouse_button_modifiers_from_ns_buttons (GetCurrentButtonState ());
+ buttons = GetCurrentButtonState ();
#endif
+ return get_mouse_button_modifiers_from_ns_buttons (buttons);
}
/* Detect window resizing */
diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c
index 848ad6a31f..11f6c15e1c 100644
--- a/gdk/quartz/gdkscreen-quartz.c
+++ b/gdk/quartz/gdkscreen-quartz.c
@@ -18,7 +18,8 @@
*/
#include "config.h"
-
+/* GdkScreen is deprecated, but we need to support it still so silence the warnings.*/
+#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#include <gdk/gdk.h>
#include "gdkprivate-quartz.h"
@@ -121,9 +122,6 @@ static void
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
GdkQuartzDisplay *display)
{
- int i, monitors;
- int max_x, max_y;
-
if (!display)
display = GDK_QUARTZ_DISPLAY (gdk_screen_get_display (GDK_SCREEN (screen)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]