diff options
author | Étienne Deparis <[email protected]> | 2019-04-03 19:59:28 +0200 |
---|---|---|
committer | Martin Wimpress <[email protected]> | 2019-09-23 19:47:14 +0100 |
commit | ccc094e5fe4c7bf49fa2f3aa43d63f8c51d76eb8 (patch) | |
tree | 1b4d2401894a2158242c9170a5a28dc274995e1f /mate-window-picker-applet | |
parent | b77cf36c4a65ad67f6c587d255bc10833780cd8e (diff) | |
download | mate-netbook-ccc094e5fe4c7bf49fa2f3aa43d63f8c51d76eb8.tar.bz2 mate-netbook-ccc094e5fe4c7bf49fa2f3aa43d63f8c51d76eb8.tar.xz |
Remove a runtime error due to event->time sending buggy values
Diffstat (limited to 'mate-window-picker-applet')
-rw-r--r-- | mate-window-picker-applet/task-title.c | 10 | ||||
-rw-r--r-- | 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 <glib.h> #include <glib/gi18n.h> #include <gtk/gtk.h> +#include <gdk/gdkx.h> #define TASK_TYPE_TITLE (task_title_get_type ()) |