diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-05-08 20:46:37 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-05-08 20:46:37 +0100 |
commit | 4b8ed9b7775aec686a46b1b2be01a4efa1214e55 (patch) | |
tree | 02c359c4946a039a2a9acf374c6fc29768f13c1c /frontends/gtk/page_info.c | |
parent | 14e506f89f971ddbe204576092c6ffec59e85248 (diff) | |
download | netsurf-4b8ed9b7775aec686a46b1b2be01a4efa1214e55.tar.gz netsurf-4b8ed9b7775aec686a46b1b2be01a4efa1214e55.tar.bz2 |
GTK: Cause the page-info popup to appear in the right place
To position the page-info window we have to tunnel all the
way from the current scaffolding, via its top-level gui window,
through to the toolbar. In the toolbar we look up the URL bar
and then determine the screen coordinates of the scaffolding
via the top level widget GTK semantics.
Finally we place the page-info window 4 pixels down and right of
the bottom-left of the entry box, which should look nice.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'frontends/gtk/page_info.c')
-rw-r--r-- | frontends/gtk/page_info.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/frontends/gtk/page_info.c b/frontends/gtk/page_info.c index a3e2747b7..0d76a2f71 100644 --- a/frontends/gtk/page_info.c +++ b/frontends/gtk/page_info.c @@ -197,6 +197,10 @@ nserror nsgtk_page_info(struct browser_window *bw) gtk_window_set_screen(GTK_WINDOW(ncwin->dlg), gtk_widget_get_screen(GTK_WIDGET(scaffwin))); + /* Attempt to place the window in the right place */ + nsgtk_scaffolding_position_page_info(nsgtk_current_scaffolding(), + ncwin); + ncwin->core.drawing_area = GTK_DRAWING_AREA( gtk_builder_get_object(ncwin->builder, "PGIDrawingArea")); @@ -243,3 +247,12 @@ nserror nsgtk_page_info(struct browser_window *bw) return NSERROR_OK; } + +/* exported interface documented in gtk/page_info.h */ +void +nsgtk_page_info_set_position(struct nsgtk_pi_window *win, int x, int y) +{ + NSLOG(netsurf, INFO, "win=%p x=%d y=%d", win, x, y); + + gtk_window_move(GTK_WINDOW(win->dlg), x, y); +} |