summaryrefslogtreecommitdiff
path: root/gtk/gtktooltipwindow.c
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2018-08-10 17:11:46 +0200
committerMatthias Clasen <mclasen@redhat.com>2018-08-19 01:26:20 +0000
commit6df28420d7f63a8dfee84cac1299bb92a53e4631 (patch)
tree262bca5966ca67a9d70b7f33b5cfbb672d4a5cd6 /gtk/gtktooltipwindow.c
parent081b45399ffbc011103159401ee619bd8e6e7741 (diff)
downloadgtk+-6df28420d7f63a8dfee84cac1299bb92a53e4631.tar.gz
tooltip: Implement positioning using gdk_window_move_to_rect()
In order to make tooltip positioning portable, make use of the move_to_rect API. Some semantical changes are made, as identical semantics cannot be implemented using the move-to-rect API. Primarily the implemented semantics are: Position the tooltip in the center pixels slightly below (defaults to 4 units below) the tooltipped widget. This is always the case for keyboard driven tooltips; the case where it tries to avoid the pointer cursor is not implemented. For pointer position triggered tooltips, implement the following additional semantics: Use the current cursor size to determine the padding used to enlarge the anchor rectangle. This is to try to avoid the cursor overlapping the tooltip. If the anchor rectangle is too tall (meaning if we'd be constrained and flip on the Y axis, it'd flip too far away from the originally intended position), rely only on the pointer position to position the tooltip. The approximate pointer cursor rectangle is used as a anchor rectangle. Ideally we should use the actual pointer cursor rectangle (image used as well as hotspot coordinate), but we don't have API to get that information. If the anchor rectangle isn't to tall, just make sure the tooltip isn't too far away from the pointer position on the X axis. Closes: #134 Closes: #432 Closes: #574 Closes: #579 Closes: #878
Diffstat (limited to 'gtk/gtktooltipwindow.c')
-rw-r--r--gtk/gtktooltipwindow.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c
index 8fcb2a44a6..f614acb60e 100644
--- a/gtk/gtktooltipwindow.c
+++ b/gtk/gtktooltipwindow.c
@@ -77,7 +77,6 @@ gtk_tooltip_window_init (GtkTooltipWindow *self)
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_window_set_use_subsurface (window, TRUE);
_gtk_window_request_csd (window);
}