MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / create_hotspot

Method create_hotspot

plugins/protocols/wayfire-shell.cpp:313–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 void create_hotspot(uint32_t hotspot, uint32_t threshold, uint32_t timeout,
314 uint32_t id)
315 {
316 if (!this->output)
317 {
318 // It can happen that the client requests a hotspot immediately after an output is destroyed -
319 // this is an inherent race condition because the compositor and client are not in sync.
320 //
321 // In this case, we create a dummy hotspot resource to avoid Wayland protocol errors.
322 auto resource = wl_resource_create(
323 wl_resource_get_client(this->resource), &zwf_hotspot_v2_interface, 1, id);
324 wl_resource_set_implementation(resource, NULL, NULL, NULL);
325 return;
326 }
327
328 // will be auto-deleted when the resource is destroyed by the client
329 new wfs_hotspot(this->output, hotspot, threshold, timeout,
330 wl_resource_get_client(this->resource), id);
331 }
332};
333
334static void handle_zwf_output_inhibit_output(wl_client*, wl_resource *resource)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected