forked from AuroraMiddleware/gtk
Merge branch 'wip/chergert/fix-macos-crash' into 'main'
macos: fix crash in imcontextquartz See merge request GNOME/gtk!4226
This commit is contained in:
commit
a35c35f849
@ -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