From ac3d8ca27239d586d5cd7fdbfbd3ec55713ae1aa Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 2 Feb 2016 03:54:53 +0100 Subject: added gtk_info_popup_get_position_in_overlay() and workaround size allocation issue * this is a callback for GtkOverlay's "get-child-position" signal that allocates a size to the popup. * cleaner than overwriting the size_allocate method and does not assume apriori that the popup is part of an overlay. * the popup was always allocated a few pixels too little height, resulting the GtkViewbox always scrolling. Actually it requests a few pixels too little. We now workaround that by adding a constant value to its natural height when allocating a position in the overlay. This is of course a non-portable hack. --- src/interface-gtk/interface-gtk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interface-gtk/interface-gtk.cpp') diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp index b204caa..d718deb 100644 --- a/src/interface-gtk/interface-gtk.cpp +++ b/src/interface-gtk/interface-gtk.cpp @@ -197,9 +197,9 @@ InterfaceGtk::main_impl(int &argc, char **&argv) * filling the entire width. */ popup_widget = gtk_info_popup_new(); - gtk_widget_set_halign(popup_widget, GTK_ALIGN_FILL); - gtk_widget_set_valign(popup_widget, GTK_ALIGN_END); gtk_overlay_add_overlay(GTK_OVERLAY(overlay_widget), popup_widget); + g_signal_connect(overlay_widget, "get-child-position", + G_CALLBACK(gtk_info_popup_get_position_in_overlay), NULL); gtk_widget_grab_focus(cmdline_widget); -- cgit v1.2.3