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

Method deactivate

plugins/cube/cube.cpp:404–434  ·  view source on GitHub ↗

Disable custom rendering and deactivate plugin */

Source from the content-addressed store, hash-verified

402
403 /* Disable custom rendering and deactivate plugin */
404 void deactivate()
405 {
406 if (!output->is_plugin_active(grab_interface.name))
407 {
408 return;
409 }
410
411 wf::scene::remove_child(render_node);
412 output->render->damage_whole();
413
414 render_node = nullptr;
415 output->render->rem_effect(&pre_hook);
416 output->render->set_require_depth_buffer(false);
417
418 input_grab->ungrab_input();
419 output->deactivate_plugin(&grab_interface);
420 wf::get_core().unhide_cursor();
421 on_motion_event.disconnect();
422
423 /* Figure out how much we have rotated and switch workspace */
424 int size = get_num_faces();
425 int dvx = calculate_viewport_dx_from_rotation();
426
427 auto cws = output->wset()->get_current_workspace();
428 int nvx = (cws.x + (dvx % size) + size) % size;
429 output->wset()->set_workspace({nvx, cws.y});
430
431 /* We are finished with rotation, make sure the next time cube is used
432 * it is properly reset */
433 animation.cube_animation.rotation.set(0, 0);
434 }
435
436 /* Sets attributes target to such values that the cube effect isn't visible,
437 * i.e towards the starting(or ending) position

Callers 10

renderMethod · 0.45
render_frameMethod · 0.45
render_frameMethod · 0.45
renderMethod · 0.45
blur_fb0Method · 0.45
blur_fb0Method · 0.45
blur_fb0Method · 0.45
renderMethod · 0.45
blur_fb0Method · 0.45
render_trianglesFunction · 0.45

Calls 12

remove_childFunction · 0.85
is_plugin_activeMethod · 0.80
ungrab_inputMethod · 0.80
deactivate_pluginMethod · 0.80
wsetMethod · 0.80
damage_wholeMethod · 0.45
rem_effectMethod · 0.45
unhide_cursorMethod · 0.45
disconnectMethod · 0.45
get_current_workspaceMethod · 0.45
set_workspaceMethod · 0.45

Tested by

no test coverage detected