手機 - Motorola XT894 - Sailfish OS - Wayland (Client) - Connect Server



參考資訊:
https://jan.newmarch.name/Wayland/index.html
https://wayland.freedesktop.org/docs/html/apa.html
https://bugaevc.gitbooks.io/writing-wayland-clients/content/

main.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <wayland-client.h>
   
int main(int argc, char **argv)
{
    struct wl_display *dis = wl_display_connect(NULL);
   
    if (dis == NULL) {
        printf("failed to connect !\n");
        return -1;
    }
  
    printf("connected !\n");
    wl_display_disconnect(dis);
    return 0;
}

編譯、執行

$ gcc main.c -o main -lwayland-client
$ ./main
    connected !