diff options
author | rbuj <[email protected]> | 2021-12-17 14:17:29 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-12-20 16:57:51 +0100 |
commit | 54e2bb1acaf71b7b54e796f7bfa311fb32d84830 (patch) | |
tree | 74dff7552f367c583be5f1f1944a3b911f32f2c3 /applets/wncklet | |
parent | 5bd053ad542479eaec4166e45195c5e911472f88 (diff) | |
download | mate-panel-54e2bb1acaf71b7b54e796f7bfa311fb32d84830.tar.bz2 mate-panel-54e2bb1acaf71b7b54e796f7bfa311fb32d84830.tar.xz |
Remove unnecessary cast in g_signal_connect* call
Diffstat (limited to 'applets/wncklet')
-rw-r--r-- | applets/wncklet/showdesktop.c | 36 | ||||
-rw-r--r-- | applets/wncklet/wayland-backend.c | 3 | ||||
-rw-r--r-- | applets/wncklet/window-list.c | 71 | ||||
-rw-r--r-- | applets/wncklet/window-menu.c | 24 | ||||
-rw-r--r-- | applets/wncklet/workspace-switcher.c | 54 |
5 files changed, 137 insertions, 51 deletions
diff --git a/applets/wncklet/showdesktop.c b/applets/wncklet/showdesktop.c index 851cd7b0..6b8dfa70 100644 --- a/applets/wncklet/showdesktop.c +++ b/applets/wncklet/showdesktop.c @@ -421,7 +421,9 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet) sdd->size = mate_panel_applet_get_size(MATE_PANEL_APPLET(sdd->applet)); - g_signal_connect(G_OBJECT(sdd->applet), "realize", G_CALLBACK(show_desktop_applet_realized), sdd); + g_signal_connect (sdd->applet, "realize", + G_CALLBACK (show_desktop_applet_realized), + sdd); sdd->button = gtk_toggle_button_new (); @@ -441,21 +443,29 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet) atk_obj = gtk_widget_get_accessible(sdd->button); atk_object_set_name (atk_obj, _("Show Desktop Button")); - g_signal_connect(G_OBJECT(sdd->button), "button-press-event", G_CALLBACK(do_not_eat_button_press), NULL); + g_signal_connect (sdd->button, "button-press-event", + G_CALLBACK(do_not_eat_button_press), + NULL); - g_signal_connect(G_OBJECT(sdd->button), "toggled", G_CALLBACK(button_toggled_callback), sdd); + g_signal_connect (sdd->button, "toggled", + G_CALLBACK (button_toggled_callback), + sdd); gtk_container_set_border_width(GTK_CONTAINER(sdd->button), 0); gtk_container_add(GTK_CONTAINER(sdd->button), sdd->image); gtk_container_add(GTK_CONTAINER(sdd->applet), sdd->button); - g_signal_connect (G_OBJECT(sdd->button), "size-allocate", G_CALLBACK(button_size_allocated), sdd); + g_signal_connect (sdd->button, "size-allocate", + G_CALLBACK (button_size_allocated), + sdd); /* FIXME: Update this comment. */ /* we have to bind change_orient before we do applet_widget_add since we need to get an initial change_orient signal to set our initial oriantation, and we get that during the _add call */ - g_signal_connect(G_OBJECT (sdd->applet), "change-orient", G_CALLBACK (applet_change_orient), sdd); + g_signal_connect (sdd->applet, "change-orient", + G_CALLBACK (applet_change_orient), + sdd); action_group = gtk_action_group_new("ShowDesktop Applet Actions"); gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE); @@ -465,12 +475,18 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet) action_group); g_object_unref(action_group); - g_signal_connect(G_OBJECT(sdd->applet), "destroy", G_CALLBACK(applet_destroyed), sdd); + g_signal_connect (sdd->applet, "destroy", + G_CALLBACK (applet_destroyed), + sdd); gtk_drag_dest_set(GTK_WIDGET(sdd->button), 0, NULL, 0, 0); - g_signal_connect(G_OBJECT(sdd->button), "drag-motion", G_CALLBACK (button_drag_motion), sdd); - g_signal_connect(G_OBJECT(sdd->button), "drag-leave", G_CALLBACK (button_drag_leave), sdd); + g_signal_connect (sdd->button, "drag-motion", + G_CALLBACK (button_drag_motion), + sdd); + g_signal_connect (sdd->button, "drag-leave", + G_CALLBACK (button_drag_leave), + sdd); gtk_widget_show_all(sdd->applet); @@ -551,7 +567,9 @@ static void button_toggled_callback(GtkWidget* button, ShowDesktopData* sdd) g_object_add_weak_pointer(G_OBJECT(dialog), (gpointer) &dialog); - g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), NULL); + g_signal_connect (dialog, "response", + G_CALLBACK(gtk_widget_destroy), + NULL); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_window_set_screen(GTK_WINDOW(dialog), gtk_widget_get_screen(button)); diff --git a/applets/wncklet/wayland-backend.c b/applets/wncklet/wayland-backend.c index 00d96025..f82b7fee 100644 --- a/applets/wncklet/wayland-backend.c +++ b/applets/wncklet/wayland-backend.c @@ -352,8 +352,7 @@ toplevel_task_new (TasklistManager *tasklist, struct zwlr_foreign_toplevel_handl task, (GDestroyNotify)toplevel_task_disconnected_from_widget); - g_signal_connect (G_OBJECT (task->button), - "button-press-event", + g_signal_connect (task->button, "button-press-event", G_CALLBACK (on_toplevel_button_press), task); diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index 77cce1ce..758933b3 100644 --- a/applets/wncklet/window-list.c +++ b/applets/wncklet/window-list.c @@ -419,7 +419,10 @@ static gboolean applet_enter_notify_event (WnckTasklist *tl, GList *wnck_windows gtk_widget_show (tasklist->preview); - g_signal_connect_data (G_OBJECT (tasklist->preview), "draw", G_CALLBACK (preview_window_draw), thumbnail, (GClosureNotify) G_CALLBACK (cairo_surface_destroy), 0); + g_signal_connect_data (tasklist->preview, "draw", + G_CALLBACK (preview_window_draw), thumbnail, + (GClosureNotify) G_CALLBACK (cairo_surface_destroy), + 0); return FALSE; } @@ -808,8 +811,12 @@ gboolean window_list_applet_fill(MatePanelApplet* applet) wnck_tasklist_set_icon_loader(WNCK_TASKLIST(tasklist->tasklist), icon_loader_func, tasklist, NULL); #ifdef HAVE_WINDOW_PREVIEWS - g_signal_connect(G_OBJECT(tasklist->tasklist), "task-enter-notify", G_CALLBACK(applet_enter_notify_event), tasklist); - g_signal_connect(G_OBJECT(tasklist->tasklist), "task-leave-notify", G_CALLBACK(applet_leave_notify_event), tasklist); + g_signal_connect (tasklist->tasklist, "task-enter-notify", + G_CALLBACK (applet_enter_notify_event), + tasklist); + g_signal_connect (tasklist->tasklist, "task-leave-notify", + G_CALLBACK (applet_leave_notify_event), + tasklist); #endif /* HAVE_WINDOW_PREVIEWS */ } else @@ -829,15 +836,27 @@ gboolean window_list_applet_fill(MatePanelApplet* applet) tasklist_apply_orientation(tasklist); - g_signal_connect(G_OBJECT(tasklist->tasklist), "destroy", G_CALLBACK(destroy_tasklist), tasklist); - g_signal_connect(G_OBJECT(tasklist->applet), "size-allocate", G_CALLBACK(applet_size_allocate), tasklist); + g_signal_connect (tasklist->tasklist, "destroy", + G_CALLBACK (destroy_tasklist), + tasklist); + g_signal_connect (tasklist->applet, "size-allocate", + G_CALLBACK (applet_size_allocate), + tasklist); gtk_container_add(GTK_CONTAINER(tasklist->applet), tasklist->tasklist); - g_signal_connect(G_OBJECT(tasklist->applet), "realize", G_CALLBACK(applet_realized), tasklist); - g_signal_connect(G_OBJECT(tasklist->applet), "change-orient", G_CALLBACK(applet_change_orient), tasklist); - g_signal_connect(G_OBJECT(tasklist->applet), "change-size", G_CALLBACK(applet_change_pixel_size), tasklist); - g_signal_connect(G_OBJECT(tasklist->applet), "change-background", G_CALLBACK(applet_change_background), tasklist); + g_signal_connect (tasklist->applet, "realize", + G_CALLBACK (applet_realized), + tasklist); + g_signal_connect (tasklist->applet, "change-orient", + G_CALLBACK (applet_change_orient), + tasklist); + g_signal_connect (tasklist->applet, "change-size", + G_CALLBACK (applet_change_pixel_size), + tasklist); + g_signal_connect (tasklist->applet, "change-background", + G_CALLBACK(applet_change_background), + tasklist); action_group = gtk_action_group_new("Tasklist Applet Actions"); gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE); @@ -1071,9 +1090,15 @@ static void setup_dialog(GtkBuilder* builder, TasklistData* tasklist) g_object_set_data(G_OBJECT(tasklist->auto_group_radio), "group_value", "auto"); g_object_set_data(G_OBJECT(tasklist->always_group_radio), "group_value", "always"); - g_signal_connect(G_OBJECT(tasklist->never_group_radio), "toggled", (GCallback) group_windows_toggled, tasklist); - g_signal_connect(G_OBJECT(tasklist->auto_group_radio), "toggled", (GCallback) group_windows_toggled, tasklist); - g_signal_connect(G_OBJECT(tasklist->always_group_radio), "toggled", (GCallback) group_windows_toggled, tasklist); + g_signal_connect (tasklist->never_group_radio, "toggled", + (GCallback) group_windows_toggled, + tasklist); + g_signal_connect (tasklist->auto_group_radio, "toggled", + (GCallback) group_windows_toggled, + tasklist); + g_signal_connect (tasklist->always_group_radio, "toggled", + (GCallback) group_windows_toggled, + tasklist); /* Mouse Scroll: */ g_settings_bind (tasklist->settings, @@ -1085,19 +1110,29 @@ static void setup_dialog(GtkBuilder* builder, TasklistData* tasklist) #ifdef HAVE_WINDOW_PREVIEWS /* change thumbnail size: */ tasklist_update_thumbnail_size_spin(tasklist); - g_signal_connect(G_OBJECT(tasklist->thumbnail_size_spin), "value-changed", (GCallback) thumbnail_size_spin_changed, tasklist); + g_signal_connect (tasklist->thumbnail_size_spin, "value-changed", + (GCallback) thumbnail_size_spin_changed, + tasklist); #endif /* move window when unminimizing: */ tasklist_update_unminimization_radio(tasklist); - g_signal_connect(G_OBJECT(tasklist->move_minimized_radio), "toggled", (GCallback) move_minimized_toggled, tasklist); + g_signal_connect (tasklist->move_minimized_radio, "toggled", + (GCallback) move_minimized_toggled, + tasklist); /* Tasklist content: */ tasklist_properties_update_content_radio (tasklist); - g_signal_connect(G_OBJECT(tasklist->show_all_radio), "toggled", (GCallback) display_all_workspaces_toggled, tasklist); - - g_signal_connect_swapped(WID("done_button"), "clicked", (GCallback) gtk_widget_hide, tasklist->properties_dialog); - g_signal_connect(tasklist->properties_dialog, "response", G_CALLBACK(response_cb), tasklist); + g_signal_connect (tasklist->show_all_radio, "toggled", + (GCallback) display_all_workspaces_toggled, + tasklist); + + g_signal_connect_swapped (WID ("done_button"), "clicked", + (GCallback) gtk_widget_hide, + tasklist->properties_dialog); + g_signal_connect (tasklist->properties_dialog, "response", + G_CALLBACK (response_cb), + tasklist); #ifdef HAVE_WAYLAND if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) { diff --git a/applets/wncklet/window-menu.c b/applets/wncklet/window-menu.c index 88ab5514..4b4e48dc 100644 --- a/applets/wncklet/window-menu.c +++ b/applets/wncklet/window-menu.c @@ -271,13 +271,23 @@ gboolean window_menu_applet_fill(MatePanelApplet* applet) gtk_container_add(GTK_CONTAINER(window_menu->applet), window_menu->selector); - g_signal_connect(window_menu->applet, "size-allocate", G_CALLBACK(window_menu_size_allocate), window_menu); - - g_signal_connect_after(G_OBJECT(window_menu->applet), "focus-in-event", G_CALLBACK(gtk_widget_queue_draw), window_menu); - g_signal_connect_after(G_OBJECT(window_menu->applet), "focus-out-event", G_CALLBACK(gtk_widget_queue_draw), window_menu); - g_signal_connect_after(G_OBJECT(window_menu->selector), "draw", G_CALLBACK(window_menu_on_draw), window_menu); - - g_signal_connect(G_OBJECT(window_menu->selector), "button-press-event", G_CALLBACK(filter_button_press), window_menu); + g_signal_connect (window_menu->applet, "size-allocate", + G_CALLBACK(window_menu_size_allocate), + window_menu); + + g_signal_connect_after (window_menu->applet, "focus-in-event", + G_CALLBACK (gtk_widget_queue_draw), + window_menu); + g_signal_connect_after (window_menu->applet, "focus-out-event", + G_CALLBACK (gtk_widget_queue_draw), + window_menu); + g_signal_connect_after (window_menu->selector, "draw", + G_CALLBACK (window_menu_on_draw), + window_menu); + + g_signal_connect (window_menu->selector, "button_press_event", + G_CALLBACK (filter_button_press), + window_menu); gtk_widget_show_all(GTK_WIDGET(window_menu->applet)); diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c index e85c9ddb..153614d9 100644 --- a/applets/wncklet/workspace-switcher.c +++ b/applets/wncklet/workspace-switcher.c @@ -649,21 +649,35 @@ gboolean workspace_switcher_applet_fill(MatePanelApplet* applet) context = gtk_widget_get_style_context (pager->pager); gtk_style_context_add_class (context, "wnck-pager"); - g_signal_connect(G_OBJECT(pager->pager), "destroy", G_CALLBACK(destroy_pager), pager); + g_signal_connect (pager->pager, "destroy", + G_CALLBACK (destroy_pager), + pager); /* overwrite default WnckPager widget scroll-event */ - g_signal_connect(G_OBJECT(pager->pager), "scroll-event", G_CALLBACK(applet_scroll), pager); + g_signal_connect (pager->pager, "scroll-event", + G_CALLBACK (applet_scroll), + pager); gtk_container_add(GTK_CONTAINER(pager->applet), pager->pager); - g_signal_connect(G_OBJECT(pager->applet), "realize", G_CALLBACK(applet_realized), pager); - g_signal_connect(G_OBJECT(pager->applet), "unrealize", G_CALLBACK(applet_unrealized), pager); - g_signal_connect(G_OBJECT(pager->applet), "change-orient", G_CALLBACK(applet_change_orient), pager); - g_signal_connect(G_OBJECT(pager->applet), "change-background", G_CALLBACK(applet_change_background), pager); - g_signal_connect(G_OBJECT(pager->applet), "style-updated", G_CALLBACK(applet_style_updated), context); - - gtk_widget_show(pager->pager); - gtk_widget_show(pager->applet); + g_signal_connect (pager->applet, "realize", + G_CALLBACK (applet_realized), + pager); + g_signal_connect (pager->applet, "unrealize", + G_CALLBACK (applet_unrealized), + pager); + g_signal_connect (pager->applet, "change-orient", + G_CALLBACK (applet_change_orient), + pager); + g_signal_connect (pager->applet, "change-background", + G_CALLBACK (applet_change_background), + pager); + g_signal_connect (pager->applet, "style-updated", + G_CALLBACK (applet_style_updated), + context); + + gtk_widget_show (pager->pager); + gtk_widget_show (pager->applet); action_group = gtk_action_group_new("WorkspaceSwitcher Applet Actions"); gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE); @@ -1003,18 +1017,24 @@ static void setup_dialog(GtkBuilder* builder, PagerData* pager) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->wrap_workspaces_toggle), pager->wrap_workspaces); } - g_signal_connect(G_OBJECT(pager->wrap_workspaces_toggle), "toggled", (GCallback) wrap_workspaces_toggled, pager); + g_signal_connect (pager->wrap_workspaces_toggle, "toggled", + (GCallback) wrap_workspaces_toggled, + pager); /* Display workspace names: */ - g_signal_connect(G_OBJECT(pager->display_workspaces_toggle), "toggled", (GCallback) display_workspace_names_toggled, pager); + g_signal_connect (pager->display_workspaces_toggle, "toggled", + (GCallback) display_workspace_names_toggled, + pager); value = pager->display_names; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->display_workspaces_toggle), value); /* Display all workspaces: */ - g_signal_connect(G_OBJECT(pager->all_workspaces_radio), "toggled", (GCallback) all_workspaces_toggled, pager); + g_signal_connect (pager->all_workspaces_radio, "toggled", + (GCallback) all_workspaces_toggled, + pager); if (pager->display_all) { @@ -1060,9 +1080,13 @@ static void setup_dialog(GtkBuilder* builder, PagerData* pager) } #endif /* HAVE_X11 */ - g_signal_connect (pager->num_workspaces_spin, "value-changed", G_CALLBACK (on_num_workspaces_value_changed), pager); + g_signal_connect (pager->num_workspaces_spin, "value-changed", + G_CALLBACK (on_num_workspaces_value_changed), + pager); - g_signal_connect(G_OBJECT(pager->workspaces_tree), "focus-out-event", (GCallback) workspaces_tree_focused_out, pager); + g_signal_connect (pager->workspaces_tree, "focus-out-event", + (GCallback) workspaces_tree_focused_out, + pager); pager->workspaces_store = gtk_list_store_new(1, G_TYPE_STRING, NULL); update_workspaces_model(pager); |