File: test-layer-surface-click-activated-popup.c

package info (click to toggle)
gtk4-layer-shell 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 852 kB
  • sloc: ansic: 5,701; python: 421; xml: 417; makefile: 10
file content (39 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "integration-test-common.h"

static GtkWindow* layer_window;
static GtkWidget* popuper;

static void callback_0() {
    EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface);

    layer_window = GTK_WINDOW(gtk_window_new());
    popuper = popup_widget_new();
    gtk_window_set_child(layer_window, popuper);
    gtk_layer_init_for_window(layer_window);
    gtk_window_present(layer_window);
}

static void callback_1() {
    EXPECT_MESSAGE(xdg_wm_base .get_xdg_surface);
    EXPECT_MESSAGE(xdg_surface .get_popup nil);
    EXPECT_MESSAGE(zwlr_layer_surface_v1 .get_popup);
    EXPECT_MESSAGE(xdg_popup .grab);

    UNEXPECT_MESSAGE(xdg_popup .destroy);

    send_command("click_latest_surface 10 10", "latest_surface_clicked");
}

static void callback_2() {
    EXPECT_MESSAGE(xdg_popup .destroy);
    EXPECT_MESSAGE(xdg_surface .destroy);
    EXPECT_MESSAGE(zwlr_layer_surface_v1 .destroy);

    gtk_window_close(layer_window);
}

TEST_CALLBACKS(
    callback_0,
    callback_1,
    callback_2,
)