Mercurial > minori
annotate dep/animia/src/win/wayland.cc @ 221:53211cb1e7f5
library: add initial library stuff
nice
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 08 Jan 2024 13:21:08 -0500 |
parents | 2f6d27fcdf7d |
children | 84e0a3c4737a |
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, |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
59 .parent = zwlr_foreign_handle_handle_parent |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
60 }; |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
61 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
62 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
|
63 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
|
64 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
|
65 if (!windows) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
66 return; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
67 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
68 windows->push_back({0}); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
69 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
|
70 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
71 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
72 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
|
73 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
74 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
75 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
|
76 .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
|
77 .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
|
78 }; |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
79 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
80 /* ext_foreign_handle stuff */ |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
81 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
|
82 const char* app_id) { |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
83 if (app_id) |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
84 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
|
85 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
86 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
87 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
|
88 const char* title) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
89 if (title) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
90 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
|
91 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
92 |
221
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
93 static void ext_foreign_handle_handle_identifier(void*, ext_foreign_toplevel_handle_v1*, const char* identifier) { |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
94 if (identifier) |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
95 reinterpret_cast<Window*>(data)->id = identifier; |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
96 } |
53211cb1e7f5
library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents:
219
diff
changeset
|
97 |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
98 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
|
99 if (handle) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
100 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
|
101 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
102 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
103 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
|
104 } |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
105 |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
106 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
|
107 .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
|
108 .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
|
109 .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
|
110 .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
|
111 .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
|
112 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
113 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
114 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
|
115 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
|
116 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
|
117 if (!windows) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
118 return; |
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 windows->push_back({0}); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
121 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
|
122 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
123 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
124 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
|
125 } |
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 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
|
128 .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
|
129 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
130 /* -- Global data -- */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
131 struct global_data { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
132 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
|
133 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
|
134 std::vector<Window> windows; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
135 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
136 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
137 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
|
138 uint32_t version) { |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
139 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
|
140 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
141 if (!std::strcmp(interface, ext_foreign_toplevel_list_v1_interface.name)) { |
219
2f6d27fcdf7d
dep/animia: wayland: fixup wlroots code
Paper <paper@paper.us.eu.org>
parents:
216
diff
changeset
|
142 if (global->zwlr_toplevel_mgr) |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
143 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
|
144 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
145 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
|
146 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
|
147 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
148 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
|
149 &global->windows); |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
150 } else if (!std::strcmp(interface, zwlr_foreign_toplevel_manager_v1_interface.name)) { |
219
2f6d27fcdf7d
dep/animia: wayland: fixup wlroots code
Paper <paper@paper.us.eu.org>
parents:
216
diff
changeset
|
151 if (global->ext_toplevel_list || version < 3) |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
152 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
|
153 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
154 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
|
155 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
|
156 |
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
157 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
|
158 &global->windows); |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
159 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
160 } |
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 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
|
163 } |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
164 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
165 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
|
166 .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
|
167 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
168 /* BAH! humbug... */ |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
169 struct sync_data { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
170 bool loop = true; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
171 int sync = 0; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
172 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
173 struct global_data global = {0}; |
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 struct wl_callback* callback = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
176 struct wl_display* display = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
177 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
178 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
179 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
|
180 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
|
181 .done = sync_handle_done, |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
182 }; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
183 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
184 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
|
185 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
|
186 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
187 wl_callback_destroy(callback); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
188 sync->callback = nullptr; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
189 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
190 if (sync->sync == 0) { |
219
2f6d27fcdf7d
dep/animia: wayland: fixup wlroots code
Paper <paper@paper.us.eu.org>
parents:
216
diff
changeset
|
191 if (!sync->global.ext_toplevel_list && !sync->global.zwlr_toplevel_mgr) { |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
192 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
|
193 "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
|
194 << std::endl; |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
195 sync->loop = false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
196 return; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
197 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
198 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
199 sync->sync++; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
200 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
|
201 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
|
202 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
203 /* 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
|
204 * ext_foreign_toplevel_list. |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
205 * |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
206 * 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
|
207 */ |
199
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
208 } else { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
209 /* 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
|
210 sync->loop = false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
211 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
212 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
213 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
214 /* 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
|
215 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
|
216 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
|
217 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
218 if (!sync.display) { |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
219 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
|
220 return false; |
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 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
223 struct global_data 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 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
|
226 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
|
227 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
228 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
|
229 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
|
230 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
231 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
|
232 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
233 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
|
234 if (!window_proc({0}, window)) |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
235 return false; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
236 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
237 wl_display_disconnect(sync.display); |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
238 |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
239 return true; |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
240 } |
9f3534f6b8c4
dep/animia: initial Wayland support, drop non-working kvm fd plugin
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
241 |
216
8a482049b968
dep/animia: win/wayland: add UNTESTED support for wlroots protocols
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
242 } // namespace animia::internal::wayland |