Lines Matching refs:xwl_screen

151 struct xwl_screen *
173 if (prop->propertyName != xwl_window->xwl_screen->allow_commits_prop) in xwl_window_set_allow_commits_from_property()
216 struct xwl_screen *xwl_screen; in xwl_property_callback() local
226 xwl_screen = xwl_screen_get(screen); in xwl_property_callback()
228 if (rec->prop->propertyName == xwl_screen->allow_commits_prop) in xwl_property_callback()
235 struct xwl_screen *xwl_screen = xwl_screen_get(screen); in xwl_close_screen() local
242 &xwl_screen->output_list, link) in xwl_close_screen()
246 &xwl_screen->seat_list, link) in xwl_close_screen()
249 xwl_screen_release_tablet_manager(xwl_screen); in xwl_close_screen()
251 RemoveNotifyFd(xwl_screen->wayland_fd); in xwl_close_screen()
253 wl_display_disconnect(xwl_screen->display); in xwl_close_screen()
255 screen->CloseScreen = xwl_screen->CloseScreen; in xwl_close_screen()
256 free(xwl_screen); in xwl_close_screen()
278 xwl_screen_get_default_seat(struct xwl_screen *xwl_screen) in xwl_screen_get_default_seat() argument
280 if (xorg_list_is_empty(&xwl_screen->seat_list)) in xwl_screen_get_default_seat()
283 return container_of(xwl_screen->seat_list.prev, in xwl_screen_get_default_seat()
296 struct xwl_screen *xwl_screen = xwl_screen_get(screen); in xwl_cursor_warped_to() local
302 xwl_seat = xwl_screen_get_default_seat(xwl_screen); in xwl_cursor_warped_to()
338 struct xwl_screen *xwl_screen = xwl_screen_get(screen); in xwl_cursor_confined_to() local
343 xwl_seat = xwl_screen_get_default_seat(xwl_screen); in xwl_cursor_confined_to()
375 struct xwl_screen *xwl_screen; in damage_report() local
380 xwl_screen = xwl_window->xwl_screen; in damage_report()
394 xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list); in damage_report()
487 xwl_window->xwl_screen->allow_commits_prop, in xwl_window_init_allow_commits()
518 DeliverEventsToWindow(dev, xwl_window->xwl_screen->screen->root, in send_surface_id_event()
526 struct xwl_screen *xwl_screen; in ensure_surface_for_window() local
533 xwl_screen = xwl_screen_get(screen); in ensure_surface_for_window()
535 if (xwl_screen->rootless) { in ensure_surface_for_window()
548 xwl_window->xwl_screen = xwl_screen; in ensure_surface_for_window()
550 xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor); in ensure_surface_for_window()
556 if (!xwl_screen->rootless) { in ensure_surface_for_window()
558 wl_shell_get_shell_surface(xwl_screen->shell, xwl_window->surface); in ensure_surface_for_window()
569 region = wl_compositor_create_region(xwl_screen->compositor); in ensure_surface_for_window()
581 wl_display_flush(xwl_screen->display); in ensure_surface_for_window()
613 struct xwl_screen *xwl_screen; in xwl_realize_window() local
616 xwl_screen = xwl_screen_get(screen); in xwl_realize_window()
618 screen->RealizeWindow = xwl_screen->RealizeWindow; in xwl_realize_window()
620 xwl_screen->RealizeWindow = screen->RealizeWindow; in xwl_realize_window()
626 if (xwl_screen->rootless && !window->parent) { in xwl_realize_window()
627 BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height }; in xwl_realize_window()
634 if (xwl_screen->rootless ? in xwl_realize_window()
649 struct xwl_screen *xwl_screen; in xwl_unrealize_window() local
654 xwl_screen = xwl_screen_get(screen); in xwl_unrealize_window()
656 xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { in xwl_unrealize_window()
675 screen->UnrealizeWindow = xwl_screen->UnrealizeWindow; in xwl_unrealize_window()
677 xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; in xwl_unrealize_window()
692 if (xwl_screen->present) { in xwl_unrealize_window()
720 struct xwl_screen *xwl_screen; in xwl_set_window_pixmap() local
722 xwl_screen = xwl_screen_get(screen); in xwl_set_window_pixmap()
724 screen->SetWindowPixmap = xwl_screen->SetWindowPixmap; in xwl_set_window_pixmap()
726 xwl_screen->SetWindowPixmap = screen->SetWindowPixmap; in xwl_set_window_pixmap()
746 if (xwl_window->xwl_screen->present) { in frame_callback()
774 struct xwl_screen *xwl_screen = xwl_screen_get(screen); in xwl_destroy_window() local
778 if (xwl_screen->present) in xwl_destroy_window()
782 screen->DestroyWindow = xwl_screen->DestroyWindow; in xwl_destroy_window()
789 xwl_screen->DestroyWindow = screen->DestroyWindow; in xwl_destroy_window()
798 struct xwl_screen *xwl_screen = xwl_window->xwl_screen; in xwl_window_post_damage() local
808 pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window); in xwl_window_post_damage()
811 if (xwl_screen->glamor) in xwl_window_post_damage()
819 if (xwl_screen->glamor) in xwl_window_post_damage()
845 xwl_screen_post_damage(struct xwl_screen *xwl_screen) in xwl_screen_post_damage() argument
853 &xwl_screen->damage_window_list, link_damage) { in xwl_screen_post_damage()
863 if (xwl_screen->glamor && !xwl_glamor_allow_commits(xwl_window)) in xwl_screen_post_damage()
876 if (xwl_screen->glamor && in xwl_screen_post_damage()
877 xwl_screen->egl_backend == &xwl_screen->gbm_backend) { in xwl_screen_post_damage()
878 glamor_block_handler(xwl_screen->screen); in xwl_screen_post_damage()
893 struct xwl_screen *xwl_screen = data; in registry_global() local
896 xwl_screen->compositor = in registry_global()
900 xwl_screen->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); in registry_global()
903 xwl_screen->shell = in registry_global()
907 if (xwl_output_create(xwl_screen, id)) in registry_global()
908 xwl_screen->expecting_event++; in registry_global()
911 xwl_screen->xdg_output_manager = in registry_global()
913 xwl_screen_init_xdg_output(xwl_screen); in registry_global()
916 else if (xwl_screen->glamor) { in registry_global()
917 xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, in registry_global()
926 struct xwl_screen *xwl_screen = data; in global_remove() local
930 &xwl_screen->output_list, link) { in global_remove()
944 xwl_read_events (struct xwl_screen *xwl_screen) in xwl_read_events() argument
948 if (xwl_screen->wait_flush) in xwl_read_events()
951 ret = wl_display_read_events(xwl_screen->display); in xwl_read_events()
955 xwl_screen->prepare_read = 0; in xwl_read_events()
957 ret = wl_display_dispatch_pending(xwl_screen->display); in xwl_read_events()
963 xwl_display_pollout (struct xwl_screen *xwl_screen, int timeout) in xwl_display_pollout() argument
967 poll_fd.fd = wl_display_get_fd(xwl_screen->display); in xwl_display_pollout()
974 xwl_dispatch_events (struct xwl_screen *xwl_screen) in xwl_dispatch_events() argument
979 if (xwl_screen->wait_flush) in xwl_dispatch_events()
982 while (xwl_screen->prepare_read == 0 && in xwl_dispatch_events()
983 wl_display_prepare_read(xwl_screen->display) == -1) { in xwl_dispatch_events()
984 ret = wl_display_dispatch_pending(xwl_screen->display); in xwl_dispatch_events()
990 xwl_screen->prepare_read = 1; in xwl_dispatch_events()
993 ready = xwl_display_pollout(xwl_screen, 5); in xwl_dispatch_events()
998 ret = wl_display_flush(xwl_screen->display); in xwl_dispatch_events()
1003 xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); in xwl_dispatch_events()
1009 struct xwl_screen *xwl_screen = data; in socket_handler() local
1011 xwl_read_events (xwl_screen); in socket_handler()
1022 struct xwl_screen *xwl_screen = data; in block_handler() local
1024 xwl_screen_post_damage(xwl_screen); in block_handler()
1025 xwl_dispatch_events (xwl_screen); in block_handler()
1029 xwl_sync_events (struct xwl_screen *xwl_screen) in xwl_sync_events() argument
1031 xwl_dispatch_events (xwl_screen); in xwl_sync_events()
1032 xwl_read_events (xwl_screen); in xwl_sync_events()
1036 xwl_screen_roundtrip(struct xwl_screen *xwl_screen) in xwl_screen_roundtrip() argument
1040 ret = wl_display_roundtrip(xwl_screen->display); in xwl_screen_roundtrip()
1041 while (ret >= 0 && xwl_screen->expecting_event) in xwl_screen_roundtrip()
1042 ret = wl_display_roundtrip(xwl_screen->display); in xwl_screen_roundtrip()
1051 struct xwl_screen *xwl_screen = arg; in add_client_fd() local
1053 if (!AddClientOnOpenFD(xwl_screen->wm_fd)) in add_client_fd()
1062 listen_on_fds(struct xwl_screen *xwl_screen) in listen_on_fds() argument
1066 for (i = 0; i < xwl_screen->listen_fd_count; i++) in listen_on_fds()
1067 ListenOnOpenFD(xwl_screen->listen_fds[i], FALSE); in listen_on_fds()
1074 struct xwl_screen *xwl_screen = data; in wm_selection_callback() local
1084 listen_on_fds(xwl_screen); in wm_selection_callback()
1086 DeleteCallback(&SelectionCallback, wm_selection_callback, xwl_screen); in wm_selection_callback()
1093 struct xwl_screen *xwl_screen; in xwl_screen_init() local
1098 xwl_screen = calloc(1, sizeof *xwl_screen); in xwl_screen_init()
1099 if (xwl_screen == NULL) in xwl_screen_init()
1101 xwl_screen->wm_fd = -1; in xwl_screen_init()
1112 dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen); in xwl_screen_init()
1113 xwl_screen->screen = pScreen; in xwl_screen_init()
1116 xwl_screen->glamor = 1; in xwl_screen_init()
1121 xwl_screen->rootless = 1; in xwl_screen_init()
1137 xwl_screen->wm_fd = atoi(argv[i + 1]); in xwl_screen_init()
1139 TimerSet(NULL, 0, 1, add_client_fd, xwl_screen); in xwl_screen_init()
1142 if (xwl_screen->listen_fd_count == in xwl_screen_init()
1143 ARRAY_SIZE(xwl_screen->listen_fds)) in xwl_screen_init()
1145 ARRAY_SIZE(xwl_screen->listen_fds)); in xwl_screen_init()
1147 xwl_screen->listen_fds[xwl_screen->listen_fd_count++] = in xwl_screen_init()
1152 xwl_screen->glamor = 0; in xwl_screen_init()
1164 if (xwl_screen->glamor) in xwl_screen_init()
1165 xwl_glamor_init_backends(xwl_screen, use_eglstreams); in xwl_screen_init()
1170 if (xwl_screen->rootless) in xwl_screen_init()
1171 xwl_screen->root_clip_mode = ROOT_CLIP_INPUT_ONLY; in xwl_screen_init()
1173 xwl_screen->root_clip_mode = ROOT_CLIP_FULL; in xwl_screen_init()
1175 if (xwl_screen->listen_fd_count > 0) { in xwl_screen_init()
1176 if (xwl_screen->wm_fd >= 0) in xwl_screen_init()
1177 AddCallback(&SelectionCallback, wm_selection_callback, xwl_screen); in xwl_screen_init()
1179 listen_on_fds(xwl_screen); in xwl_screen_init()
1182 xorg_list_init(&xwl_screen->output_list); in xwl_screen_init()
1183 xorg_list_init(&xwl_screen->seat_list); in xwl_screen_init()
1184 xorg_list_init(&xwl_screen->damage_window_list); in xwl_screen_init()
1185 xwl_screen->depth = 24; in xwl_screen_init()
1190 xwl_screen->display = wl_display_connect(NULL); in xwl_screen_init()
1191 if (xwl_screen->display == NULL) { in xwl_screen_init()
1196 if (!xwl_screen_init_output(xwl_screen)) in xwl_screen_init()
1199 xwl_screen->expecting_event = 0; in xwl_screen_init()
1200 xwl_screen->registry = wl_display_get_registry(xwl_screen->display); in xwl_screen_init()
1201 wl_registry_add_listener(xwl_screen->registry, in xwl_screen_init()
1202 &registry_listener, xwl_screen); in xwl_screen_init()
1203 xwl_screen_roundtrip(xwl_screen); in xwl_screen_init()
1205 if (!xwl_screen->rootless && !xwl_screen->shell) { in xwl_screen_init()
1210 bpc = xwl_screen->depth / 3; in xwl_screen_init()
1211 green_bpc = xwl_screen->depth - 2 * bpc; in xwl_screen_init()
1216 miSetVisualTypesAndMasks(xwl_screen->depth, in xwl_screen_init()
1224 xwl_screen->width, xwl_screen->height, in xwl_screen_init()
1226 BitsPerPixel(xwl_screen->depth)); in xwl_screen_init()
1237 xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display); in xwl_screen_init()
1238 SetNotifyFd(xwl_screen->wayland_fd, socket_handler, X_NOTIFY_READ, xwl_screen); in xwl_screen_init()
1239 RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, xwl_screen); in xwl_screen_init()
1248 if (!xwl_screen_init_cursor(xwl_screen)) in xwl_screen_init()
1252 if (xwl_screen->glamor) { in xwl_screen_init()
1253 xwl_glamor_select_backend(xwl_screen, use_eglstreams); in xwl_screen_init()
1255 if (xwl_screen->egl_backend == NULL || !xwl_glamor_init(xwl_screen)) { in xwl_screen_init()
1257 xwl_screen->glamor = 0; in xwl_screen_init()
1261 if (xwl_screen->glamor && xwl_screen->rootless) in xwl_screen_init()
1262 xwl_screen->present = xwl_present_init(pScreen); in xwl_screen_init()
1265 if (!xwl_screen->glamor) { in xwl_screen_init()
1266 xwl_screen->CreateScreenResources = pScreen->CreateScreenResources; in xwl_screen_init()
1272 xwl_screen->RealizeWindow = pScreen->RealizeWindow; in xwl_screen_init()
1275 xwl_screen->UnrealizeWindow = pScreen->UnrealizeWindow; in xwl_screen_init()
1278 xwl_screen->DestroyWindow = pScreen->DestroyWindow; in xwl_screen_init()
1281 xwl_screen->CloseScreen = pScreen->CloseScreen; in xwl_screen_init()
1284 if (xwl_screen->rootless) { in xwl_screen_init()
1285 xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap; in xwl_screen_init()
1292 xwl_screen->allow_commits_prop = MakeAtom(allow_commits, in xwl_screen_init()
1295 if (xwl_screen->allow_commits_prop == BAD_RESOURCE) in xwl_screen_init()
1300 xwl_screen_roundtrip(xwl_screen); in xwl_screen_init()