| 1 | #include "integration-test-common.h" |
| 2 | |
| 3 | static GtkWindow* window; |
| 4 | |
| 5 | static void callback_0() { |
| 6 | send_command("create_output 640 480", "output_created"); |
| 7 | |
| 8 | EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface wl_output); |
| 9 | window = create_default_window(); |
| 10 | gtk_layer_init_for_window(window); |
| 11 | for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) gtk_layer_set_anchor(window, i, TRUE); |
| 12 | ASSERT_EQ(g_list_model_get_n_items(gdk_display_get_monitors(gdk_display_get_default())), 2, "%d"); |
| 13 | GdkMonitor *monitor = g_list_model_get_item(gdk_display_get_monitors(gdk_display_get_default()), 1); |
| 14 | ASSERT(GDK_IS_MONITOR(monitor)); |
| 15 | gtk_layer_set_monitor(window, monitor); |
| 16 | gtk_window_present(window); |
| 17 | } |
| 18 | |
| 19 | static void callback_1() { |
| 20 | EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface nil); |
| 21 | send_command("destroy_output 1", "output_destroyed"); |
| 22 | } |
| 23 | |
| 24 | TEST_CALLBACKS( |
| 25 | callback_0, |
| 26 | callback_1, |
| 27 | ) |