Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed document list menu position bug #895

Merged
merged 2 commits into from Aug 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions addons/src/ao_doclist.c
Expand Up @@ -143,16 +143,13 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu
window = gtk_widget_get_window (gtk_widget_get_ancestor(widget, GTK_TYPE_TOOLBAR));
#if GTK_CHECK_VERSION(3, 0, 0)
gdk_window_get_geometry(window, &wx, &wy, &width, NULL);
gtk_widget_get_preferred_size(widget, &widget_req, NULL);
#else
gdk_window_get_geometry(window, &wx, &wy, &width, NULL, NULL);
gtk_widget_size_request(widget, &widget_req);
#endif
gdk_window_get_root_coords(window, wx, wy, &wx_root, &wy_root);
PatrickGMM marked this conversation as resolved.
Show resolved Hide resolved

#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_get_preferred_size(widget, &widget_req, NULL);
#else
gtk_widget_size_request(widget, &widget_req);
#endif
/* Approximate the horizontal location of the overflow menu button */
/* TODO: See if there's a way to find the exact location */
eht16 marked this conversation as resolved.
Show resolved Hide resolved
wx = wx_root + width - (int) (widget_req.width * 1.5);
Expand All @@ -162,13 +159,11 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu
* the doclist menu item
*/
priv->in_overflow_menu = FALSE;

} else {
/* Retrieve size and position of both widget and menu */
window = gtk_widget_get_window(widget);
if (! gtk_widget_get_has_window(widget))
{

GtkAllocation allocation;
gdk_window_get_position(window, &wx, &wy);
gtk_widget_get_allocation(widget, &allocation);
Expand Down