Comment 23 for bug 37507

Revision history for this message
In , Caillon (caillon) wrote :

Comment on attachment 297343
after bug 408823 landing

>Index: embedding/browser/gtk/src/EmbedWindow.cpp

>+ gint x, y;
>+ gdk_window_get_origin(widget->window, &x, &y);
>+
>+ x += aXCoords;
>+ y += aYCoords;
>+
>+ // Ideally we'd query the cursor size and hotspot,
>+ // but there appears to be no way to do that */
>+ int xoffset = 8, yoffset = 8;

You're using gints above so use them here, too. And fix the comment.

>+ if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL) {
>+ x -= req.width + xoffset;
>+ } else {
>+ x += xoffset;
>+ }
>
>- // and show it.
>- gtk_widget_show_all(sTipWindow);
>+ if (x + req.width > monitor.x + monitor.width)
>+ x = monitor.x + monitor.width - req.width;
>+ else if (x < monitor.x)
>+ x = monitor.x;
>+
>+ if (y + req.height + yoffset <= monitor.y + monitor.height)
>+ y += yoffset;
>+ else
>+ y -= req.height + yoffset;

Please use consistent bracing.

r=caillon with those nits addressed.