Skip to content

Commit

Permalink
Fix Travis failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed May 7, 2019
1 parent f1fe106 commit eec00c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions gnucash/gnome-utils/gnc-cell-renderer-popup.c
Expand Up @@ -271,10 +271,13 @@ gcrp_show_popup (GncCellRendererPopup *cell,
gint y2)
{
#if GTK_CHECK_VERSION(3,22,0)
GdkWindow *win;
GdkMonitor *mon;
GdkRectangle monitor_size;
#else
GdkScreen *screen;
int monitor_num;
#endif
GdkWindow *win;
GdkRectangle monitor_size;
GtkAllocation alloc;
gint x, y;
gint screen_height, screen_width;
Expand All @@ -297,18 +300,19 @@ gcrp_show_popup (GncCellRendererPopup *cell,

button_height = y2 - y1;

win = gtk_widget_get_window (cell->popup_window);
#if GTK_CHECK_VERSION(3,22,0)
win = gdk_screen_get_root_window (gtk_window_get_screen (GTK_WINDOW (cell->popup_window)));
mon = gdk_display_get_monitor_at_window (gtk_widget_get_display (GTK_WIDGET(cell->popup_window)), win);
mon = gdk_display_get_monitor_at_window (gtk_widget_get_display (cell->popup_window), win);
gdk_monitor_get_geometry (mon, &monitor_size);

screen_width = monitor_size.width;
screen_height = monitor_size.height - y;
#else
screen_width = gdk_screen_width();
screen_height = gdk_screen_height() - y;
screen = gtk_window_get_screen (cell->popup_window);
monitor_num = gdk_screen_get_monitor_at_window (screen, win);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor_size);
#endif

screen_width = monitor_size.width;
screen_height = monitor_size.height - y;

/* Check if it fits in the available height. */
if (alloc.height > screen_height) {
/* It doesn't fit, so we see if we have the minimum space needed. */
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/dialog-invoice.c
Expand Up @@ -1932,7 +1932,7 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
/* Setup viewer for read-only access */
gtk_widget_set_sensitive (acct_entry, FALSE);
gtk_widget_set_sensitive (iw->id_entry, FALSE);
gtk_widget_set_selectable (iw->id_entry, TRUE);
gtk_widget_set_sensitive (iw->id_entry, TRUE);
gtk_widget_set_sensitive (iw->terms_menu, FALSE);
gtk_widget_set_sensitive (iw->owner_box, FALSE);
gtk_widget_set_sensitive (iw->job_box, FALSE);
Expand Down

0 comments on commit eec00c8

Please sign in to comment.