Disable custom rendering and deactivate plugin */
| 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 |
no test coverage detected