From 9512d58c28434aca03f445b6ab80d8a5a7a9268a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 18 Feb 2021 12:14:47 +0100 Subject: [PATCH] display: Don't add MetaDisplay argument to grab-op-* signals twice GObject signals pass the emitting GObject as the first argument to signal handler callbacks. When refactoring the grab-op-begin/end signals to remove MetaScreen with commit 1d5e37050df2b8e1db8b5ea301ee0162d77d4b74, the "screen" argument was replaced with a "display" argument instead of being removed completely. This made us call the signal handlers with two identical MetaDisplay arguments, which is very confusing and actually wasn't handled in a grab-op-begin handler in gnome-shell. So fix this by not adding the MetaDisplay as an argument to those signals, GObject will take care of that for us. Part-of: --- src/compositor/compositor.c | 2 -- src/core/display.c | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 8c72d92b9..639d6225c 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -438,7 +438,6 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor, display->grab_have_keyboard = TRUE; g_signal_emit_by_name (display, "grab-op-begin", - meta_plugin_get_display (plugin), display->grab_window, display->grab_op); meta_compositor_grab_begin (compositor); @@ -472,7 +471,6 @@ meta_end_modal_for_plugin (MetaCompositor *compositor, meta_compositor_grab_end (compositor); g_signal_emit_by_name (display, "grab-op-end", - meta_plugin_get_display (plugin), grab_window, grab_op); } diff --git a/src/core/display.c b/src/core/display.c index 4784af679..8261d4255 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -332,8 +332,7 @@ meta_display_class_init (MetaDisplayClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, - G_TYPE_NONE, 3, - META_TYPE_DISPLAY, + G_TYPE_NONE, 2, META_TYPE_WINDOW, META_TYPE_GRAB_OP); @@ -343,8 +342,7 @@ meta_display_class_init (MetaDisplayClass *klass) G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, - G_TYPE_NONE, 3, - META_TYPE_DISPLAY, + G_TYPE_NONE, 2, META_TYPE_WINDOW, META_TYPE_GRAB_OP); @@ -1906,7 +1904,7 @@ meta_display_begin_grab_op (MetaDisplay *display, } g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0, - display, display->grab_window, display->grab_op); + display->grab_window, display->grab_op); if (display->event_route == META_EVENT_ROUTE_WINDOW_OP) meta_window_grab_op_began (display->grab_window, display->grab_op); @@ -1979,7 +1977,7 @@ meta_display_end_grab_op (MetaDisplay *display, meta_display_sync_wayland_input_focus (display); g_signal_emit (display, display_signals[GRAB_OP_END], 0, - display, grab_window, grab_op); + grab_window, grab_op); } /**