Mercurial > minori
annotate dep/animia/src/win/wayland.cc @ 216:8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 07 Jan 2024 12:42:10 -0500 |
parents | 9f3534f6b8c4 |
children | 2f6d27fcdf7d |
rev | line source |
---|---|
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
1 #include "animia/win/wayland.h" |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
2 #include "animia.h" |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
3 #include "animia/win.h" |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
4 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
5 #include <cstring> |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
6 #include <iostream> |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
7 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
8 #include "animia/win/wayland/ext-foreign-toplevel-list-v1.h" |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
9 #include "animia/win/wayland/wlr-foreign-toplevel-management-unstable-v1.h" |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
10 #include <wayland-client.h> |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
11 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
12 namespace animia::internal::wayland { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
13 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
14 /* zwlr-foreign-toplevel-management-v1 implementation */ |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
15 static void zwlr_foreign_handle_handle_title(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
16 const char* title) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
17 if (title) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
18 reinterpret_cast<Window*>(data)->text = title; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
19 } |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
20 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
21 static void zwlr_foreign_handle_handle_app_id(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
22 const char* app_id) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
23 if (app_id) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
24 reinterpret_cast<Window*>(data)->class_name = app_id; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
25 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
26 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
27 static void zwlr_foreign_handle_handle_done(void* data, struct zwlr_foreign_toplevel_handle_v1* handle) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
28 if (handle) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
29 zwlr_foreign_toplevel_handle_v1_destroy(handle); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
30 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
31 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
32 static void zwlr_foreign_handle_handle_state(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
33 struct wl_array*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
34 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
35 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
36 static void zwlr_foreign_handle_handle_parent(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
37 struct zwlr_foreign_toplevel_handle_v1*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
38 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
39 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
40 static void zwlr_foreign_handle_handle_output_enter(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
41 struct wl_output*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
42 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
43 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
44 static void zwlr_foreign_handle_handle_output_leave(void* data, struct zwlr_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
45 struct wl_output*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
46 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
47 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
48 static void zwlr_foreign_handle_handle_closed(void* data, struct zwlr_foreign_toplevel_handle_v1* handle) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
49 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
50 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
51 static const struct zwlr_foreign_toplevel_handle_v1_listener zwlr_handle_listener = { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
52 .title = zwlr_foreign_handle_handle_title, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
53 .app_id = zwlr_foreign_handle_handle_app_id, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
54 .output_enter = zwlr_foreign_handle_handle_output_enter, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
55 .output_leave = zwlr_foreign_handle_handle_output_leave, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
56 .state = zwlr_foreign_handle_handle_state, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
57 .done = zwlr_foreign_handle_handle_done, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
58 .closed = zwlr_foreign_handle_handle_closed, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
59 .parent = zwlr_foreign_handle_handle_parent}; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
60 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
61 static void zwlr_toplevel_manager_handle_toplevel(void* data, struct zwlr_foreign_toplevel_manager_v1* manager, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
62 struct zwlr_foreign_toplevel_handle_v1* handle) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
63 std::vector<Window>* windows = reinterpret_cast<std::vector<Window>*>(data); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
64 if (!windows) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
65 return; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
66 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
67 windows->push_back({0}); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
68 zwlr_foreign_toplevel_handle_v1_add_listener(handle, &zwlr_handle_listener, &*windows->end()); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
69 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
70 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
71 static void zwlr_toplevel_manager_handle_finished(void*, struct zwlr_foreign_toplevel_manager_v1*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
72 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
73 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
74 static const struct zwlr_foreign_toplevel_manager_v1_listener zwlr_toplevel_manager_listener = { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
75 .toplevel = zwlr_toplevel_manager_handle_toplevel, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
76 .finished = zwlr_toplevel_manager_handle_finished, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
77 }; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
78 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
79 /* ext_foreign_handle stuff */ |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
80 static void ext_foreign_handle_handle_app_id(void* data, struct ext_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
81 const char* app_id) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
82 if (app_id) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
83 reinterpret_cast<Window*>(data)->class_name = app_id; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
84 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
85 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
86 static void ext_foreign_handle_handle_title(void* data, struct ext_foreign_toplevel_handle_v1* handle, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
87 const char* title) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
88 if (title) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
89 reinterpret_cast<Window*>(data)->text = title; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
90 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
91 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
92 static void ext_foreign_handle_handle_done(void* data, struct ext_foreign_toplevel_handle_v1* handle) { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
93 if (handle) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
94 ext_foreign_toplevel_handle_v1_destroy(handle); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
95 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
96 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
97 static void ext_foreign_handle_handle_closed(void*, struct ext_foreign_toplevel_handle_v1*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
98 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
99 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
100 static void ext_foreign_handle_handle_identifier(void*, ext_foreign_toplevel_handle_v1*, const char*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
101 } |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
102 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
103 static const struct ext_foreign_toplevel_handle_v1_listener ext_handle_listener = { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
104 .closed = ext_foreign_handle_handle_closed, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
105 .done = ext_foreign_handle_handle_done, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
106 .title = ext_foreign_handle_handle_title, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
107 .app_id = ext_foreign_handle_handle_app_id, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
108 .identifier = ext_foreign_handle_handle_identifier // for now |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
109 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
110 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
111 static void ext_toplevel_list_handle_toplevel(void* data, struct ext_foreign_toplevel_list_v1* list, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
112 struct ext_foreign_toplevel_handle_v1* handle) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
113 std::vector<Window>* windows = reinterpret_cast<std::vector<Window>*>(data); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
114 if (!windows) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
115 return; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
116 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
117 windows->push_back({0}); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
118 ext_foreign_toplevel_handle_v1_add_listener(handle, &ext_handle_listener, &*windows->end()); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
119 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
120 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
121 static void ext_toplevel_list_handle_finished(void*, ext_foreign_toplevel_list_v1*) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
122 } |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
123 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
124 static const struct ext_foreign_toplevel_list_v1_listener ext_toplevel_list_listener = { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
125 .toplevel = ext_toplevel_list_handle_toplevel, .finished = ext_toplevel_list_handle_finished}; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
126 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
127 /* -- Global data -- */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
128 struct global_data { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
129 struct ext_foreign_toplevel_list_v1* ext_toplevel_list = nullptr; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
130 struct zwlr_foreign_toplevel_manager_v1* zwlr_toplevel_mgr = nullptr; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
131 std::vector<Window> windows; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
132 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
133 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
134 static void registry_handle_global(void* data, struct wl_registry* registry, uint32_t name, const char* interface, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
135 uint32_t version) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
136 struct global_data* global = reinterpret_cast<struct global_data*>(data); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
137 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
138 if (!std::strcmp(interface, ext_foreign_toplevel_list_v1_interface.name)) { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
139 if (!global->zwlr_toplevel_mgr || version < 3) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
140 return; // we don't need this then |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
141 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
142 global->ext_toplevel_list = reinterpret_cast<struct ext_foreign_toplevel_list_v1*>( |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
143 wl_registry_bind(registry, name, &ext_foreign_toplevel_list_v1_interface, 1)); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
144 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
145 ext_foreign_toplevel_list_v1_add_listener(global->ext_toplevel_list, &ext_toplevel_list_listener, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
146 &global->windows); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
147 } else if (!std::strcmp(interface, zwlr_foreign_toplevel_manager_v1_interface.name)) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
148 if (!global->ext_toplevel_list) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
149 return; // we don't need this then |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
150 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
151 global->zwlr_toplevel_mgr = reinterpret_cast<struct zwlr_foreign_toplevel_manager_v1*>( |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
152 wl_registry_bind(registry, name, &zwlr_foreign_toplevel_manager_v1_interface, 1)); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
153 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
154 zwlr_foreign_toplevel_manager_v1_add_listener(global->zwlr_toplevel_mgr, &zwlr_toplevel_manager_listener, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
155 &global->windows); |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
156 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
157 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
158 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
159 static void registry_handle_global_remove(void*, wl_registry*, uint32_t) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
160 } |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
161 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
162 static const struct wl_registry_listener registry_listener = {.global = registry_handle_global, |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
163 .global_remove = registry_handle_global_remove}; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
164 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
165 /* BAH! humbug... */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
166 struct sync_data { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
167 bool loop = true; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
168 int sync = 0; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
169 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
170 struct global_data global = {0}; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
171 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
172 struct wl_callback* callback = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
173 struct wl_display* display = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
174 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
175 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
176 static void sync_handle_done(void* data, struct wl_callback* callback, uint32_t other_data); |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
177 static const struct wl_callback_listener sync_callback_listener = { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
178 .done = sync_handle_done, |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
179 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
180 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
181 static void sync_handle_done(void* data, struct wl_callback* callback, uint32_t other_data) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
182 struct sync_data* sync = reinterpret_cast<struct sync_data*>(data); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
183 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
184 wl_callback_destroy(callback); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
185 sync->callback = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
186 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
187 if (sync->sync == 0) { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
188 if (!sync->global.ext_toplevel_list || !sync->global.zwlr_toplevel_mgr) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
189 std::cerr << "animia/wayland: Wayland server doesn't support ext-foreign-toplevel-list-v1 nor " |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
190 "wlr-foreign-toplevel-management-unstable-v1!" |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
191 << std::endl; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
192 sync->loop = false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
193 return; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
194 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
195 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
196 sync->sync++; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
197 sync->callback = wl_display_sync(sync->display); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
198 wl_callback_add_listener(sync->callback, &sync_callback_listener, sync); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
199 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
200 /* we may need another sync here if there are protocol extensions for |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
201 * ext_foreign_toplevel_list. |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
202 * |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
203 * more info: https://git.sr.ht/~leon_plickat/lswt/tree/toplevel-info/item/lswt.c |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
204 */ |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
205 } else { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
206 /* we've received everything we need! */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
207 sync->loop = false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
208 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
209 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
210 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
211 /* here comes the actual function we can use */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
212 bool EnumerateWindows(window_proc_t window_proc) { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
213 struct sync_data sync = {.display = wl_display_connect(NULL)}; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
214 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
215 if (!sync.display) { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
216 std::cerr << "animia/wayland: Can't connect to display" << std::endl; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
217 return false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
218 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
219 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
220 struct global_data global; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
221 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
222 struct wl_registry* registry = wl_display_get_registry(sync.display); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
223 wl_registry_add_listener(registry, ®istry_listener, &sync.global); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
224 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
225 sync.callback = wl_display_sync(sync.display); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
226 wl_callback_add_listener(sync.callback, &sync_callback_listener, &sync); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
227 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
228 while (sync.loop && wl_display_dispatch(sync.display)); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
229 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
230 for (const auto& window : global.windows) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
231 if (!window_proc({0}, window)) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
232 return false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
233 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
234 wl_display_disconnect(sync.display); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
235 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
236 return true; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
237 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
238 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
239 } // namespace animia::internal::wayland |