@@ -292,6 +292,31 @@ class wayfire_wm_actions_output_t : public wf::per_output_plugin_instance_t
292
292
return true ;
293
293
}
294
294
295
+ bool on_plamo_showdesktop ()
296
+ {
297
+ showdesktop_active = !showdesktop_active;
298
+
299
+ if (showdesktop_active)
300
+ {
301
+ for (auto & view : output->wset ()->get_views ())
302
+ {
303
+ if (!view->minimized )
304
+ {
305
+ wf::get_core ().default_wm ->minimize_request (view, true );
306
+ view->store_data (std::make_unique<wf::custom_data_t >(), " wm-actions-showdesktop" );
307
+ }
308
+ }
309
+
310
+ output->connect (&view_set_output);
311
+ output->connect (&workspace_changed);
312
+ output->connect (&view_minimized);
313
+ output->connect (&on_view_mapped);
314
+ return true ;
315
+ }
316
+
317
+ return true ;
318
+ }
319
+
295
320
void do_send_to_back (wayfire_view view)
296
321
{
297
322
auto view_root = view->get_root_node ();
@@ -397,6 +422,7 @@ class wayfire_wm_actions_t : public wf::plugin_interface_t,
397
422
{
398
423
wf::shared_data::ref_ptr_t <wf::ipc::method_repository_t > ipc_repo;
399
424
wf::ipc_activator_t toggle_showdesktop{" wm-actions/toggle_showdesktop" };
425
+ wf::ipc_activator_t plamo_showdesktop{" wm-actions/plamo_showdesktop" };
400
426
401
427
public:
402
428
void init () override
@@ -408,6 +434,7 @@ class wayfire_wm_actions_t : public wf::plugin_interface_t,
408
434
ipc_repo->register_method (" wm-actions/set-sticky" , ipc_set_sticky);
409
435
ipc_repo->register_method (" wm-actions/send-to-back" , ipc_send_to_back);
410
436
toggle_showdesktop.set_handler (on_toggle_showdesktop);
437
+ plamo_showdesktop.set_handler (on_plamo_showdesktop);
411
438
}
412
439
413
440
void fini () override
@@ -500,6 +527,11 @@ class wayfire_wm_actions_t : public wf::plugin_interface_t,
500
527
{
501
528
return this ->output_instance [output]->on_toggle_showdesktop ();
502
529
};
530
+
531
+ wf::ipc_activator_t ::handler_t on_plamo_showdesktop = [=] (wf::output_t *output, wayfire_view)
532
+ {
533
+ return this ->output_instance [output]->on_plamo_showdesktop ();
534
+ };
503
535
};
504
536
505
537
DECLARE_WAYFIRE_PLUGIN (wayfire_wm_actions_t );
0 commit comments