1414class wayfire_foreign_toplevel ;
1515using foreign_toplevel_map_type = std::map<wayfire_toplevel_view, std::unique_ptr<wayfire_foreign_toplevel>>;
1616
17- class toplevel_gtk_shell1_dbus_properties_t : public wf ::custom_data_t {
17+ class toplevel_gtk_shell1_dbus_properties_t : public wf ::custom_data_t
18+ {
1819 public:
1920 std::optional<std::string> app_menu_path;
2021 std::optional<std::string> menubar_path;
@@ -23,7 +24,8 @@ class toplevel_gtk_shell1_dbus_properties_t : public wf::custom_data_t {
2324 std::optional<std::string> unique_bus_name;
2425};
2526
26- class toplevel_kde_appmenu_path_t : public wf ::custom_data_t {
27+ class toplevel_kde_appmenu_path_t : public wf ::custom_data_t
28+ {
2729 public:
2830 std::optional<std::string> service_name;
2931 std::optional<std::string> object_path;
@@ -300,7 +302,8 @@ class wayfire_foreign_toplevel_protocol_impl : public wf::plugin_interface_t
300302 }
301303
302304 void fini () override
303- {}
305+ {
306+ }
304307
305308 bool is_unloadable () override
306309 {
@@ -319,7 +322,7 @@ class wayfire_foreign_toplevel_protocol_impl : public wf::plugin_interface_t
319322 if (auto props = toplevel->get_data <toplevel_gtk_shell1_dbus_properties_t >())
320323 {
321324 handle_for_view[toplevel]->toplevel_send_gtk_shell1_dbus_properties (
322- nullptr , // !! TODO: application ID
325+ nullptr , // !! TODO: application ID
323326 props->app_menu_path ? props->app_menu_path ->c_str () : nullptr ,
324327 props->menubar_path ? props->menubar_path ->c_str () : nullptr ,
325328 props->window_object_path ? props->window_object_path ->c_str () : nullptr ,
@@ -350,31 +353,59 @@ class wayfire_foreign_toplevel_protocol_impl : public wf::plugin_interface_t
350353 if (it != handle_for_view.end ())
351354 {
352355 it->second ->toplevel_send_gtk_shell1_dbus_properties (
353- nullptr , // !! TODO: application ID
356+ nullptr , // !! TODO: application ID
354357 ev->app_menu_path ,
355358 ev->menubar_path ,
356359 ev->window_object_path ,
357360 ev->application_object_path ,
358361 ev->unique_bus_name );
359362 }
360- /* Store the values with the view. This is necessary to cover
361- * the cases when either:
362- * (1) the view has not been mapped yet; or
363- * (2) the view is later unmapped and remapped
363+
364+ /* Store the values with the view. This is necessary to cover the cases when either:
365+ * (1) the view has not been mapped yet; or (2) the view is later unmapped and remapped
364366 */
365367 auto props = toplevel->get_data_safe <toplevel_gtk_shell1_dbus_properties_t >();
366- if (ev->app_menu_path ) props->app_menu_path = ev->app_menu_path ;
367- else props->app_menu_path .reset ();
368- if (ev->application_object_path ) props->application_object_path =
369- ev->application_object_path ;
370- else props->application_object_path .reset ();
371- if (ev->menubar_path ) props->menubar_path = ev->menubar_path ;
372- else props->menubar_path .reset ();
373- if (ev->unique_bus_name ) props->unique_bus_name = ev->unique_bus_name ;
374- else props->unique_bus_name .reset ();
375- if (ev->window_object_path ) props->window_object_path =
376- ev->window_object_path ;
377- else props->window_object_path .reset ();
368+ if (ev->app_menu_path )
369+ {
370+ props->app_menu_path = ev->app_menu_path ;
371+ } else
372+ {
373+ props->app_menu_path .reset ();
374+ }
375+
376+ if (ev->application_object_path )
377+ {
378+ props->application_object_path =
379+ ev->application_object_path ;
380+ } else
381+ {
382+ props->application_object_path .reset ();
383+ }
384+
385+ if (ev->menubar_path )
386+ {
387+ props->menubar_path = ev->menubar_path ;
388+ } else
389+ {
390+ props->menubar_path .reset ();
391+ }
392+
393+ if (ev->unique_bus_name )
394+ {
395+ props->unique_bus_name = ev->unique_bus_name ;
396+ } else
397+ {
398+ props->unique_bus_name .reset ();
399+ }
400+
401+ if (ev->window_object_path )
402+ {
403+ props->window_object_path =
404+ ev->window_object_path ;
405+ } else
406+ {
407+ props->window_object_path .reset ();
408+ }
378409 }
379410 };
380411
@@ -390,16 +421,26 @@ class wayfire_foreign_toplevel_protocol_impl : public wf::plugin_interface_t
390421 ev->service_name ,
391422 ev->object_path );
392423 }
393- /* Store the values with the view. This is necessary to cover
394- * the cases when either:
395- * (1) the view has not been mapped yet; or
396- * (2) the view is later unmapped and remapped
424+
425+ /* Store the values with the view. This is necessary to cover the cases when either:
426+ * (1) the view has not been mapped yet; or (2) the view is later unmapped and remapped
397427 */
398428 auto props = toplevel->get_data_safe <toplevel_kde_appmenu_path_t >();
399- if (ev->service_name ) props->service_name = ev->service_name ;
400- else props->service_name .reset ();
401- if (ev->object_path ) props->object_path = ev->object_path ;
402- else props->object_path .reset ();
429+ if (ev->service_name )
430+ {
431+ props->service_name = ev->service_name ;
432+ } else
433+ {
434+ props->service_name .reset ();
435+ }
436+
437+ if (ev->object_path )
438+ {
439+ props->object_path = ev->object_path ;
440+ } else
441+ {
442+ props->object_path .reset ();
443+ }
403444 }
404445 };
405446
0 commit comments