Commit 72b40266 authored by Paolo Borelli's avatar Paolo Borelli

gdkwindow: cleanup, avoid direct access to display members

parent 450b39f4
......@@ -1071,6 +1071,14 @@ switch_to_pointer_grab (GdkDisplay *display,
g_hash_table_insert (display->device_grabs, device, old_grabs);
}
void
_gdk_display_update_last_event (GdkDisplay *display,
const GdkEvent *event)
{
if (gdk_event_get_time (event) != GDK_CURRENT_TIME)
display->last_event_time = gdk_event_get_time (event);
}
void
_gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device,
......
......@@ -254,6 +254,8 @@ typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkPointerWindowInfo *device_info,
gpointer user_data);
void _gdk_display_update_last_event (GdkDisplay *display,
const GdkEvent *event);
void _gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device,
GdkDevice *source_device,
......
......@@ -9511,8 +9511,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
GdkDevice *device, *source_device;
gboolean is_toplevel;
if (gdk_event_get_time (event) != GDK_CURRENT_TIME)
display->last_event_time = gdk_event_get_time (event);
_gdk_display_update_last_event (display, event);
device = gdk_event_get_device (event);
source_device = gdk_event_get_source_device (event);
......@@ -9751,6 +9750,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
int height)
{
GdkDisplay *display;
GdkRenderingMode rendering_mode;
cairo_surface_t *window_surface, *surface;
double sx, sy;
......@@ -9761,7 +9761,9 @@ gdk_window_create_similar_surface (GdkWindow * window,
cairo_surface_get_device_scale (window_surface, &sx, &sy);
display = gdk_window_get_display (window);
switch (display->rendering_mode)
rendering_mode = gdk_display_get_rendering_mode (display);
switch (rendering_mode)
{
case GDK_RENDERING_MODE_RECORDING:
{
......@@ -9784,7 +9786,6 @@ gdk_window_create_similar_surface (GdkWindow * window,
break;
}
cairo_surface_destroy (window_surface);
return surface;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment