13
0

Fix event_inside_widget_window()

This fixes cases where a widget's parent isn't the
top-level window and additional offset has to be taken
into account.

So far this has not been an issue since this method was only
used for floating text entries.
This commit is contained in:
Robin Gareus 2021-05-18 22:16:40 +02:00
parent 8cd8d90483
commit 0ee8b1706d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1032,15 +1032,14 @@ Gtkmm2ext::event_inside_widget_window (Gtk::Widget& widget, GdkEvent* ev)
return false;
}
gint wx;
gint wy;
gint width, height, depth;
gint x, y;
gint wx, wy;
gint width, height, depth;
Glib::RefPtr<Gdk::Window> widget_window = widget.get_window();
widget_window->get_geometry (x, y, width, height, depth);
widget_window->get_root_origin (wx, wy);
widget_window->get_origin (wx, wy);
if ((evx >= wx && evx < wx + width) &&
(evy >= wy && evy < wy + height)) {