forked from AuroraMiddleware/gtk
wayland: Track wayland API changes
This commit is contained in:
parent
d9760a1d3c
commit
2ebdcf5f37
@ -145,20 +145,20 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
struct wl_input_device *input;
|
||||
|
||||
if (strcmp(interface, "compositor") == 0) {
|
||||
display_wayland->compositor = wl_compositor_create(display, id);
|
||||
} else if (strcmp(interface, "shm") == 0) {
|
||||
display_wayland->shm = wl_shm_create(display, id);
|
||||
} else if (strcmp(interface, "shell") == 0) {
|
||||
display_wayland->shell = wl_shell_create(display, id);
|
||||
if (strcmp(interface, "wl_compositor") == 0) {
|
||||
display_wayland->compositor = wl_compositor_create(display, id, 1);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm = wl_shm_create(display, id, 1);
|
||||
} else if (strcmp(interface, "wl_shell") == 0) {
|
||||
display_wayland->shell = wl_shell_create(display, id, 1);
|
||||
wl_shell_add_listener(display_wayland->shell,
|
||||
&shell_listener, display_wayland);
|
||||
} else if (strcmp(interface, "output") == 0) {
|
||||
display_wayland->output = wl_output_create(display, id);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
display_wayland->output = wl_output_create(display, id, 1);
|
||||
wl_output_add_listener(display_wayland->output,
|
||||
&output_listener, display_wayland);
|
||||
} else if (strcmp(interface, "input_device") == 0) {
|
||||
input = wl_input_device_create(display, id);
|
||||
} else if (strcmp(interface, "wl_input_device") == 0) {
|
||||
input = wl_input_device_create(display, id, 1);
|
||||
_gdk_wayland_device_manager_add_device (gdk_display->device_manager,
|
||||
input);
|
||||
}
|
||||
@ -179,7 +179,7 @@ gdk_display_init_egl(GdkDisplay *display)
|
||||
};
|
||||
|
||||
display_wayland->egl_display =
|
||||
eglGetDisplay(display_wayland->native_display);
|
||||
eglGetDisplay(display_wayland->wl_display);
|
||||
if (!eglInitialize(display_wayland->egl_display, &major, &minor)) {
|
||||
fprintf(stderr, "failed to initialize display\n");
|
||||
return FALSE;
|
||||
@ -236,12 +236,6 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
|
||||
display_wayland->wl_display = wl_display;
|
||||
|
||||
display_wayland->native_display = wl_egl_display_create(wl_display);
|
||||
if (display_wayland->native_display == NULL) {
|
||||
wl_display_destroy(wl_display);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
display_wayland->screen = _gdk_wayland_screen_new (display);
|
||||
|
||||
display->device_manager = _gdk_wayland_device_manager_new (display);
|
||||
@ -252,7 +246,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
|
||||
gdk_display_init_egl(display);
|
||||
|
||||
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
|
||||
display_wayland->event_source =
|
||||
_gdk_wayland_display_event_source_new (display);
|
||||
|
||||
gdk_input_init (display);
|
||||
|
||||
@ -282,7 +277,6 @@ gdk_wayland_display_dispose (GObject *object)
|
||||
}
|
||||
|
||||
eglTerminate(display_wayland->egl_display);
|
||||
wl_egl_display_destroy(display_wayland->native_display);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->dispose (object);
|
||||
}
|
||||
|
@ -71,7 +71,6 @@ struct _GdkDisplayWayland
|
||||
|
||||
/* Wayland fields below */
|
||||
struct wl_display *wl_display;
|
||||
struct wl_egl_display *native_display;
|
||||
struct wl_compositor *compositor;
|
||||
struct wl_shm *shm;
|
||||
struct wl_shell *shell;
|
||||
|
@ -306,8 +306,6 @@ typedef struct _GdkWaylandCairoSurfaceData {
|
||||
static void
|
||||
gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
{
|
||||
GdkDisplayWayland *display =
|
||||
GDK_DISPLAY_WAYLAND (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWaylandCairoSurfaceData *data;
|
||||
int32_t server_width, server_height, dx, dy;
|
||||
@ -337,7 +335,7 @@ gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
&gdk_wayland_cairo_key);
|
||||
if (!data->buffer)
|
||||
data->buffer =
|
||||
wl_egl_pixmap_create_buffer(display->native_display, data->pixmap);
|
||||
wl_egl_pixmap_create_buffer(data->pixmap);
|
||||
|
||||
if (impl->resize_edges & WL_SHELL_RESIZE_LEFT)
|
||||
dx = server_width - data->width;
|
||||
@ -397,8 +395,7 @@ gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
|
||||
visual = wl_display_get_premultiplied_argb_visual(display->wl_display);
|
||||
data->width = width;
|
||||
data->height = height;
|
||||
data->pixmap =
|
||||
wl_egl_pixmap_create(display->native_display, width, height, visual, 0);
|
||||
data->pixmap = wl_egl_pixmap_create(width, height, visual, 0);
|
||||
data->image =
|
||||
display->create_image(display->egl_display, NULL, EGL_NATIVE_PIXMAP_KHR,
|
||||
(EGLClientBuffer) data->pixmap, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user