forked from AuroraMiddleware/gtk
Cleanup: remove unused variables from macos code
Remove unused variables. In case if Cairo code it would allocate memory, which would result in a memory leak.
This commit is contained in:
parent
a9c9678e1f
commit
097d87e502
@ -760,16 +760,9 @@ find_surface_under_pointer (GdkMacosDisplay *self,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
GdkPointerSurfaceInfo *info;
|
||||
GdkMacosSurface *surface;
|
||||
GdkDevice *pointer;
|
||||
GdkSeat *seat;
|
||||
int x_tmp, y_tmp;
|
||||
|
||||
seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
|
||||
pointer = gdk_seat_get_pointer (seat);
|
||||
info = _gdk_display_get_pointer_info (GDK_DISPLAY (self), pointer);
|
||||
|
||||
surface = _gdk_macos_display_get_surface_at_display_coords (self,
|
||||
screen_point.x,
|
||||
screen_point.y,
|
||||
|
@ -870,15 +870,12 @@ _gdk_macos_display_get_surface_at_coords (GdkMacosDisplay *self,
|
||||
for (const GList *iter = surfaces; iter; iter = iter->next)
|
||||
{
|
||||
GdkSurface *surface = iter->data;
|
||||
NSWindow *nswindow;
|
||||
|
||||
g_assert (GDK_IS_MACOS_SURFACE (surface));
|
||||
|
||||
if (!gdk_surface_get_mapped (surface))
|
||||
continue;
|
||||
|
||||
nswindow = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (surface));
|
||||
|
||||
if (x >= GDK_MACOS_SURFACE (surface)->root_x &&
|
||||
y >= GDK_MACOS_SURFACE (surface)->root_y &&
|
||||
x <= (GDK_MACOS_SURFACE (surface)->root_x + surface->width) &&
|
||||
|
@ -460,12 +460,10 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
|
||||
{
|
||||
GdkMacosGLContext *self = (GdkMacosGLContext *)context;
|
||||
GdkMacosBuffer *buffer;
|
||||
cairo_region_t *copy;
|
||||
GdkSurface *surface;
|
||||
|
||||
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
|
||||
|
||||
copy = cairo_region_copy (region);
|
||||
surface = gdk_draw_context_get_surface (context);
|
||||
buffer = _gdk_macos_surface_get_buffer (GDK_MACOS_SURFACE (surface));
|
||||
|
||||
|
@ -276,10 +276,8 @@ gdk_macos_keymap_update (GdkMacosKeymap *self)
|
||||
{
|
||||
UInt32 state = 0;
|
||||
OSStatus err;
|
||||
UInt16 key_code;
|
||||
UniChar uc;
|
||||
|
||||
key_code = modifiers[j] | i;
|
||||
err = UCKeyTranslate (chr_data, i, kUCKeyActionDisplay,
|
||||
(modifiers[j] >> 8) & 0xFF,
|
||||
LMGetKbdType(),
|
||||
@ -369,7 +367,7 @@ gdk_macos_keymap_update (GdkMacosKeymap *self)
|
||||
if (p[0] == known_numeric_keys[i].normal_keyval)
|
||||
p[0] = known_numeric_keys[i].keypad_keyval;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (jis_keys); i++)
|
||||
{
|
||||
p = keyval_array + jis_keys[i].keycode * KEYVALS_PER_KEYCODE;
|
||||
|
@ -215,7 +215,6 @@ gdk_macos_monitor_display_link_cb (GdkMacosMonitor *self)
|
||||
{
|
||||
gint64 presentation_time;
|
||||
gint64 refresh_interval;
|
||||
gint64 now;
|
||||
GList *iter;
|
||||
|
||||
g_assert (GDK_IS_MACOS_MONITOR (self));
|
||||
@ -225,7 +224,6 @@ gdk_macos_monitor_display_link_cb (GdkMacosMonitor *self)
|
||||
|
||||
presentation_time = self->display_link->presentation_time;
|
||||
refresh_interval = self->display_link->refresh_interval;
|
||||
now = g_source_get_time ((GSource *)self->display_link);
|
||||
|
||||
iter = self->awaiting_frames.head;
|
||||
|
||||
|
@ -195,7 +195,6 @@ gdk_macos_surface_hide (GdkSurface *surface)
|
||||
{
|
||||
GdkMacosSurface *self = (GdkMacosSurface *)surface;
|
||||
GdkSeat *seat;
|
||||
gboolean was_mapped;
|
||||
gboolean was_key;
|
||||
|
||||
g_assert (GDK_IS_MACOS_SURFACE (self));
|
||||
@ -204,7 +203,6 @@ gdk_macos_surface_hide (GdkSurface *surface)
|
||||
|
||||
_gdk_macos_surface_cancel_frame (self);
|
||||
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
was_key = [self->window isKeyWindow];
|
||||
|
||||
seat = gdk_display_get_default_seat (surface->display);
|
||||
@ -285,14 +283,12 @@ gdk_macos_surface_end_frame (GdkMacosSurface *self)
|
||||
{
|
||||
GdkFrameTimings *timings;
|
||||
GdkFrameClock *frame_clock;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_assert (GDK_IS_MACOS_SURFACE (self));
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (self))
|
||||
return;
|
||||
|
||||
display = gdk_surface_get_display (GDK_SURFACE (self));
|
||||
frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self));
|
||||
|
||||
if ((timings = gdk_frame_clock_get_current_timings (frame_clock)))
|
||||
@ -420,7 +416,6 @@ gdk_macos_surface_drag_begin (GdkSurface *surface,
|
||||
GdkMacosSurface *drag_surface;
|
||||
GdkMacosDrag *drag;
|
||||
GdkCursor *cursor;
|
||||
GdkSeat *seat;
|
||||
double px;
|
||||
double py;
|
||||
int sx;
|
||||
@ -432,7 +427,6 @@ gdk_macos_surface_drag_begin (GdkSurface *surface,
|
||||
g_assert (GDK_IS_MACOS_DEVICE (device));
|
||||
g_assert (GDK_IS_CONTENT_PROVIDER (content));
|
||||
|
||||
seat = gdk_device_get_seat (device);
|
||||
gdk_macos_device_query_state (device, surface, NULL, &px, &py, NULL);
|
||||
_gdk_macos_surface_get_root_coords (GDK_MACOS_SURFACE (surface), &sx, &sy);
|
||||
drag_surface = _gdk_macos_surface_new (GDK_MACOS_DISPLAY (surface->display),
|
||||
|
Loading…
Reference in New Issue
Block a user