forked from AuroraMiddleware/gtk
wayland: Clean up naming of GdkWaylandDisplay pointers
The naming of pointers to GdkWaylandDisplay's were inconsistent. Running the following commands in gtk+/gdk/wayland illustrate the inconsistency: $ grep -r '\<display_wayland\>' *.[ch] | wc -l 195 $ grep -r '\<wayland_display\>' *.[ch] | wc -l 81 This patch renames all occurrences of "wayland_display" to "display_wayland". This is also consistent with naming in the X11 backend. A couple of whitespace changes were done as well in places where the rename was already done, that added line breaks to long lines that stood out. https://bugzilla.gnome.org/show_bug.cgi?id=765474
This commit is contained in:
parent
7700243bd4
commit
cb73becfb4
@ -139,7 +139,7 @@ name_fallback (const gchar *name)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *display_wayland,
|
||||
GdkWaylandCursor *cursor)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
@ -149,7 +149,7 @@ _gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
if (cursor->name == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (display_wayland,
|
||||
cursor->scale);
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
@ -293,7 +293,7 @@ void
|
||||
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
@ -308,7 +308,7 @@ _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
|
||||
wayland_cursor->scale = scale;
|
||||
|
||||
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
|
||||
_gdk_wayland_cursor_update (display_wayland, wayland_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -333,11 +333,11 @@ _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
private = g_hash_table_lookup (wayland_display->cursor_cache, name);
|
||||
private = g_hash_table_lookup (display_wayland->cursor_cache, name);
|
||||
if (private)
|
||||
return GDK_CURSOR (g_object_ref (private));
|
||||
|
||||
@ -352,11 +352,13 @@ _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
if (!name || g_str_equal (name, "none") || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!_gdk_wayland_cursor_update (wayland_display, private))
|
||||
if (!_gdk_wayland_cursor_update (display_wayland, private))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
/* Insert into cache. */
|
||||
g_hash_table_insert (wayland_display->cursor_cache, private->name, g_object_ref (private));
|
||||
g_hash_table_insert (display_wayland->cursor_cache,
|
||||
private->name,
|
||||
g_object_ref (private));
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
@ -421,13 +423,13 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
gdouble y)
|
||||
{
|
||||
GdkWaylandCursor *cursor;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
struct wl_buffer *buffer;
|
||||
cairo_t *cr;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
|
||||
"cursor-type", GDK_CURSOR_IS_PIXMAP,
|
||||
"display", wayland_display,
|
||||
"display", display_wayland,
|
||||
NULL);
|
||||
cursor->name = NULL;
|
||||
cursor->surface.hotspot_x = x;
|
||||
@ -449,10 +451,11 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cursor->surface.height = 1;
|
||||
}
|
||||
|
||||
cursor->surface.cairo_surface = _gdk_wayland_display_create_shm_surface (wayland_display,
|
||||
cursor->surface.width,
|
||||
cursor->surface.height,
|
||||
cursor->surface.scale);
|
||||
cursor->surface.cairo_surface =
|
||||
_gdk_wayland_display_create_shm_surface (display_wayland,
|
||||
cursor->surface.width,
|
||||
cursor->surface.height,
|
||||
cursor->surface.scale);
|
||||
|
||||
buffer = _gdk_wayland_shm_surface_get_wl_buffer (cursor->surface.cairo_surface);
|
||||
wl_buffer_add_listener (buffer, &buffer_listener, cursor->surface.cairo_surface);
|
||||
|
@ -1205,7 +1205,7 @@ pointer_handle_enter (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!surface)
|
||||
@ -1214,7 +1214,7 @@ pointer_handle_enter (void *data,
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
seat->pointer_info.focus = wl_surface_get_user_data(surface);
|
||||
g_object_ref(seat->pointer_info.focus);
|
||||
@ -1249,7 +1249,7 @@ pointer_handle_enter (void *data,
|
||||
g_message ("enter, seat %p surface %p",
|
||||
seat, seat->pointer_info.focus));
|
||||
|
||||
if (wayland_display->seat_version < WL_POINTER_HAS_FRAME)
|
||||
if (display_wayland->seat_version < WL_POINTER_HAS_FRAME)
|
||||
gdk_wayland_seat_flush_frame_event (seat);
|
||||
}
|
||||
|
||||
@ -1261,7 +1261,7 @@ pointer_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
@ -1272,7 +1272,7 @@ pointer_handle_leave (void *data,
|
||||
if (!seat->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
event = gdk_wayland_seat_get_frame_event (seat, GDK_LEAVE_NOTIFY);
|
||||
event->crossing.window = g_object_ref (seat->pointer_info.focus);
|
||||
@ -1305,7 +1305,7 @@ pointer_handle_leave (void *data,
|
||||
|
||||
seat->pointer_info.focus = NULL;
|
||||
|
||||
if (wayland_display->seat_version < WL_POINTER_HAS_FRAME)
|
||||
if (display_wayland->seat_version < WL_POINTER_HAS_FRAME)
|
||||
gdk_wayland_seat_flush_frame_event (seat);
|
||||
}
|
||||
|
||||
@ -2653,7 +2653,7 @@ seat_handle_capabilities (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("seat %p with %s%s%s", wl_seat,
|
||||
@ -2682,10 +2682,10 @@ seat_handle_capabilities (void *data,
|
||||
device_manager->devices =
|
||||
g_list_prepend (device_manager->devices, seat->pointer);
|
||||
|
||||
if (wayland_display->pointer_gestures)
|
||||
if (display_wayland->pointer_gestures)
|
||||
{
|
||||
seat->wp_pointer_gesture_swipe =
|
||||
zwp_pointer_gestures_v1_get_swipe_gesture (wayland_display->pointer_gestures,
|
||||
zwp_pointer_gestures_v1_get_swipe_gesture (display_wayland->pointer_gestures,
|
||||
seat->wl_pointer);
|
||||
zwp_pointer_gesture_swipe_v1_set_user_data (seat->wp_pointer_gesture_swipe,
|
||||
seat);
|
||||
@ -2693,7 +2693,7 @@ seat_handle_capabilities (void *data,
|
||||
&gesture_swipe_listener, seat);
|
||||
|
||||
seat->wp_pointer_gesture_pinch =
|
||||
zwp_pointer_gestures_v1_get_pinch_gesture (wayland_display->pointer_gestures,
|
||||
zwp_pointer_gestures_v1_get_pinch_gesture (display_wayland->pointer_gestures,
|
||||
seat->wl_pointer);
|
||||
zwp_pointer_gesture_pinch_v1_set_user_data (seat->wp_pointer_gesture_pinch,
|
||||
seat);
|
||||
@ -3096,7 +3096,7 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = zwp_tablet_v1_get_user_data (wp_tablet);
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWindow *window = wl_surface_get_user_data (surface);
|
||||
GdkEvent *event;
|
||||
|
||||
@ -3108,7 +3108,7 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
tool->current_tablet = tablet;
|
||||
tablet->current_tool = tool;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
tablet->pointer_info.enter_serial = serial;
|
||||
|
||||
tablet->pointer_info.focus = g_object_ref (window);
|
||||
@ -3165,7 +3165,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
|
||||
guint button)
|
||||
{
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_wayland_tablet_get_frame_event (tablet, evtype);
|
||||
@ -3176,7 +3176,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
|
||||
event->button.time = tablet->pointer_info.time;
|
||||
event->button.state = device_get_modifiers (tablet->master);
|
||||
event->button.button = button;
|
||||
gdk_event_set_screen (event, wayland_display->screen);
|
||||
gdk_event_set_screen (event, display_wayland->screen);
|
||||
|
||||
get_coordinates (tablet->master,
|
||||
&event->button.x,
|
||||
@ -3193,12 +3193,12 @@ tablet_tool_handle_down (void *data,
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!tablet->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
tablet->pointer_info.press_serial = serial;
|
||||
|
||||
tablet_create_button_event_frame (tablet, GDK_BUTTON_PRESS, GDK_BUTTON_PRIMARY);
|
||||
@ -3441,14 +3441,14 @@ tablet_seat_handle_tablet_added (void *data,
|
||||
struct zwp_tablet_v1 *wp_tablet)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandTabletData *tablet;
|
||||
|
||||
tablet = g_new0 (GdkWaylandTabletData, 1);
|
||||
tablet->seat = GDK_SEAT (seat);
|
||||
tablet->pointer_info.current_output_scale = 1;
|
||||
tablet->pointer_info.pointer_surface =
|
||||
wl_compositor_create_surface (wayland_display->compositor);
|
||||
wl_compositor_create_surface (display_wayland->compositor);
|
||||
tablet->wp_tablet = wp_tablet;
|
||||
|
||||
seat->tablets = g_list_prepend (seat->tablets, tablet);
|
||||
@ -3530,11 +3530,11 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
{
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
|
||||
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
guint32 scale;
|
||||
GSList *l;
|
||||
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
if (display_wayland->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
return;
|
||||
@ -3544,7 +3544,7 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
for (l = pointer->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
|
||||
_gdk_wayland_screen_get_output_scale (display_wayland->screen,
|
||||
l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@
|
||||
* ]|
|
||||
*/
|
||||
|
||||
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display);
|
||||
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDisplay, gdk_wayland_display, GDK_TYPE_DISPLAY)
|
||||
|
||||
@ -111,9 +111,9 @@ xdg_shell_ping (void *data,
|
||||
struct xdg_shell *xdg_shell,
|
||||
uint32_t serial)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = data;
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
|
||||
@ -876,18 +876,18 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
gint size)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY(display);
|
||||
struct wl_cursor_theme *theme;
|
||||
int i;
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
g_assert (display_wayland);
|
||||
g_assert (display_wayland->shm);
|
||||
|
||||
if (g_strcmp0 (name, wayland_display->cursor_theme_name) == 0 &&
|
||||
wayland_display->cursor_theme_size == size)
|
||||
if (g_strcmp0 (name, display_wayland->cursor_theme_name) == 0 &&
|
||||
display_wayland->cursor_theme_size == size)
|
||||
return;
|
||||
|
||||
theme = wl_cursor_theme_load (name, size, wayland_display->shm);
|
||||
theme = wl_cursor_theme_load (name, size, display_wayland->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
g_warning ("Failed to load cursor theme %s", name);
|
||||
@ -896,87 +896,87 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
|
||||
for (i = 0; i < GDK_WAYLAND_THEME_SCALES_COUNT; i++)
|
||||
{
|
||||
if (wayland_display->scaled_cursor_themes[i])
|
||||
if (display_wayland->scaled_cursor_themes[i])
|
||||
{
|
||||
wl_cursor_theme_destroy (wayland_display->scaled_cursor_themes[i]);
|
||||
wayland_display->scaled_cursor_themes[i] = NULL;
|
||||
wl_cursor_theme_destroy (display_wayland->scaled_cursor_themes[i]);
|
||||
display_wayland->scaled_cursor_themes[i] = NULL;
|
||||
}
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[0] = theme;
|
||||
if (wayland_display->cursor_theme_name != NULL)
|
||||
g_free (wayland_display->cursor_theme_name);
|
||||
wayland_display->cursor_theme_name = g_strdup (name);
|
||||
wayland_display->cursor_theme_size = size;
|
||||
display_wayland->scaled_cursor_themes[0] = theme;
|
||||
if (display_wayland->cursor_theme_name != NULL)
|
||||
g_free (display_wayland->cursor_theme_name);
|
||||
display_wayland->cursor_theme_name = g_strdup (name);
|
||||
display_wayland->cursor_theme_size = size;
|
||||
|
||||
_gdk_wayland_display_update_cursors (wayland_display);
|
||||
_gdk_wayland_display_update_cursors (display_wayland);
|
||||
}
|
||||
|
||||
struct wl_cursor_theme *
|
||||
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *display_wayland,
|
||||
guint scale)
|
||||
{
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
g_assert (wayland_display->cursor_theme_name);
|
||||
g_assert (display_wayland->cursor_theme_name);
|
||||
g_assert (scale <= GDK_WAYLAND_MAX_THEME_SCALE);
|
||||
g_assert (scale >= 1);
|
||||
|
||||
theme = wayland_display->scaled_cursor_themes[scale - 1];
|
||||
theme = display_wayland->scaled_cursor_themes[scale - 1];
|
||||
if (!theme)
|
||||
{
|
||||
theme = wl_cursor_theme_load (wayland_display->cursor_theme_name,
|
||||
wayland_display->cursor_theme_size * scale,
|
||||
wayland_display->shm);
|
||||
theme = wl_cursor_theme_load (display_wayland->cursor_theme_name,
|
||||
display_wayland->cursor_theme_size * scale,
|
||||
display_wayland->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
g_warning ("Failed to load cursor theme %s with scale %u",
|
||||
wayland_display->cursor_theme_name, scale);
|
||||
display_wayland->cursor_theme_name, scale);
|
||||
return NULL;
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[scale - 1] = theme;
|
||||
display_wayland->scaled_cursor_themes[scale - 1] = theme;
|
||||
}
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
|
||||
_gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
|
||||
{
|
||||
guint size;
|
||||
const gchar *name;
|
||||
GValue v = G_VALUE_INIT;
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
g_assert (display_wayland);
|
||||
g_assert (display_wayland->shm);
|
||||
|
||||
g_value_init (&v, G_TYPE_INT);
|
||||
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-size", &v))
|
||||
if (gdk_screen_get_setting (display_wayland->screen, "gtk-cursor-theme-size", &v))
|
||||
size = g_value_get_int (&v);
|
||||
else
|
||||
size = 32;
|
||||
g_value_unset (&v);
|
||||
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-name", &v))
|
||||
if (gdk_screen_get_setting (display_wayland->screen, "gtk-cursor-theme-name", &v))
|
||||
name = g_value_get_string (&v);
|
||||
else
|
||||
name = "default";
|
||||
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (display_wayland), name, size);
|
||||
g_value_unset (&v);
|
||||
}
|
||||
|
||||
guint32
|
||||
_gdk_wayland_display_get_serial (GdkWaylandDisplay *wayland_display)
|
||||
_gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland)
|
||||
{
|
||||
return wayland_display->serial;
|
||||
return display_wayland->serial;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display,
|
||||
_gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
|
||||
guint32 serial)
|
||||
{
|
||||
wayland_display->serial = serial;
|
||||
display_wayland->serial = serial;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1170,7 +1170,7 @@ _gdk_wayland_is_shm_surface (cairo_surface_t *surface)
|
||||
GdkWaylandSelection *
|
||||
gdk_wayland_display_get_selection (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
return wayland_display->selection;
|
||||
return display_wayland->selection;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
|
||||
guint32 time)
|
||||
{
|
||||
GdkDisplay *display = gdk_device_get_display (gdk_drag_context_get_device (context));
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDragContext *wayland_context;
|
||||
struct wl_data_offer *wl_offer;
|
||||
GdkAtom selection;
|
||||
@ -318,7 +318,7 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
|
||||
{
|
||||
gdk_wayland_drag_context_commit_status (context);
|
||||
|
||||
if (wayland_display->data_device_manager_version >=
|
||||
if (display_wayland->data_device_manager_version >=
|
||||
WL_DATA_OFFER_FINISH_SINCE_VERSION)
|
||||
wl_data_offer_finish (wl_offer);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ void _gdk_wayland_display_init_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display);
|
||||
|
||||
struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *display_wayland,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
@ -226,8 +226,9 @@ void _gdk_wayland_screen_set_has_gtk_shell (GdkScreen *screen);
|
||||
void _gdk_wayland_window_set_grab_seat (GdkWindow *window,
|
||||
GdkSeat *seat);
|
||||
|
||||
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *wayland_display);
|
||||
void _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display, guint32 serial);
|
||||
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
|
||||
void _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
|
||||
guint32 serial);
|
||||
|
||||
cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
|
||||
int width,
|
||||
|
@ -664,9 +664,10 @@ struct gtk_shell1_listener gdk_screen_gtk_shell_listener = {
|
||||
void
|
||||
_gdk_wayland_screen_set_has_gtk_shell (GdkScreen *screen)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (GDK_WAYLAND_SCREEN (screen)->display);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (GDK_WAYLAND_SCREEN (screen)->display);
|
||||
|
||||
gtk_shell1_add_listener (wayland_display->gtk_shell,
|
||||
gtk_shell1_add_listener (display_wayland->gtk_shell,
|
||||
&gdk_screen_gtk_shell_listener,
|
||||
screen);
|
||||
}
|
||||
|
@ -1453,7 +1453,7 @@ gboolean
|
||||
gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
|
||||
uint32_t action)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
struct wl_data_offer *offer;
|
||||
uint32_t all_actions = 0;
|
||||
|
||||
@ -1467,7 +1467,7 @@ gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
|
||||
WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE |
|
||||
WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK;
|
||||
|
||||
if (wayland_display->data_device_manager_version >=
|
||||
if (display_wayland->data_device_manager_version >=
|
||||
WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION)
|
||||
wl_data_offer_set_actions (offer, all_actions, action);
|
||||
return TRUE;
|
||||
|
@ -291,12 +291,12 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_screen_get_display (screen));
|
||||
GdkWindow *window;
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
window = _gdk_display_create_window (GDK_DISPLAY (wayland_display));
|
||||
window = _gdk_display_create_window (GDK_DISPLAY (display_wayland));
|
||||
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
|
||||
window->impl_window = window;
|
||||
window->visual = gdk_screen_get_system_visual (screen);
|
||||
@ -304,7 +304,7 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
|
||||
if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
|
||||
gdk_screen_get_n_monitors (screen) > 0)
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
|
||||
@ -428,7 +428,8 @@ frame_callback (void *data,
|
||||
{
|
||||
GdkWindow *window = data;
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
|
||||
GdkFrameTimings *timings;
|
||||
|
||||
@ -457,8 +458,9 @@ frame_callback (void *data,
|
||||
{
|
||||
/* We pick a random output out of the outputs that the window touches
|
||||
* The rate here is in milli-hertz */
|
||||
int refresh_rate = _gdk_wayland_screen_get_output_refresh_rate (wayland_display->screen,
|
||||
impl->display_server.outputs->data);
|
||||
int refresh_rate =
|
||||
_gdk_wayland_screen_get_output_refresh_rate (display_wayland->screen,
|
||||
impl->display_server.outputs->data);
|
||||
if (refresh_rate != 0)
|
||||
timings->refresh_interval = G_GINT64_CONSTANT(1000000000) / refresh_rate;
|
||||
}
|
||||
@ -552,11 +554,12 @@ static void
|
||||
window_update_scale (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
guint32 scale;
|
||||
GSList *l;
|
||||
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
if (display_wayland->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
return;
|
||||
@ -566,7 +569,7 @@ window_update_scale (GdkWindow *window)
|
||||
for (l = impl->display_server.outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen, l->data);
|
||||
_gdk_wayland_screen_get_output_scale (display_wayland->screen, l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
@ -593,7 +596,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWindowImplWayland *impl;
|
||||
GdkFrameClock *frame_clock;
|
||||
const char *title;
|
||||
@ -616,7 +619,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
g_object_ref (window);
|
||||
|
||||
/* More likely to be right than just assuming 1 */
|
||||
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
|
||||
if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
|
||||
gdk_screen_get_n_monitors (screen) > 0)
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user