From 8e80c503c4ad85f24b01940f8ab8cdfe0f443e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Deparis?= Date: Wed, 3 Apr 2019 19:59:28 +0200 Subject: Remove a runtime error due to event->time sending buggy values --- mate-window-picker-applet/task-title.c | 10 +++++++--- mate-window-picker-applet/task-title.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mate-window-picker-applet/task-title.c b/mate-window-picker-applet/task-title.c index 8a8660e..6170c4c 100644 --- a/mate-window-picker-applet/task-title.c +++ b/mate-window-picker-applet/task-title.c @@ -74,7 +74,12 @@ on_close_clicked (GtkButton *button, { if (priv->window == window) disconnect_window (title); - wnck_window_close (window, event->time); + // event->time is buggy, thus we have to workaroud this + GdkScreen *gdkscreen; + GdkDisplay *display; + gdkscreen = gtk_widget_get_screen (GTK_WIDGET (title)); + display = gdk_screen_get_display (gdkscreen); + wnck_window_close (window, gdk_x11_display_get_user_time (display)); } gtk_widget_queue_draw (GTK_WIDGET (title)); @@ -342,8 +347,7 @@ on_button_release (GtkWidget *title, GdkEventButton *event) if (wnck_window_get_window_type (window) != WNCK_WINDOW_DESKTOP) { menu = wnck_action_menu_new (window); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button, event->time); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent*)event); return TRUE; } } diff --git a/mate-window-picker-applet/task-title.h b/mate-window-picker-applet/task-title.h index 5161a9d..d87786b 100644 --- a/mate-window-picker-applet/task-title.h +++ b/mate-window-picker-applet/task-title.h @@ -23,6 +23,7 @@ #include #include #include +#include #define TASK_TYPE_TITLE (task_title_get_type ()) -- cgit v1.2.1