Skip to content

Commit 9081ba9

Browse files
sc0wraveit65
authored andcommitted
terminal-window: Fix warnings with menu popup
1 parent 7958d12 commit 9081ba9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/terminal-window.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,9 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
14251425
GtkAction *action;
14261426
gboolean can_paste, can_paste_uris, show_link, show_email_link, show_call_link, show_input_method_menu;
14271427
int n_pages;
1428+
GdkEvent *event;
1429+
GdkSeat *seat;
1430+
GdkDevice *device;
14281431

14291432
if (!gtk_widget_get_realized (GTK_WIDGET (screen)))
14301433
{
@@ -1491,7 +1494,17 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
14911494
if (!gtk_menu_get_attach_widget (GTK_MENU (popup_menu)))
14921495
gtk_menu_attach_to_widget (GTK_MENU (popup_menu),GTK_WIDGET (screen),NULL);
14931496

1494-
gtk_menu_popup_at_pointer (GTK_MENU (popup_menu), NULL);
1497+
event = gtk_get_current_event ();
1498+
1499+
seat = gdk_display_get_default_seat (gdk_display_get_default());
1500+
1501+
device = gdk_seat_get_pointer (seat);
1502+
1503+
gdk_event_set_device (event, device);
1504+
1505+
gtk_menu_popup_at_pointer (GTK_MENU (popup_menu), (const GdkEvent*) event);
1506+
1507+
gdk_event_free (event);
14951508
}
14961509

14971510
static void

0 commit comments

Comments
 (0)