monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
gtk_menu_set_monitor (menu, monitor_num);
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+ gdk_screen_get_monitor_workarea (screen, monitor_num, &monitor);
*x = CLAMP (*x, monitor.x, monitor.x + MAX (0, monitor.width - req.width));
*y = CLAMP (*y, monitor.y, monitor.y + MAX (0, monitor.height - req.height));
GtkTextView *text_view;
gint button;
guint time;
+ GdkDevice *device;
} PopupInfo;
static gboolean
0,
priv->popup_menu);
- if (info->button)
- gtk_menu_popup (GTK_MENU (priv->popup_menu), NULL, NULL,
- NULL, NULL,
+ if (info->device)
+ gtk_menu_popup_for_device (GTK_MENU (priv->popup_menu),
+ info->device, NULL, NULL, NULL, NULL, NULL,
info->button, info->time);
else
{
{
info->button = event->button;
info->time = event->time;
+ info->device = event->device;
}
else
{
info->button = 0;
info->time = gtk_get_current_event_time ();
+ info->device = NULL;
}
gtk_clipboard_request_contents (gtk_widget_get_clipboard (GTK_WIDGET (text_view),
gtk_text_layout_get_cursor_locations (priv->layout, &iter,
&strong, &weak);
- /* cursor width calculation as in gtkstyle.c:draw_insertion_cursor(),
+ /* cursor width calculation as in gtkstylecontext.c:draw_insertion_cursor(),
* ignoring the text direction be exposing both sides of the cursor
*/