@@ -59,13 +59,13 @@ void CInputMethodKeyboardGrabV2::sendKeyboardData(wlr_keyboard* keyboard) {
59
59
}
60
60
61
61
void CInputMethodKeyboardGrabV2::sendKey (uint32_t time, uint32_t key, wl_keyboard_key_state state) {
62
- const auto SERIAL = wlr_seat_client_next_serial (wlr_seat_client_for_wl_client (g_pCompositor->m_sSeat .seat , wl_resource_get_client ( resource->resource () )));
62
+ const auto SERIAL = wlr_seat_client_next_serial (wlr_seat_client_for_wl_client (g_pCompositor->m_sSeat .seat , resource->client ( )));
63
63
64
64
resource->sendKey (SERIAL, time , key, (uint32_t )state);
65
65
}
66
66
67
67
void CInputMethodKeyboardGrabV2::sendMods (uint32_t depressed, uint32_t latched, uint32_t locked, uint32_t group) {
68
- const auto SERIAL = wlr_seat_client_next_serial (wlr_seat_client_for_wl_client (g_pCompositor->m_sSeat .seat , wl_resource_get_client ( resource->resource () )));
68
+ const auto SERIAL = wlr_seat_client_next_serial (wlr_seat_client_for_wl_client (g_pCompositor->m_sSeat .seat , resource->client ( )));
69
69
70
70
resource->sendModifiers (SERIAL, depressed, latched, locked, group);
71
71
}
@@ -79,7 +79,7 @@ SP<CInputMethodV2> CInputMethodKeyboardGrabV2::getOwner() {
79
79
}
80
80
81
81
wl_client* CInputMethodKeyboardGrabV2::client () {
82
- return wl_resource_get_client ( resource->resource () );
82
+ return resource->client ( );
83
83
}
84
84
85
85
CInputMethodPopupV2::CInputMethodPopupV2 (SP<CZwpInputPopupSurfaceV2> resource_, SP<CInputMethodV2> owner_, wlr_surface* wlrSurface) : resource(resource_), owner(owner_) {
@@ -192,12 +192,11 @@ CInputMethodV2::CInputMethodV2(SP<CZwpInputMethodV2> resource_) : resource(resou
192
192
});
193
193
194
194
resource->setGetInputPopupSurface ([this ](CZwpInputMethodV2* r, uint32_t id, wl_resource* surface) {
195
- const auto CLIENT = wl_resource_get_client (r->resource ());
196
- const auto RESOURCE = PROTO::ime->m_vPopups .emplace_back (std::make_shared<CInputMethodPopupV2>(
197
- std::make_shared<CZwpInputPopupSurfaceV2>(CLIENT, wl_resource_get_version (r->resource ()), id), self.lock (), wlr_surface_from_resource (surface)));
195
+ const auto RESOURCE = PROTO::ime->m_vPopups .emplace_back (
196
+ std::make_shared<CInputMethodPopupV2>(std::make_shared<CZwpInputPopupSurfaceV2>(r->client (), r->version (), id), self.lock (), wlr_surface_from_resource (surface)));
198
197
199
198
if (!RESOURCE->good ()) {
200
- wl_resource_post_no_memory ( r->resource () );
199
+ r->noMemory ( );
201
200
PROTO::ime->m_vPopups .pop_back ();
202
201
return ;
203
202
}
@@ -210,12 +209,11 @@ CInputMethodV2::CInputMethodV2(SP<CZwpInputMethodV2> resource_) : resource(resou
210
209
});
211
210
212
211
resource->setGrabKeyboard ([this ](CZwpInputMethodV2* r, uint32_t id) {
213
- const auto CLIENT = wl_resource_get_client (r->resource ());
214
212
const auto RESOURCE = PROTO::ime->m_vGrabs .emplace_back (
215
- std::make_shared<CInputMethodKeyboardGrabV2>(std::make_shared<CZwpInputMethodKeyboardGrabV2>(CLIENT, wl_resource_get_version ( r->resource () ), id), self.lock ()));
213
+ std::make_shared<CInputMethodKeyboardGrabV2>(std::make_shared<CZwpInputMethodKeyboardGrabV2>(r-> client (), r->version ( ), id), self.lock ()));
216
214
217
215
if (!RESOURCE->good ()) {
218
- wl_resource_post_no_memory ( r->resource () );
216
+ r->noMemory ( );
219
217
PROTO::ime->m_vGrabs .pop_back ();
220
218
return ;
221
219
}
@@ -334,7 +332,7 @@ void CInputMethodV2::setKeyboard(wlr_keyboard* keyboard) {
334
332
}
335
333
336
334
wl_client* CInputMethodV2::client () {
337
- return wl_resource_get_client ( resource->resource () );
335
+ return resource->client ( );
338
336
}
339
337
340
338
CInputMethodV2Protocol::CInputMethodV2Protocol (const wl_interface* iface, const int & ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
@@ -366,11 +364,10 @@ void CInputMethodV2Protocol::destroyResource(CInputMethodV2* ime) {
366
364
}
367
365
368
366
void CInputMethodV2Protocol::onGetIME (CZwpInputMethodManagerV2* mgr, wl_resource* seat, uint32_t id) {
369
- const auto CLIENT = wl_resource_get_client (mgr->resource ());
370
- const auto RESOURCE = m_vIMEs.emplace_back (std::make_shared<CInputMethodV2>(std::make_shared<CZwpInputMethodV2>(CLIENT, wl_resource_get_version (mgr->resource ()), id)));
367
+ const auto RESOURCE = m_vIMEs.emplace_back (std::make_shared<CInputMethodV2>(std::make_shared<CZwpInputMethodV2>(mgr->client (), mgr->version (), id)));
371
368
372
369
if (!RESOURCE->good ()) {
373
- wl_resource_post_no_memory ( mgr->resource () );
370
+ mgr->noMemory ( );
374
371
m_vIMEs.pop_back ();
375
372
return ;
376
373
}
0 commit comments