forked from AuroraMiddleware/gtk
macos: fix crash in imcontextquartz
This commit is contained in:
parent
17c903e246
commit
99a8202015
@ -305,7 +305,7 @@ static void
|
||||
quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area)
|
||||
{
|
||||
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
|
||||
GtkWidget* surface_widget = GTK_WIDGET (gdk_surface_get_widget (qc->client_surface));
|
||||
GtkWidget* surface_widget;
|
||||
int sx, sy;
|
||||
double wx, wy;
|
||||
|
||||
@ -317,6 +317,11 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area)
|
||||
if (!qc->focused)
|
||||
return;
|
||||
|
||||
surface_widget = GTK_WIDGET (gdk_surface_get_widget (qc->client_surface));
|
||||
|
||||
if (!surface_widget)
|
||||
return;
|
||||
|
||||
gdk_surface_get_origin (qc->client_surface, &sx, &sy);
|
||||
gtk_widget_translate_coordinates(qc->client_widget, surface_widget,
|
||||
area->x, area->y, &wx, &wy);
|
||||
|
Loading…
Reference in New Issue
Block a user