[Quartz]Fix some deprecation and unused variable warnings.

This commit is contained in:
John Ralls 2020-06-20 11:16:18 -07:00
parent c6036592c9
commit 04ed7fe7db
2 changed files with 8 additions and 7 deletions

View File

@ -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 */

View File

@ -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)));